
/// clear default form field text & apply class to form field
//

function clearDefaultText(inputField){
	if (inputField.defaultValue==inputField.value){
		inputField.value = "";
		inputField.className = inputField.className + " defaultcleared";
	}
}


//
// prevents CSS image flicker on hover in IE6
// http://www.mister-pixel.com/#Content__state=
//

try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}


//
// fixes 1px background alignment bug
// http://www.sohtanaka.com/web-design/1px-background-alignment-bug/
//

fixAligment = function() {
var viewportwidth = $(window).width();
var margin_left = (viewportwidth  % 2 == 1) ? '1px' : '0px';
$("body").css("margin-left", margin_left);
}


;(function($) {
    $(document).ready(function() {

        // Fix 1px background alignment bug
        $(window).resize(fixAligment);
        fixAligment();

        // MEGA-A-A-A MENU-U-U-Us
        var t_header_general = $('#t_header_general').length;
        if(t_header_general){
            $('#nav_core').load('#', function() {
                $('#nav_core > ul > li').mouseover(function(){$(this).addClass('active');});
                $('#nav_core > ul > li').mouseout(function(){$(this).removeClass('active');});
            });
        }

        // Shortcuts Menu
        $('header').before('');
        $('#shortcuts').hide();
        $('#shortcuts').load('/ssi/topnav/v4_megamenus.html #shortcuts_loaded', function(){
            $('#nav_shortcuts a').click(function(event){
                $('#shortcuts').toggle('blind');
                event.preventDefault();
            });
        });

     $('.hiddenradios label').click(hiddenradios);
       $('label[for="globalsearch_site"]').trigger('click');

    });
})(jQuery);




function hiddenradios(event){

    var radioid = $(this).attr('for');
    $('#'+radioid).attr('checked', true);
    var radiofieldset = $('#'+radioid).parent('fieldset');
    
        $(radiofieldset).find('input').each(function(){
        var thisid = $(this).attr('id');
        var ischecked = $('#'+thisid).attr('checked');
        if(ischecked){
            $('label[for="'+thisid+'"]').addClass("selected");
        }else{
            $('label[for="'+thisid+'"]').removeClass("selected");
        } //end if
        
       } // end fuction
    ); // end each


} // end hiddenradios

$(document).ready(function() {
// put all your jQuery goodness in here.
$('#cc').html($('Title').html());
});

