(function($){
    $(document).ready(function(){
        // page initialization
        $('.basicShopHomePage').each(function(){
            initializeBasicShopHomePage();
        });
        
        initializeTracking(1);
        initializeFooterLinks();
		initializeHeader();
    });
    
    function initializeBasicShopHomePage(){
		$('#newsletterLink').click(function() {
			window.open(this.href, '_blank', 'width=300,height=300');
			return false;
		});
		
		fixProductHeight();
    }
    
    function fixProductHeight() {
		$(window).load(function() {
			$('.productSection').each(function() {
				var maxHeight = 0;
				$('.product', this).each(function() {
					maxHeight = Math.max(maxHeight, $(this).height());
				});
				$('.product', this).each(function() {
					$(this).height(maxHeight);
				});
			});
		});
    }
	
	function initializeHeader() {
		$('.headerSearchTextInput').addClass('disabled');
		$('.headerSearchTextInput').focus(function() {
			$(this).removeClass('disabled');
			this.value = '';
		});
	}
    
    function initializeFooterLinks(){
		$('#contentDisclaimerLink').click(function(){
			launchHelpInShop('/cp/info/help/help_disclaimer.aspx','height=300,width=400,scrollbars=1');
		});
		
		$('#footerHackerSafeLink').click(function(){
			window.open('https://www.scanalert.com/RatingVerify?ref=www.cafepress.com');
		});
		
		$('#footerHackerSafeLink').bind('contextmenu', function(){
			alert('Copying Prohibited  by Law - HACKER SAFE is a Trademark of ScanAlert'); 
			return false;
		});
    }
    
    
	
})(jQuery);

function intlDropdown() {
	var t;
	$("#intlCurrencyBasic").hover(
		function () { t = setTimeout('showIntlDropdown();',400); }, 
		function () { clearTimeout(t); hideIntlDropdown() ;}
	);
}
function showIntlDropdown() {
	$("#intlCurrencyDropdown").fadeIn("fast");
	$(".whiteline").show();
}
function hideIntlDropdown() {
	$("#intlCurrencyDropdown").fadeOut("fast");
	$(".whiteline").hide();
}
$(document).ready(function() { intlDropdown(); });
