$(document).ready(function(){

    // target="_blank" fix
    $('a[href^=http]').click(function() {
        window.open(this.href);
        return false;
    });
    
    // Back to top link
    $('.topOfPage').click(function() {
        $.scrollTo('#header', 600);
        return false;
    });
    
    // footer block
    $(".footerLinks").hide();
    $('.footerLinksContainer a.show').click(function() {
        if ($('.footerLinks').is(':visible')) {
            $('.footerLinks').slideUp();
            $('.footerLinksContainer a.show').text('Show Footer Links');
        } else {
            $('.footerLinks').slideDown();
            $('.footerLinksContainer a.show').text('Hide Footer Links');
        }
        return false;
    });

    Cufon.replace('h1,h2,h3,.supportInfo span,.supportArea span,.hero h3,.#storeSearch h2,.price,#featured span,#retailerFavs li p.title,#customerReviews li strong,#customerReviews p span.interstate,#productDetail #price,#productDetail span,#strapline strong,#strapline span,#productDetailContactTitle,#navBlockTxt p#title, .interstate');
    if (document.all && document.styleSheets && document.styleSheets[0] &&
        document.styleSheets[0].addRule){
        document.styleSheets[0].addRule('img', 'behavior: url(/includes/iepngfix/iepngfix.htc)');
        document.styleSheets[0].addRule('div', 'behavior: url(/includes/iepngfix/iepngfix.htc)');
    }

    // Only show submenu if not IE6
    if (!(jQuery.browser.msie && parseInt(jQuery.browser.version) == 6)) {
    	$('ul.sf-menu').superfish({
    		delay:       1000,                            	// one second delay on mouseout 
    		animation:   {height:'show'},  	// fade-in and slide-down animation   opacity:'show',
    		speed:       'fast',                          	// faster animation speed 
    		autoArrows:  true,                           	// disable generation of arrow mark-up 
    		dropShadows: true                            	// disable drop shadows 
    	});
	}
	
	$(document).pngFix();
});