var MODAL_MIN_FROM_TOP = 35; //the minumum number of pixels to allow between the top of the modal and the top of the viewable window.var CRC_SIDE_NAV = false;$(document).ready(function(){if($.browser.msie&&(parseInt($.browser.version)<7)){$('.dropdownouter').bgiframe();$('#myWishListOpen').bgiframe();$('#myOwnedListOpen').bgiframe();$('#myPreferredOpen').bgiframe();$.preloadCssImages();}$('#menuBottom ul li').hover(function(){$('div.dropdownouter',this).css('display','block');},function(){$('div.dropdownouter',this).css('display','none');});$('#searchArea').hide();$('#searchBtn').click(function(){if($(".largeSearchBtn").attr("src")=="/assets/images/searchBtn_over.gif"){$(".largeSearchBtn").attr("src","/assets/images/searchBtn.gif");$("#searchArea").fadeOut("fast");}else{$("#searchArea").fadeIn("fast");$(".largeSearchBtn").attr("src","/assets/images/searchBtn_over.gif");}});$('#searchClose').click(function(){$(".largeSearchBtn").attr("src","/assets/images/searchBtn.gif");$("#searchArea").fadeOut("fast");return false;});$('input.searchWordsText').focus(function(){var curr=$(this).val();if(curr=='by keyword or prod#'){$(this).val('');}});$('input.searchWordsText').blur(function(){var curr=$(this).val();if(curr==''){$(this).val('by keyword or prod#');}});$('input.regFirst').focus(function(){var curr=$(this).val();if(curr=='first name'){$(this).val('');}});$('input.regFirst').blur(function(){var curr=$(this).val();if(curr==''){$(this).val('first name');}});$('input.regLast').focus(function(){var curr=$(this).val();if(curr=='last name'){$(this).val('');}});$('input.regLast').blur(function(){var curr=$(this).val();if(curr==''){$(this).val('last name');}});$('input.regEml').focus(function(){var curr=$(this).val();if(curr=='email address'){$(this).val('');}});$('input.regEml').blur(function(){var curr=$(this).val();if(curr==''){$(this).val('email address');}});$('input.regZip').focus(function(){var curr=$(this).val();if(curr=='zip code'){$(this).val('');}});$('input.regZip').blur(function(){var curr=$(this).val();if(curr==''){$(this).val('zip code');}});$('.loginEmailInput').focus(function(){if($(this).val()=="email address"){$(this).val('');}});$('.loginEmailInput').blur(function(){if($(this).val()==""){$(this).val('email address');}});$('.loginPasswordText').css('display','block');$('.loginPasswordInput').css('display','none');$('.loginPasswordText').click(function(){$('.loginPasswordText').hide();$('.loginPasswordInput').show();$('.loginPasswordInput').focus();});$('.loginPasswordInput').blur(function(){if($(this).val()==""){$(this).hide();$('.loginPasswordText').show();}});if($('#regUsers ul li#myWishListBtn')){$('#regUsers ul li#myWishListBtn').hover(function(){$('div#myWishListOpen',this).css('display','block');},function(){$('div#myWishListOpen',this).css('display','none');});}if($('#regUsers ul li#myOwnedBtn')){$('#regUsers ul li#myOwnedBtn').hover(function(){$('div#myOwnedListOpen',this).css('display','block');},function(){$('div#myOwnedListOpen',this).css('display','none');});}if($('#regUsers ul li#myPreferredBtn')){$('#regUsers ul li#myPreferredBtn').hover(function(){$('div#myPreferredOpen',this).css('left','-498px');},function(){$('div#myPreferredOpen',this).css('left','-5000px');});}$('ul li.prodFeatureItem').hover(function(){$('div.featureHoverOuter',this).css('display','block');},function(){$('div.featureHoverOuter',this).css('display','none');});$('#searchResultsRefineArea #refineSearchPriceLow').focus(function(){if($(this).val()=="Low price range"){$('#searchResultsRefineArea #refineSearchPriceLow').val('');}});$('#searchResultsRefineArea #refineSearchPriceLow').blur(function(){if($(this).val()==""){$('#searchResultsRefineArea #refineSearchPriceLow').val('Low price range');}});$('#searchResultsRefineArea #refineSearchPriceHigh').focus(function(){if($(this).val()=="High price range"){$('#searchResultsRefineArea #refineSearchPriceHigh').val('');}});$('#searchResultsRefineArea #refineSearchPriceHigh').blur(function(){if($(this).val()==""){$('#searchResultsRefineArea #refineSearchPriceHigh').val('High price range');}});$('#searchResultsRefineArea #refineSearchKeyword').focus(function(){if($(this).val()=="Keyword"){$('#searchResultsRefineArea #refineSearchKeyword').val('');}});$('#searchResultsRefineArea #refineSearchKeyword').blur(function(){if($(this).val()==""){$('#searchResultsRefineArea #refineSearchKeyword').val('Keyword');}});if($.browser.msie&&(parseInt($.browser.version)<7)){$("img.wishListMenuShadeImg").css('display','block');$("img.wishListMenuShadeImg").attr("src","/assets/images/x.gif");}});window.onresize=function(){ 	if($(".ac_results")){ $(".ac_results").css("display", "none"); }  	if(document.getElementById('modalWindow')){if($(window).height()<document.getElementById('modalWindow').clientHeight){document.getElementById('overlayContentDiv').style.height=($(window).height()-50)+"px";document.getElementById('overlayContentDiv').style.overflow="auto";}newPosition=Math.round(($(window).height()-document.getElementById('modalWindow').clientHeight)/2);if($.browser.msie&&(parseInt($.browser.version)<7)){}else{document.getElementById('modalWindow').style.top=newPosition+"px";}}if(document.getElementById('modalWindowSmall')){ if($(window).height()<document.getElementById('modalWindowSmall').clientHeight){document.getElementById('overlayContentDiv').style.height=($(window).height()-50)+"px";document.getElementById('overlayContentDiv').style.overflow="auto";}newPosition=Math.round(($(window).height()-document.getElementById('modalWindowSmall').clientHeight)/2);if (newPosition < MODAL_MIN_FROM_TOP){ newPosition = MODAL_MIN_FROM_TOP; } if($.browser.msie&&(parseInt($.browser.version)<7)){}else{document.getElementById('modalWindowSmall').style.top=newPosition+"px";}}	if(document.getElementById('searchImageModal'))	{		if( typeof(SetModalTop) == 'function' )		{			SetModalTop();		}	}	if(document.getElementById('searchTextModal'))	{		if( typeof(SetModalTop) == 'function' )		{			SetModalTop();		}	}}function openSearchAreaFromLink(){if($(".largeSearchBtn").attr("src")!="/assets/images/searchBtn_over.gif"){$("#searchArea").fadeIn("fast");$(".largeSearchBtn").attr("src","/assets/images/searchBtn_over.gif");$("#searchForm .searchWordsText").focus();}};function show(argElementId){document.getElementById(argElementId).style.display='block';}function hide(argElementId){document.getElementById(argElementId).style.display='none';}function toggle(argElementId){obj=document.getElementById(argElementId);if(obj.style.display=='block'){hide(argElementId);}else{show(argElementId);}}function urlEncode(value)
{
	try
	{
		if (value == "" || value == null) { return value; }
		value = value.replace(/\%/g, "%25")
		.replace("!", "%21")
		.replace(/\s+/g, "%20")
		.replace(/\"/g, "%22")
		.replace(/\#/g, "%23")
		.replace(/\$/g, "%24")
		.replace(/&/g, "%26")
		.replace(/'/g, "%27")
		.replace(/\(/g, "%28")
		.replace(/\)/g, "%29")
		.replace(/\*/g, "%2A")
		.replace(/\+/g, "%2B")
		.replace(/,/g, "%2C")
		.replace(/-/g, "%2D")
		.replace(/\./g, "%2E")
		.replace(/\//g, "%2F")
		.replace(/\?/g, "%3f");
	}
	catch(e){}
	return value;
}
function urlDecode(value)
{
	try
	{
		if (value == "" || value == null) { return value; }
		
		value = value.replace("%21", "!")
		.replace(/\%20/g, " ")
		.replace(/\%22/g, "\"")
		.replace(/\%23/g, "#")
		.replace(/\%24/g, "$")
		.replace(/\%26/g, "&")
		.replace(/\%27/g, "'")
		.replace(/\%28/g, "(")
		.replace(/\%29/g, ")")
		.replace(/\%2A/g, "*")
		.replace(/\%2B/g, "+")
		.replace(/\%2C/g, ",")
		.replace(/\%2D/g, "-")
		.replace(/\%2E/g, ".")
		.replace(/\%2F/g, "/")
		.replace(/\%3f/g, "?")
		.replace(/\%25/g, "%");
	
	}
	catch(e){alert(e);}
	return value;
}




