$(document).ready(function(){
	
    $('.tb_close').live('click',function(){
        tb_remove();
        return false;
    });
	
    // footer links - new window
    $('#Footer ul li:lt(3) a').attr('title',newWindowText);

    $('#Footer ul li:lt(3) a').click(function(){
        window.open(this.href);
        return false;
    });

    // footer language select - launches custom thickbox
    $('#Footer ul li#LanguageSelect a:first').click(function(){
        tb_show(null, '#TB_inline?height=528&amp;width=240&amp;inlineId=LanguageSelectWrapper',false);
        return false;
    });

    // webtrends tracking for language selections
    $('.languages #Main li a, #Footer ul li#LanguageSelect li a').click(function(){
        dcsMultiTrack('DCS.dcsuri',this.href,'WT.ti',$(this).html());
    });

    $('.close-window a, .cancel-link a').live('click',function(){
        tb_remove();
        return false;
    });

    $.preloadCssImages();

    $('.sign-up').click(function(){
        tb_signup();
        return false;
    })

});

function tb_signup(){
    dcsMultiTrack('DCS.dcsuri','/signup-for-email','WT.ti','Sign%20up%20for%20Email');  // webtrends tracking
    tb_show(null, '/signup-for-email?width=522&amp;height=715',false);
}

// suckerfish for PS3 support on hovers

sfHover = function() {

	if(!document.getElementById("ChooseCountry"))
		return;

	var sfEls = document.getElementById("ChooseCountry").getElementsByTagName("li");

	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

window.onload=sfHover;