/****************************************************************************************
 * Static Variables 
 ***************************************************************************************/
	var objClient = createObjClient();
	var objInlineCart = createObjInlineCart(objClient);
	var rotateSlideShowThread = null;
	var landingPageEffectThread = null;
	var removeDropDownMenuThread = null;
	var ajaxWinParams ="";
	var ajaxWinOPen = "false";
	var ajaxFuncName ="";
	var browserSize = resizingBrowser();
/***************************************************************************************/

/****************************************************************************************
 * Static Initializations 
 ***************************************************************************************/
	var onLoadInitializationsFunction = 
		function() {
			if (objClient.isNav || objClient.isMoz) {
				document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
			}
			objInlineCart.initializeInlineCart();
		};
	addOnLoadEvent(onLoadInitializationsFunction);
/***************************************************************************************/
	
/****************************************************************************************
 * Auxiliary Functions 
 ***************************************************************************************/
	function toProperCase(s) {
  		return s.toLowerCase().replace(/^(.)|\s(.)/g, function($1) { return $1.toUpperCase(); });
	}
	
	function img_over(imgObj){
		var pos = imgObj.src.indexOf("_off.gif");
		if (pos >= 0) {
			imgObj.src = imgObj.src.substring(0, pos) + "_on.gif";
		}
	}

	function img_leave(imgObj){
		var pos = imgObj.src.indexOf("_on.gif");
		if (pos >= 0) {
			imgObj.src = imgObj.src.substring(0, pos) + "_off.gif";
		}
	}
	
	function addOnLoadEvent(functionVar) {

		// Sets the function to be called on page load
		if (window.addEventListener) {
			window.addEventListener('load', functionVar, false);
		} else if (document.addEventListener) {
			document.addEventListener('DOMContentLoaded', functionVar, false);
		} else if (window.attachEvent) {
			window.attachEvent('onload', functionVar);
		}
		
	}
	
	function replaceDivContent(div, content) {
		
		var script; 
		var search = content; 
	      
		while( script = search.match(/(<script[^>]+javascript[^>]+>\s*(<!--)?)/i)) { 
	  
			search = search.substr(search.indexOf(RegExp.$1) + RegExp.$1.length); 
	   
			if (!(endscript = search.match(/((-->)?\s*<\/script>)/))) break; 
	   
			block = search.substr(0, search.indexOf(RegExp.$1)); 
			search = search.substring(block.length + RegExp.$1.length); 
	   	
			var oScript = document.createElement('script'); 
			oScript.text = block; 

			document.getElementsByTagName("head").item(0).appendChild(oScript);
			
		}
		
		document.getElementById(div).innerHTML = content;
		
	}
	
	function addPartnerTags(addGoogleAnalyticsTags, addFetchbackTags, addLiveChatTags, googleAnalyticsPageURL, addRocketFuelTags, rocketFuelCode) {
    	var partnersTagsForm = document.getElementById('partnersTagsForm');
    	partnersTagsForm.addGoogleAnalyticsTags.value = addGoogleAnalyticsTags;
    	partnersTagsForm.addFetchbackTags.value = addFetchbackTags;
    	partnersTagsForm.addLiveChatTags.value = addLiveChatTags;
    	partnersTagsForm.addSilverPopPageTrackingTag.value = false;
    	partnersTagsForm.addKissMetricsTag.value = false;
    	partnersTagsForm.googleAnalyticsPageURL.value = googleAnalyticsPageURL;
    	partnersTagsForm.silverpopPageName.value = '';
    	partnersTagsForm.addRocketFuelTags.value = addRocketFuelTags;
    	partnersTagsForm.rocketFuelCode.value = rocketFuelCode;
		var xhrArgs = {
			form: partnersTagsForm,
            handleAs: "text",
            preventCache: true,
            load: function(data) {
				replaceDivContent("partnersTagsInfo", data);
				/*
				if (addKissMetricsTag) {
					kissMetricsEventTrackFunction();
				}
				*/
            },
            error: function(response, ioArgs) {
            	//alert(response);
            } 
        };
		dojo.xhrGet(xhrArgs);
	}

	function returnObjPosition(target){
		var x = 0;
		var y = 0;
		var tempObj = new Object();
		var obj = (typeof target == "object" ? target : document.getElementById(target));
		while (obj.offsetParent != null) {
			x += obj.offsetLeft;
			y += obj.offsetTop;
			obj = obj.offsetParent;
		}
		x += obj.offsetLeft;
		y += obj.offsetTop;
		tempObj.x = x;
		tempObj.y = y;
		return tempObj;
	}

	function setObjPosition(objLayer,intX,intY) {
		strX = String(intX);
		strY = String(intY);
		objLayer.style.top = intY + (strY.indexOf("px") == -1 ? "px" : "");
		objLayer.style.left = intX + (strX.indexOf("px") == -1 ? "px" : "");
	}

	function openNewMsg(windowUrl, ww, wh){
		var properties = "titlebar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+ww+",height="+wh;
		window.open(windowUrl, "Informational",properties);
	}
	
	function autotab(original,destination){
		if (original.getAttribute&&original.value.length==original.getAttribute("maxlength")) {
			destination.focus();
		}
	}
	
	function getHTTPRequest() {
		var responseType = 'text/xml';
		var req;
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			if (req.overrideMimeType) {
				req.overrideMimeType(responseType);
			}
		} else if (window.ActiveXObject) { // IE
	  		var reqDeclared = false;
	  		var XmlHttpVersions = new Array("MSXML2.XMLHTTP.7.0",
	  										"MSXML2.XMLHTTP.6.0",
	  										"MSXML2.XMLHTTP.5.0",
	  										"MSXML2.XMLHTTP.4.0",
	  										"MSXML2.XMLHTTP.3.0",
	  										"MSXML2.XMLHTTP",
	  										"Microsoft.XMLHTTP");
	  		for (var i=0; i<XmlHttpVersions.length && !reqDeclared; i++) {
	  			try { 
	  				req = new ActiveXObject(XmlHttpVersions[i]);
	  				reqDeclared = true;
	  			} catch (e) {
	  			} // ignore potential error
	  		}
	  	}
	  	return req;
	}

	function retreiveWindowWidth() {
		var myWidth = 0;
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth - 16;
		} else if( document.documentElement && document.documentElement.clientWidth ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
		} else if( document.body && document.body.clientWidth ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
		}
		return myWidth;
	}

	function retreiveWindowHeight() {
		var myHeight = 0;
		if( typeof( window.scrollHeight ) == 'number' ) {
			//Non-IE
			myHeight = window.scrollHeight;
		} else if( document.body && document.body.scrollHeight ) {
			//IE 4 compatible
			myHeight = document.body.scrollHeight;
		} else if( document.documentElement && document.documentElement.scrollHeight ) {
			//IE 6+ in 'standards compliant mode'
			myHeight = document.documentElement.scrollHeight;
		}
		return myHeight;
	}

	function retreiveWindowVisibleHeight() {
		var myHeight = 0;
		if( typeof( window.innerHeight ) == 'number' ) {
			//Non-IE
			myHeight = window.innerHeight;
		} else if( document.body && document.body.innerHeight ) {
			//IE 4 compatible
			myHeight = document.body.innerHeight;
		} else if( document.documentElement && document.documentElement.innerHeight ) {
			//IE 6+ in 'standards compliant mode'
			myHeight = document.documentElement.innerHeight;
		} else {
			myHeight = 800;
		}
		return myHeight;
	}
		  
	function retreiveWindowYOffSet() {
		var myHeight = 0;
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Non-IE
			myHeight = window.pageYOffset;
		} else if( document.documentElement && document.documentElement.scrollTop ) {
			//IE 6+ in 'standards compliant mode'
			myHeight = document.documentElement.scrollTop;
		} else if( document.body && document.body.scrollTop ) {
			//IE 4 compatible
			myHeight = document.body.scrollTop;
		}
		return myHeight;
	}
		  
	function showErrorMessage(msgDivId, msgDivWidth, msgDivHeight) {
		var divBlackBackGroundDiv = document.getElementById('divBlackBackGround')
		divBlackBackGroundDiv.style.left = '0px';
		divBlackBackGroundDiv.style.top = '0px';
		divBlackBackGroundDiv.style.width = retreiveWindowWidth() + 'px';
		divBlackBackGroundDiv.style.height = retreiveWindowHeight() + 'px';
		divBlackBackGroundDiv.style.zIndex = 99;
		divBlackBackGroundDiv.style.display = "block";
			
		var msgDiv = document.getElementById(msgDivId); 
		msgDiv.style.left = ((retreiveWindowWidth()-msgDivWidth)/2) + 'px';
		msgDiv.style.top = (retreiveWindowYOffSet() + ((retreiveWindowVisibleHeight()-msgDivHeight)/2)) + 'px';
		msgDiv.style.zIndex = 100;
		msgDiv.style.display = "block";
	}	
		  
	function hideErrorMessage(msgDivId) {
		var msgDiv = document.getElementById(msgDivId); 
		msgDiv.style.display = "none";
		var divBlackBackGroundDiv = document.getElementById('divBlackBackGround')
		divBlackBackGroundDiv.style.display = "none";
	}

	function createBookmark(title, url) {
		try {
			if (window.sidebar) { // Mozilla Firefox Bookmark 
				window.sidebar.addPanel(title, url, '');
			} else if( window.external ) { // IE Favorite
				window.external.AddFavorite(url, title); 
			} else {
				alert('Sorry! This feature is not available for this browser.');
			}
		} catch (e) {
			alert('Sorry! This feature is not available for this browser.');
		}
	}
	
	function trackSocialEvent(socialNetwork) {
		try {
			var _gatc = _gat._createTracker('UA-1685968-1');
			_gatc._setAllowLinker(true);
			_gatc._setDomainName('none');
			_gatc._trackSocial(socialNetwork, 'Share(M)');
			/*
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-1685968-1']);
			_gaq.push(['_setAllowLinker', true]);
			_gaq.push(['_setDomainName', 'none']);
			_gaq.push(['_trackSocial', socialNetwork, 'Share(M)']);
			(function() {
				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();
			*/
		} catch (e) {
			//alert(e.message);
		}
	}
	
	function addToFacebook(title, url) {
		trackSocialEvent('Facebook');
		document.shareProduct.spCommunity.value = 'facebook';
	 	document.shareProduct.spRedirect.value = 'http://www.facebook.com/sharer.php?t='+title+'&u='+url;
	 	document.shareProduct.submit();
	 }

	 function addToTwitter(title, url) {
		trackSocialEvent('Twitter');
	 	document.shareProduct.spCommunity.value = 'twitter';
	 	//document.shareProduct.spRedirect.value = 'http://twitter.com/home?status=Checking+this+'+title+'+at+' + encodeURIComponent('http://www.jamesperse.com?utm_source=sbm&utm_medium=share_link&utm_campaign=twitter');
	 	document.shareProduct.spRedirect.value = 'http://twitter.com/intent/tweet?source=webclient&text=Checking+this+' +title + '+at+' + url;
	 	document.shareProduct.submit();
	 }

	 function addToMySpace(title, url) {
		trackSocialEvent('MySpace');
	 	document.shareProduct.spCommunity.value = 'myspace';
	 	document.shareProduct.spRedirect.value = 'http://www.myspace.com/Modules/PostTo/Pages/?u='+url+'&t='+title+'&c=';
	 	document.shareProduct.submit();
	 }

	 function addToFriendFeed(title, url) {
		trackSocialEvent('FriendFeed');
	 	document.shareProduct.spCommunity.value = 'friendfeed';
	 	document.shareProduct.spRedirect.value = 'http://friendfeed.com?url='+url+'&title='+title;
	 	document.shareProduct.submit();
	 }

	 function addToGoogle(title, url) {
		trackSocialEvent('GoogleBookmarks');
	 	document.shareProduct.spCommunity.value = 'google';
	 	document.shareProduct.spRedirect.value = 'http://www.google.com/bookmarks/mark?op=add&bkmk='+url+'&title='+title;
	 	document.shareProduct.submit();
	 }

	 function addToStumbleUpon(title, url) {
		trackSocialEvent('StumbleUpon');
	 	document.shareProduct.spCommunity.value = 'stumbleupon';
	 	document.shareProduct.spRedirect.value = 'http://www.stumbleupon.com/submit?url='+url+'&title='+title;
	 	document.shareProduct.submit();
	 }

	 function addToStyleHive(title, url) {
		trackSocialEvent('StyleHive');
		document.shareProduct.spCommunity.value = 'stylehive';
		document.shareProduct.spRedirect.value = 'http://my.stylehive.com/authenticated/bookmark/add.htm?bookmark.url='+url+'&bookmark.title='+title+"&refererUrl="+encodeURIComponent('http://www.stylehive.com/site/jamesperse.com/new/grid/0');
		document.shareProduct.submit();
	 }

	 function addToKaboodle(title, url) {
		trackSocialEvent('Kaboodle');
		 javascript:(function(){var s=document.createElement('script');s.type='text/javascript';s.src='http://www.kaboodle.com/zg/addbutton.js?v=0.1';document.getElementsByTagName('head')[0].appendChild(s);})();
	 }
	 
	 function addToThisNext(title, url, imgUrl) {
		 trackSocialEvent('ThisNext');
		 document.shareProduct.spCommunity.value = 'thisnext';
		 document.shareProduct.spRedirect.value = 'http://www.thisnext.com/pick/new/submit/button/?url='+url+'&name='+title+'&via_url='+encodeURIComponent('http://www.jamesperse.com')+'&image_url='+imgUrl+'&via_name=James Perse';
		 document.shareProduct.submit();
	 }
	 
	 function addToStyleFeeder(title, url, imgUrl) {
		trackSocialEvent('StyleFeeder');
	 	document.shareProduct.spCommunity.value = 'stylefeeder';
		document.shareProduct.spRedirect.value = 'http://www.stylefeeder.com/bookmarklet/index.html?url='+url+'&description='+title+'&thumbnailUrl='+imgUrl;
		document.shareProduct.submit();
	}
	 
	 function addToDelicious(title, url) {
		trackSocialEvent('Delicious');
	 	document.shareProduct.spCommunity.value = 'delicious';
	 	document.shareProduct.spRedirect.value = 'http://delicious.com/save?v=5&noui&jump=close&url='+url+'&title='+title;
	 	document.shareProduct.submit();
	 }

    function efm(reqData){
    	var efHolder = document.getElementById('emFriend') ? document.getElementById('emFriend') : document.createElement('div');
		efHolder.id = 'emFriend';
        getAjaxPopupDivStyle('emf', reqData);
        var sendmailObj = document.forms.sendmail;
        sendmailObj.pageUrl.value = "this page url here";
    }
    
    function sbe(reqData){
		var subeHolder = document.getElementById('emSubscribtion') ? document.getElementById('emSubscribtion') : document.createElement('div')
		subeHolder.id = 'emSubscribtion'
        getAjaxPopupDivStyle('esrb', reqData)
	}
    
    function pwdmy(reqData){
		var subeHolder = document.getElementById('forgotPassword') ? document.getElementById('forgotPassword') : document.createElement('div')
		subeHolder.id = 'forgotPassword'
        getAjaxPopupDivStyle('pwd', reqData)
	}
    
    function prev(reqData){
		var eafHolder = document.getElementById('prodPrev') ? document.getElementById('prodPrev') : document.createElement('div')
		eafHolder.id = 'prodPrev'
        getAjaxPopupDivStyle('prev', reqData)

	}
    
    function ajaxCallMakeRequest(url, params, cb, m, rt, as){
	    
        var urlString = url;
        var parameters = params;
        var callback = cb;
        var method = m?m: 'get';
        var async = as ? as : true;
        var response = null;
        
        if (parameters){
        	urlString += '?'
            for(p in parameters) {
            	urlString += p + '=' + parameters[p] + '&';
            }
        }
        
		var xhrArgs = {
				url: urlString,
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					callback(data);
	            } 
	        };
		dojo.xhrGet(xhrArgs);
        
    }

    function getIEVersion(){
        var rv = -1; // Return value assumes failure
        if (navigator.appName == 'Microsoft Internet Explorer') {
        	var ua = navigator.userAgent;
        	var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        	if (re.exec(ua) != null) {
        		rv = parseFloat( RegExp.$1 );
        	}
        }
        return rv;
    }
    
	function resizingBrowser(){
		// Comments added by Marcelo Vaz on 08/29/2008
		// This method is not supported by IE 7
		// To make it compatible, we must have DOCTYPE declaration on each
		// page, but the way was implemented, it is not reasonable to change
		// all pages now.
		// On IE7, returned value will always be -1
		var viewportwidth;
		try {
			viewportwidth = retreiveWindowWidth();
		} catch (err) {
			viewportwidth = -1;
		}
		return viewportwidth;
	}
	
	function getStyleObject(objectId) {
		if(document.getElementById && document.getElementById(objectId)) {
			return document.getElementById(objectId).style;
        } else if (document.all && document.all(objectId)) {
        	return document.all(objectId).style;
        } else if (document.layers && document.layers[objectId]) {
        	return document.layers[objectId];
        } else {
        	return false;
        }
    }
	
    function changeObjectProperty(objectId, cssProperty, newValue) {
        var styleObject = getStyleObject(objectId);
        if (styleObject) {
        	eval("styleObject." + cssProperty + " = newValue");
        	return true;
        } else {
        	return false;
        }
    }
    
    function pagePrintFXFn(elid) {
        var opacs = ["1","1"];
        var opacs2 = ["0",".2",".5","1"];
        if (document.getElementById(elid).style.display == 'none'){
            if(elid == 'disableObjcts'){
                document.getElementById(elid).style.opacity = '0';
                document.getElementById(elid).style.filter = 'alpha(opacity=0)';
                document.getElementById(elid).style.display = 'block';
                document.getElementById(elid).style.background = '#000000';
                for (var i = 0; i <4; i++){
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 30);
                }
            } else {
                document.getElementById(elid).style.opacity = '0';
                document.getElementById(elid).style.filter = 'alpha(opacity=0)';
                document.getElementById(elid).style.display = 'block';
                for (var i = 0; i < 2; i++){
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 30);
                }
            }
        }else{
            if(elid == 'disableObjcts'){
                opacs2.reverse();
                for (var i = 0; i < 4; i++) {
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 30);
                }
                setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i *30);
            } else{
                opacs.reverse();
                for (var i = 0; i < 2; i++) {
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 30);
                }
                setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i * 30);
            }
        }
    }
    
    function pageFXFn(elid) {
        var opacs = [".8","1"];
        var opacs2 = ["0",".2",".5",".8"];
        if (document.getElementById(elid).style.display == 'none'){
            if(elid == 'disableObjcts'){
                document.getElementById(elid).style.opacity = '0';
                document.getElementById(elid).style.filter = 'alpha(opacity=0)';
                document.getElementById(elid).style.display = 'block';
                document.getElementById(elid).style.background = '#000000';
                for (var i = 0; i <4; i++){
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 30);
                }
            } else {
                document.getElementById(elid).style.opacity = '0';
                document.getElementById(elid).style.filter = 'alpha(opacity=0)';
                document.getElementById(elid).style.display = 'block';
                for (var i = 0; i < 2; i++){
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 30);
                }
            }
        } else {
            if (elid == 'disableObjcts'){
                opacs2.reverse();
                for (var i = 0; i < 4; i++) {
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs2[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs2[i] * 100)+')";', i * 30);
                }
                setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i *30);
            } else{
                opacs.reverse();
                for (var i = 0; i < 2; i++) {
                    setTimeout('document.getElementById(\''+elid+'\').style.opacity = "'+opacs[i]+'";', i * 30);
                    setTimeout('document.getElementById(\''+elid+'\').style.filter = "alpha(opacity='+(opacs[i] * 100)+')";', i * 30);
                }
                setTimeout('document.getElementById(\''+elid+'\').style.display = "none";', i * 30);
            }
        }
	}	
    function fadePopup(param, whichObj){
        var floatThisDiv = false;
        if (document.getElementById(param).style.display == 'none') {
            var nTop = ((retreiveWindowYOffSet() + ((retreiveWindowHeight()-300)/2))) + 'px';
            var offset = (whichObj == 'prev' ? 320 : (whichObj == 'ptp' ? 0 : 480));
            var nLeft = '0px';
            var nLeft2 = offset + 'px';
            var nHeight = retreiveWindowHeight() + 'px';
            var nWidth = retreiveWindowWidth() + 'px';
            var divObj = document.getElementById(param);
            var wrapObj = document.getElementById('wrapObj');
            changeObjectProperty('disableObjcts', 'left', nLeft);
            changeObjectProperty('disableObjcts', 'height', nHeight);
            changeObjectProperty('disableObjcts', 'width', nWidth);
            if (whichObj=='ptp') {
				changeObjectProperty(param, 'left', nLeft);
			} else {
				changeObjectProperty(param, 'left', nLeft2);
			}
            changeObjectProperty(param, 'top', nTop);
            floatThisDiv = true;
        }
		if (whichObj=='ptp') {
			pagePrintFXFn('disableObjcts');
        	pagePrintFXFn(param);
		} else {
        	pageFXFn('disableObjcts');
        	pageFXFn(param);
		}
        if (floatThisDiv){
        	if(whichObj == "ptp"){
        		ajaxPopuPrintPage(param);
           } else {
		   		ajaxPopupFX(param);
		   }
        }
    }
    
	function ajaxPopupFX(param){
        var d = document;
		var brwsrTop = 100;
        function ml(id) {
            var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
            if(d.layers)el.style=el;
            el.sP=function(x,y){
                this.style.top=y + "px";
            };
            el.y = brwsrTop;
            return el;
        }
        window.stayTopLeft=function() {
           var pY = d.body.scrollTop;
		   ftlObj.y += (pY + brwsrTop - ftlObj.y)/8;
           ftlObj.sP(ftlObj.x, ftlObj.y);
		   var rs = chekResize();
		   	if(rs== true){
		  		setTimeout("fixResizeWindow()", 20);
		  	} else {
		  		setTimeout("stayTopLeft()", 10);
		  	}
        }
        ftlObj = ml(param);
        stayTopLeft();
    }
	
	function getQueryString(strQuery) {
		var strQueryFields = strQuery.split(/&/);
		var info = {};
		for(var i = 0; i < strQueryFields.length; i++) {
			var fieldInfo = strQueryFields[i].split(/=/, 2);
		    info[fieldInfo[0]] = fieldInfo[1];
		  }
		return info;
	}
    
    function closeAjaxPopup(param){
        fadePopup('ajaxPopUp',param)
		ajaxWinOPen = "false";
        setTimeout("document.getElementsByTagName('body')[0].removeChild(document.getElementById('ajaxPopUp'))", 100);
        if(rmvDiv.length > 0){
            for(i = 0; i < rmvDiv.length; i++)rmvDiv[i].parent.appendChild(rmvDiv[i].child);
        }
    }
	
    function preview(productId, skuId, categoryId, itemsPerPage, isViewAll, startItem, selectedColor, onlyOnSalePrice, urlTokensContext){
    	var onlyOnSalePriceBln = (onlyOnSalePrice == 'true');
    	var onlyOnRegularPriceBln = (!onlyOnSalePriceBln);
		ajaxWinParams ="productId="+productId+"&skuId="+skuId+"&categoryId="+categoryId+"&itemsPerPage="+itemsPerPage+"&isViewAll="+isViewAll+"&startItem="+startItem+"&selectedColor="+selectedColor+"&onlyOnRegularPrice="+onlyOnRegularPriceBln+"&onlyOnSalePrice="+onlyOnSalePriceBln+"&urlTokensContext="+urlTokensContext;
    	ajaxFuncName ="preview";
		ajaxWinOPen = "true";		
    	var name = "Product Preview";
    	var params = null;
		var qryStr = "&skuId=" + skuId + "&selectedColor=" + selectedColor + "&categoryId=" + categoryId + "&selectedHowMany=" + itemsPerPage + "&viewAll=" + isViewAll + "&start=" + startItem+"&onlyOnRegularPrice="+onlyOnRegularPriceBln+"&onlyOnSalePrice="+onlyOnSalePriceBln+"&urlTokensContext="+urlTokensContext;
		ajaxCallMakeRequest('/browse/product/preview/product.jsp?productId='+productId+qryStr, params, prev, null, 'text/plain', null);
    }
    
	function editCart(productId,selectedColor,savedquantity,page,editItem,selectedSize){
		ajaxWinParams ="productId="+productId+"&selectedColor="+selectedColor+"&savedquantity="+savedquantity+"&page="+page+"&editItem="+editItem+"&selectedSize="+selectedSize+"&onlyOnRegularPrice=false&onlyOnSalePrice=false";
    	ajaxFuncName ="editCart";
		ajaxWinOPen = "true";		
    	var name = "Product Preview";
		var params = null;
		ajaxCallMakeRequest('/browse/product/editCart/product.jsp?productId='+productId+'&selectedColor='+selectedColor+'&savedquantity='+savedquantity+'&page='+page+'&editItem='+editItem+'&selectedSize='+selectedSize+"&onlyOnRegularPrice=false&onlyOnSalePrice=false",  params, prev, null, 'text/plain', null)
	}
	
    function subscribeEmail(){
		ajaxWinParams ="";
    	ajaxFuncName ="subscribeEmail";
		ajaxWinOPen = "true";
        var name = "Subscribe";
		var params = null;
		ajaxCallMakeRequest('/contacts/subscribe.jsp', params, sbe, null, 'text/plain', null);
    }
    
    function addItemToWishList(productId,skuId,qty){
		ajaxWinParams ="";
    	ajaxFuncName ="addItemToWishList";
		ajaxWinOPen = "true";
        var name = "addItemToWishList";
		var params = null;
		var qryStr="?productId="+productId+"&skuId="+skuId+"&quantity="+qty;
		ajaxCallMakeRequest('/browse/product/add_to_wish_list.jsp'+qryStr, params, sbe, null, 'text/plain', null);
    }

    function addCartItemToWishList(id){
		ajaxWinParams ="";
    	ajaxFuncName ="addCartItemToWishList";
		ajaxWinOPen = "true";
        var name = "addCartItemToWishList";
		var params = null;
		var qryStr="?itemId="+id;
		ajaxCallMakeRequest('/checkout/add_cartitem_to_list.jsp'+qryStr, params, sbe, null, 'text/plain', null);
    }

    function addOnSaleCartItemToWishList(){
		ajaxWinParams ="";
    	ajaxFuncName ="addOnSaleCartItemToWishList";
		ajaxWinOPen = "true";
        var name = "addOnSaleCartItemToWishList";
		var params = null;
		var qryStr="";
		ajaxCallMakeRequest('/checkout/add_onsale_cartitem_to_list.jsp'+qryStr, params, sbe, null, 'text/plain', null);
    }

    function addWishListItemToCart(){
		ajaxWinParams ="";
    	ajaxFuncName ="addWishListItemToCart";
		ajaxWinOPen = "true";
        var name = "addWishListItemToCart";
		var params = null;	
		ajaxCallMakeRequest('/account/add_item_to_bag.jsp', params, sbe, null, 'text/plain', null);
    }
    
    function addAllWishListItemsToCart(){    
		ajaxWinParams ="";
    	ajaxFuncName ="addAllWishListItemsToCart";
		ajaxWinOPen = "true";
        var name = "addAllWishListItemsToCart";
		var params = null;
		ajaxCallMakeRequest('/account/add_all_items_to_bag.jsp', params, sbe, null, 'text/plain', null);
    }
    
	function emailWishList(){
	    var ajaxFuncName = "emailWishList";
	    var name = "Email a Wishlist ";
		var params = null;
		ajaxWinOPen = "true";
		ajaxCallMakeRequest('/contacts/emailwishlist.jsp', params, efm, null, 'text/plain', null);
    }
	
	function editWishList(productId,selectedColor,savedquantity,page,editItem,selectedSize){
		ajaxWinParams ="productId="+productId+"&selectedColor="+selectedColor+"&savedquantity="+savedquantity+"&page="+page+"&editItem="+editItem+"&selectedSize="+selectedSize+"&onlyOnRegularPrice=true&onlyOnSalePrice=false";
    	ajaxFuncName ="editCart";
		ajaxWinOPen = "true";		
    	var name = "Product Preview";
		var params = null;
		ajaxCallMakeRequest('/browse/product/editWishList/product.jsp?productId='+productId+'&selectedColor='+selectedColor+'&savedquantity='+savedquantity+'&page='+page+'&editItem='+editItem+'&selectedSize='+selectedSize+"&onlyOnRegularPrice=true&onlyOnSalePrice=false",  params, prev, null, 'text/plain', null);
    }
    
	function printView(productId, selectedColor){
		ajaxWinParams ="productId="+productId+"&selectedColor="+selectedColor;
    	ajaxFuncName ="printView";
		ajaxWinOPen = "true";
	    var name = "Print Page";
	    var params = null
	    var eaf = new ajaxCall('/browse/product/print/print_productdetails.jsp?productId='+productId+'&selectedColor='+selectedColor, params, printpage, null, 'text/plain', null)
	    eaf.makeRequest();
	}
	
	function printViewBag(){
		ajaxWinParams ="";
    	ajaxFuncName ="printViewBag";
		ajaxWinOPen = "true";
	    var name = "Print Page";
		var params = null
		var eaf = new ajaxCall('/checkout/printbag.jsp', params, printpagebag, null, 'text/plain', null)
		eaf.makeRequest();
	}

	function forgotMyPassword(){
		ajaxWinParams ="";
    	ajaxFuncName ="forgotMyPassword";
		ajaxWinOPen = "true";
        var name = "Forgot Password";
		var params = null;
		ajaxCallMakeRequest('/account/forgotpassword.jsp', params, pwdmy, null, 'text/plain', null);
    }

	function fixResizeWindow(){
		if(ajaxWinOPen=="true"){
			if(ajaxFuncName=="preview"){
				var productId = "";
				var categoryId ="";
				var itemsPerPage ="";
				var isViewAll ="";
				var startItem="";
				var selectedColor="";
				var onlyOnSalePrice="";
				var urlTokensContext="";
				var obj = getQueryString(ajaxWinParams);
				for(var i in obj) {
			  		if(i=="productId"){productId=obj[i];}
			    	if(i=="categoryId"){categoryId =obj[i];}
					if(i=="itemsPerPage"){itemsPerPage=obj[i];}
					if(i=="isViewAll"){isViewAll=obj[i];}
					if(i=="startItem"){startItem=obj[i];}
					if(i=="selectedColor"){selectedColor=obj[i]; }
					if(i=="onlyOnSalePrice"){onlyOnSalePrice=obj[i]; }
					if(i=="urlTokensContext"){urlTokensContext=obj[i]; }
			  	}
				closeAjaxPopup('prev');
				setTimeout( "preview('"+productId+"', '"+categoryId+"', '"+itemsPerPage+"', '"+isViewAll+"', '"+startItem+"', '"+selectedColor+"', '" + onlyOnSalePrice + "', '" + urlTokensContext + "')", 200);
			}
			if(ajaxFuncName=="editCart"){
				var productId="";
				var selectedColor="";
				var savedquantity="";
				var page="";
				var editItem="";
				var selectedSize="";
				var obj = getQueryString(ajaxWinParams);
				for(var i in obj) {
					if(i=="productId"){productId=obj[i];}
					if(i=="selectedColor"){selectedColor=obj[i];}
					if(i=="savedquantity"){savedquantity=obj[i];}
					if(i=="page"){page=obj[i];}
					if(i=="editItem"){editItem=obj[i];}
					if(i=="selectedSize"){selectedSize=obj[i];}
				}
				closeAjaxPopup('prev');
				setTimeout( "editCart('"+productId+"','"+selectedColor+"','"+savedquantity+"','"+page+"','"+editItem+"','"+selectedSize+"')", 200);
			}
			if(ajaxFuncName=="subscribeEmail"){
				closeAjaxPopup('esrb');
				setTimeout( "subscribeEmail()", 200);
			}
			if(ajaxFuncName=="addItemToWishList"){
				closeAjaxPopup('esrb');
				setTimeout( "addItemToWishList()", 200); 
			}
			if(ajaxFuncName=="addCartItemToWishList"){
				closeAjaxPopup('esrb');
				setTimeout( "addCartItemToWishList()", 200);
			}
			if(ajaxFuncName=="addOnSaleCartItemToWishList"){
				closeAjaxPopup('esrb');
				setTimeout( "addOnSaleCartItemToWishList()", 200);
			}
			if(ajaxFuncName=="addWishListItemToCart"){
				closeAjaxPopup('esrb');
				setTimeout( "addWishListItemToCart()", 200);
			}
			if(ajaxFuncName=="addAllWishListItemsToCart"){
				closeAjaxPopup('esrb');
				setTimeout( "addAllWishListItemsToCart()", 200);
			}
			if(ajaxFuncName=="emailWishList"){
				closeAjaxPopup('esrb');
				setTimeout( "emailWishList()", 200);
			}
			if(ajaxFuncName=="emailFriend"){
				closeAjaxPopup('emf');
				var productId="";
				var skuId="";
				var obj = getQueryString(ajaxWinParams);
				for(var i in obj) {
					if(i=="productId"){productId=obj[i];}
					if(i=="skuId"){skuId=obj[i];}
			       }				
				setTimeout( "emailFriend('"+productId+"', '"+skuId+"')", 200);
			}
			if(ajaxFuncName=="printView"){
				var productId ="";
				var selectedColor="";
				var obj = getQueryString(ajaxWinParams);
				for(var i in obj) {
					if(i=="productId"){productId=obj[i];}
					if(i=="selectedColor"){selectedColor=obj[i];}
				}
				closeAjaxPopup('ptp');
				setTimeout( "printView('"+productId+"', '"+selectedColor+"')", 200);
			}
			if(ajaxFuncName=="printViewBag"){
				closeAjaxPopup('ptp');
				setTimeout( "printViewBag()", 200);
			}
			if(ajaxFuncName=="forgotMyPassword"){
				closeAjaxPopup('pwd');
				setTimeout( "forgotMyPassword()", 200);
			}
		}
		
	}
	
    function ajaxPopuPrintPage(param){
        var startX = document.getElementById('wrapObj').offsetLeft;
		var ns = (navigator.appName.indexOf("Netscape") != -1);
        var d = document;
        function ml(id) {
            var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
            if(d.layers)el.style=el;
            el.sP=function(x,y){
                this.style.top=y + "px";;
            };
            el.x = document.getElementById('wrapObj').offsetLeft;
            if(OSName="Windows"){
				el.y = 50;
			} else {
				el.y = 50;
			}
            return el;
        }
        window.stayTopLeft=function() {
		   var rs = chekResize();
           if(rs== true){
        	   setTimeout("fixResizeWindow()", 10);
		   } else {
			   setTimeout("stayTopLeft()", 10);
		   }
		}
        ftlObj = ml(param);
        stayTopLeft();
    }
    
	function chekResize(){
		var flag = false;
		var newWindowSize = resizingBrowser();
		if (browserSize != newWindowSize){
			browserSize = newWindowSize;
			flag = true;
		}
		return flag;
	}
    
    function getAjaxPopupDivStyle(l, content){
        if (!content) return;
        var ajaxPopUp = document.createElement('div');
        var printPageHight = document.getElementById('ptp');
        ajaxPopUp.id = 'ajaxPopUp';
        ajaxPopUp.style.display = 'none';
        if(getIEVersion() > -1){
            ajaxPopUp.style.height = l == 'prev' ? '360px' : l == 'emf'? '350px' : l == 'esrb' ? '358px' : l == 'ptp' ? (printPageHight.offsetHeight + 400) +'px' : l == 'pwd'? '350px':'0px';
            ajaxPopUp.style.width =  l == 'prev' ? '630px' : l == 'emf'? '330px' : l == 'esrb' ? '330px' : l == 'ptp' ? '650px' : l == 'pwd'? '330px':'0px';         
        }
        ajaxPopUp.innerHTML = content;
        document.getElementsByTagName('body')[0].appendChild(ajaxPopUp);
        var disableObjcts = document.getElementById('disableObjcts') ? document.getElementById('disableObjcts') : null;
        if (!disableObjcts){
            disableObjcts = document.createElement('div');
            disableObjcts.id = 'disableObjcts';
            disableObjcts.style.display = 'none';
            document.getElementsByTagName('body')[0].appendChild(disableObjcts);
        }
        var isMac = navigator.userAgent.toLowerCase().indexOf('mac') > -1 ? true : false;
        var objectEmbed = (document.getElementsByTagName('object').length > 0 || document.getElementsByTagName('embed').length > 0) ? true : false;
        if (isMac && objectEmbed){
            var oes = document.getElementsByTagName('object');
            for(i = 0; i < oes.length; i++){
                rmvDiv[i] = {'parent' : oes[i].parentNode, 'child' : oes[i]};
                oes[i].parentNode.removeChild(oes[i]);
            }
        }
        browserSize = resizingBrowser();
        fadePopup('ajaxPopUp', l);
    }
    
    function ajaxSubmitForm(formId, divId) {
		var xhrArgs = {
				form: document.getElementById(formId),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					replaceDivContent(divId, data);
	            }
	        };
		dojo.xhrGet(xhrArgs);
    }

    function ajaxReloadPopup(pageUrl, divId) {
		var xhrArgs = {
				url: pageUrl,
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					replaceDivContent(divId, data);
	            }
	        };
		dojo.xhrGet(xhrArgs);
    }
    
    //called when a user clicks on a color
    function clickColor(color,productId){
  		var form = document.getElementById("colorsizerefreshform");
  		var currentColor = form.elements["selectedColor"].value;
  		//if the color is not changing, dont do anything
  		if(currentColor == color) {
  			return; 
  		}
  		//set the new selected color in the refresh form and submit it
  		form.elements["selectedColor"].value = color;
  		form.elements["productId"].value = productId;
  		setQuantity();
  		setGiftlistId();
  		setQuantityOnGiftlistForm();
  		submitRefreshForm();
    }
    

    //called when a user clicks on a size
    function clickSize(size){
    	var form = document.getElementById("colorsizerefreshform");
  		//if the user clicks the size that's already selected, don't do anything
  		var currentSize = form.elements["selectedSize"].value;		
  		if(currentSize == size) {
  			return;
  		}
  		//set the new selected size in the refresh form and submit it
  		form.elements["selectedSize"].value = size;
  		setQuantity();
  		setQuantityOnGiftlistForm();
  		setGiftlistId();
  		submitRefreshForm();	
  		  
    }

    function selectQty(qty) {
    	var addtocartform = document.getElementById("addToCart"); 
    	addtocartform.quantity.value=addtocartform.quantitySelect.value;  	
    	setQuantity();
    	var addtowishlistform = document.getElementById("wishListform"); 
    	if(addtowishlistform == null) return;
    	addtowishlistform.quantity.value=addtocartform.quantitySelect.value;  	
    	setQuantityOnGiftlistForm();
    }
    
    function setQuantity() {
  		var addtocartform = document.getElementById("addToCart");
   		var currentQuantity = addtocartform.elements["quantity"].value;
  		var refreshform = document.getElementById("colorsizerefreshform");
   		refreshform.elements["savedquantity"].value = currentQuantity;
    }
    
    //gets the quantity from the addToGiftList form and sets the refreshform savedgiftlist 
    //we do this so we can preserve the giftlist selection between refreshes
    function setGiftlistId() {
  		var addtogiftlistform = document.getElementById("addToGiftList");
  		if(addtogiftlistform == null) {
  			return;  
  		}
   		var currentGiftList = addtogiftlistform.elements["selectedgiftlist"].value;
  		var refreshform = document.getElementById("colorsizerefreshform");
   		refreshform.elements["savedgiftlist"].value = currentGiftList;
    }

    function setQuantityOnGiftlistForm() {
  		var wishListForm = document.getElementById("wishListform");
  		//alert("wishListForm.."+wishListForm);
  		if(wishListForm == null) return;
  		if(wishListForm.elements["quantity"] == null) return;
   		var currentQuantity = wishListForm.elements["quantity"].value;
  		var refreshform = document.getElementById("colorsizerefreshform");
   		refreshform.elements["savedquantity"].value = currentQuantity;
    }
    
    function submitRefreshForm() {
		var xhrArgs = {
			form: document.getElementById("colorsizerefreshform"),
			handleAs: "text",
	        preventCache: true,
	        load: function(data) {
				replaceDivContent("ColorSizePicker", data);
			}
		};
		dojo.xhrPost(xhrArgs);
    }
    
	function createObjInlineCart(objClient) {
		
		var objInlineCart = new Object();

		objInlineCart.objClipLayer = new Object();
		objInlineCart.objContentsLayer = new Object();
		objInlineCart.position = new Object();
		objInlineCart.objCart = new Object();
		objInlineCart.isOpen = false;
		objInlineCart.isAnimating = false;
		objInlineCart.intInlineCartHeight = 0;
		objInlineCart.scrollDelta = 5;
		objInlineCart.scrollSpeed = 1;
		objInlineCart.closeDelay = 60*1000;
		objInlineCart.hasMarketing = false;
	
		objInlineCart.initializeInlineCart = function() {
			objInlineCart.objClipLayer = document.getElementById("cartClip");
			objInlineCart.objContentsLayer = document.getElementById("cartContent");
		}
	
		objInlineCart.positionInlineCart = function() {
			if (objInlineCart.objClipLayer.style && objInlineCart.objContentsLayer.style) {
				objInlineCart.objClipLayer.style.clip = "rect(0px 240px " + objInlineCart.intInlineCartHeight + "px 0px)";
				objInlineCart.objClipLayer.style.width = "240px";
				objInlineCart.objClipLayer.style.height = objInlineCart.intInlineCartHeight+"px";
				objInlineCart.objContentsLayer.style.top = -1*objInlineCart.intInlineCartHeight+"px";
				objInlineCart.position = returnObjPosition("quickCart");
				if (objClient.isIE) {
					setObjPosition(objInlineCart.objClipLayer,(objInlineCart.position.x+document.getElementById("quickCart").offsetWidth-253)+13+"px",(objInlineCart.position.y+35)+"px");
				} else {
					setObjPosition(objInlineCart.objClipLayer,(objInlineCart.position.x+document.getElementById("quickCart").offsetWidth-249)+9+"px",(objInlineCart.position.y+40)+"px");
				}
			} else {
				setTimeout("objInlineCart.positionInlineCart()",80);
			}
		}
	
		objInlineCart.showInlineCart = function() {
			objInlineCart.objClipLayer.style.visibility = "visible";
			objInlineCart.objContentsLayer.style.visibility = "visible";
		  	if (objClient.isIE) {
		  		var arrayDropDowns = document.getElementsByTagName("select");
		  		for (var i=0; i< arrayDropDowns.length; i++) {
		  			if (arrayDropDowns[i].style) arrayDropDowns[i].style.visibility = "hidden";
		  		}
		  	}
		}
	
		objInlineCart.hideInlineCart = function() {
			objInlineCart.objClipLayer.style.visibility = "hidden";
			objInlineCart.objContentsLayer.style.visibility = "hidden";
		  	if (objClient.isIE) {
		  		var arrayDropDowns = document.getElementsByTagName("select");
		  		for (var i=0; i< arrayDropDowns.length; i++) {
		  			if (arrayDropDowns[i].style) arrayDropDowns[i].style.visibility = "visible";
		  		}
		  	}
		}
	
		objInlineCart.openInlineCart = function(isAuto) {
			objInlineCart.objCart = document.getElementById("cart");
			if ((document.getElementById("cartContent").innerHTML != "") && (!objInlineCart.isAnimating || isAuto)) {
				objInlineCart.isAnimating = true;
				objInlineCart.showInlineCart();
				var ypx = objInlineCart.objContentsLayer.style.top;
				var y = Number(ypx.substring(0,ypx.indexOf("px")));
				if(y+objInlineCart.scrollDelta <= 0){
					setObjPosition(objInlineCart.objContentsLayer,'0px',(y+objInlineCart.scrollDelta)+'px');
					objInlineCart.objTimer = setTimeout("objInlineCart.openInlineCart(true)", objInlineCart.scrollSpeed);
				} else {
					setObjPosition(objInlineCart.objContentsLayer,'0px','0px');
					objInlineCart.doOpenBag = false;
					clearTimeout(objInlineCart.objTimer);
					if(objInlineCart.objCart != null){
						objInlineCart.objCart.style.overflow = "auto"; //-moz-scrollbars-vertical
					}
					if (objInlineCart.hasMarketing) {
						objInlineCart.positionInlineCartMarketing();
						objInlineCart.showInlineCartMarketing();
						setTimeout("objInlineCart.openInlineCartMarketing();",200);
					} else {
						objInlineCart.isOpen = true;
						objInlineCart.isAnimating = false;
						setTimeout("objInlineCart.closeInlineCart();",objInlineCart.closeDelay);
					}
				}
			}
		}
	
		objInlineCart.closeInlineCart = function(isAuto) {
			objInlineCart.objCart = document.getElementById("cart");
			
		  if( objInlineCart.objCart != null ) {
		    objInlineCart.objCart.style.overflow = "hidden";
		  }
			
			if (!objInlineCart.isAnimating || isAuto) {
				objInlineCart.isAnimating = true;
				
					intTop = -objInlineCart.intInlineCartHeight;
					ypx = objInlineCart.objContentsLayer.style.top;
					y = Number(ypx.substring(0,ypx.indexOf("px")));
					if (y-objInlineCart.scrollDelta >= intTop){
						setObjPosition(objInlineCart.objContentsLayer,'0px',(y-objInlineCart.scrollDelta)+'px');
						objInlineCart.objTimer = setTimeout("objInlineCart.closeInlineCart(true)", 10);
					} else {
						setObjPosition(objInlineCart.objContentsLayer,'0px',intTop+'px');
						clearTimeout(objInlineCart.objTimer);
						objInlineCart.isOpen = false;
						objInlineCart.isAnimating = false;
						objInlineCart.hideInlineCart();
					}
				
			}
		}
	
		objInlineCart.setInlineCartData = function(strHTML) {
			if (strHTML) document.getElementById("cartContent").innerHTML = strHTML;
			objInlineCart.intInlineCartHeight = objInlineCart.objContentsLayer.offsetHeight;
			objInlineCart.positionInlineCart();
		}
	
		objInlineCart.checkInlineCart = function(e) {
			if (objInlineCart.isOpen) {
				setTimeout("objInlineCart.closeInlineCart();",100);
			}
		}
	
		objInlineCart.closeInlineCartAndRedirect = function(strUrl) {
			if (objInlineCart.isOpen) {
				objInlineCart.closeInlineCart(false);
			}
			if (!objInlineCart.isOpen) {
				document.location.replace(strUrl);
			}
			else {
				setTimeout("objInlineCart.closeInlineCartAndRedirect('"+strUrl+"')",200);
			}
		}
		
		return objInlineCart; 
		
	}

	
	function createObjClient() {
	
		var objClient = new Object();
		
		var agt = navigator.userAgent.toLowerCase();
		var appVer = navigator.appVersion.toLowerCase();
		var isT = true;
		var isF = false;
	
		//*** BROWSER VERSION ***
		var intMinor = parseFloat(appVer);
		var intMajor = parseInt(intMinor);
	
		objClient.isOpera = (agt.indexOf("opera") != -1);
		objClient.isOpera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
		objClient.isOpera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
		objClient.isOpera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
		objClient.isOpera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
		objClient.isOpera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk
		objClient.isOpera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr
		objClient.isOpera5up = (objClient.isOpera && !objClient.isOpera2 && !objClient.isOpera3 && !objClient.isOpera4);
		objClient.isOpera6up = (objClient.isOpera && !objClient.isOpera2 && !objClient.isOpera3 && !objClient.isOpera4 && !objClient.isOpera5); // new020128
		objClient.isOpera7up = (objClient.isOpera && !objClient.isOpera2 && !objClient.isOpera3 && !objClient.isOpera4 && !objClient.isOpera5 && !objClient.isOpera6); // new021205 -- dmr
	
		//Note: On IE, start of appVersion return 3 or 4
		//which supposedly is the version of Netscape it is compatible with.
		//So we look for the real version further on in the string
		var iePos = appVer.indexOf('msie');
		if (iePos !=-1) {
			intMinor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)))
			intMajor = parseInt(intMinor);
		}
	
		//ditto Konqueror
		objClient.isKonq = isF;
		var kqPos = agt.indexOf('konqueror');
		if (kqPos !=-1) {
			objClient.isKonq  = isT;
			intMinor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
			intMajor = parseInt(intMinor);
		}                                 
	
		objClient.isgetElementById   = (document.getElementById) ? isT : isF; // 001121-abk
		objClient.isgetElementsByTagName = (document.getElementsByTagName) ? isT : isF; // 001127-abk
		objClient.isdocumentElement = (document.documentElement) ? isT : isF; // 001121-abk
	
		objClient.isSafari = ((agt.indexOf('safari')!=-1) && (agt.indexOf('chrome')<0))?isT:isF;
		objClient.isKhtml  = (objClient.isSafari || objClient.isKonq);
	
		objClient.isGecko = ((!objClient.isKhtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?isT:isF;
		objClient.intGver  = 0;
		if (objClient.isGecko) objClient.intGver=Number(navigator.productSub);
	
		objClient.isMoz = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1) && 
							(agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1) && 
							(objClient.isGecko) && ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));
		objClient.isFb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
							(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
							(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
							(objClient.isGecko) && (navigator.vendor=="Firebird"));
		objClient.isFx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
							(agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
							(agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
							(objClient.isGecko) && (navigator.vendor=="Firefox"));
	
		if ((objClient.isMoz)||(objClient.isFb)||(objClient.isFx)) {  // 032504 - dmr
			objClient.intMozVer = (navigator.vendorSub)?navigator.vendorSub:0;
			if(!(objClient.intMozVer)) {
				objClient.intMozVer = agt.indexOf('rv:');
				objClient.intMozVer = agt.substring(objClient.intMozVer+3);
				is_paren   = objClient.intMozVer.indexOf(')');
				objClient.intMozVer = objClient.intMozVer.substring(0,is_paren);
			}
			intMinor = objClient.intMozVer;
			intMajor = parseInt(objClient.intMozVer);
		}
		objClient.intFbVer = objClient.intMozVer;
		objClient.intFxVer = objClient.intMozVer;
	
		objClient.isNav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
							&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
							&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)
							&& (!objClient.isKhtml) && (!(objClient.isMoz)) && (!objClient.isFb) && (!objClient.isFx));
	
		//Netscape6 is mozilla/5 + Netscape6/6.0!!!
		//Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
		//Changed this to use navigator.vendor/vendorSub - dmr 060502   
		//var nav6Pos = agt.indexOf('netscape6');
		//if (nav6Pos !=-1) {
		if ((navigator.vendor)&&((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&(objClient.isNav)) {
			intMajor = parseInt(navigator.vendorSub);
		//here we need intMinor as a valid float for testing. We'll
		//revert to the actual content before printing the result. 
			intMinor = parseFloat(navigator.vendorSub);
		}
	
		objClient.isNav2 = (objClient.isNav && (intMajor == 2));
		objClient.isNav3 = (objClient.isNav && (intMajor == 3));
		objClient.isNav4 = (objClient.isNav && (intMajor == 4));
		objClient.isNav4up = (objClient.isNav && intMinor >= 4);  // changed to intMinor for consistency - dmr, 011001
		objClient.isNavOnly = (objClient.isNav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)) );
	
		objClient.isNav6   = (objClient.isNav && intMajor==6);    // new 010118 mhp
		objClient.isNav6up = (objClient.isNav && intMinor >= 6) // new 010118 mhp
	
		objClient.isNav5   = (objClient.isNav && intMajor == 5 && !objClient.isNav6); // checked for ns6
		objClient.isNav5up = (objClient.isNav && intMinor >= 5);
	
		objClient.isNav7   = (objClient.isNav && intMajor == 7);
		objClient.isNav7up = (objClient.isNav && intMinor >= 7);
	
		objClient.isIE   = ((iePos!=-1) && (!objClient.isOpera) && (!objClient.isKhtml));
		objClient.isIE3  = (objClient.isIE && (intMajor < 4));
	
		objClient.isIE4   = (objClient.isIE && intMajor == 4);
		objClient.isIE4up = (objClient.isIE && intMinor >= 4);
		objClient.isIE5   = (objClient.isIE && intMajor == 5);
		objClient.isIE5up = (objClient.isIE && intMinor >= 5);
	
		objClient.isIE5_5  = (objClient.isIE && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
		objClient.isIE5_5up =(objClient.isIE && intMinor >= 5.5);                // 020128 new - abk
	
		objClient.isIE6   = (objClient.isIE && intMajor == 6);
		objClient.isIE6up = (objClient.isIE && intMinor >= 6);
	
		//KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
		//or if this is the first browser window opened.  Thus the
		//variables objClient.isAOL, objClient.isAOL3, and objClient.isAOL4 aren't 100% reliable.
	
		objClient.isAOL   = (agt.indexOf("aol") != -1);
		objClient.isAOL3  = (objClient.isAOL && objClient.isIE3);
		objClient.isAOL4  = (objClient.isAOL && objClient.isIE4);
		objClient.isAOL5  = (agt.indexOf("aol 5") != -1);
		objClient.isAOL6  = (agt.indexOf("aol 6") != -1);
		objClient.isAOL7  = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));
		objClient.isAOL8  = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1));
	
		objClient.isWebTV = (agt.indexOf("webtv") != -1);
	
		//new 020128 - abk
	
		objClient.isTVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
		objClient.isAOLTV = objClient.isTVNavigator;
	
		objClient.isHotJava = (agt.indexOf("hotjava") != -1);
		objClient.isHotJava3 = (objClient.isHotJava && (intMajor == 3));
		objClient.isHotJava3up = (objClient.isHotJava && (intMajor >= 3));
	
		//end new
	
		//*** JAVASCRIPT VERSION CHECK ***
		//Useful to workaround Nav3 bug in which Nav3
		//loads <SCRIPT LANGUAGE="JavaScript1.2">.
		//updated 020131 by dragle
		objClient.intJS = 0;
		if (objClient.isNav2 || objClient.isIE3) objClient.intJS = 1.0;
		else if (objClient.isNav3) objClient.intJS = 1.1;
		else if ((objClient.isOpera5)||(objClient.isOpera6)) objClient.intJS = 1.3; // 020214 - dmr
		else if (objClient.isOpera7up) objClient.intJS = 1.5; // 031010 - dmr
		else if (objClient.isKhtml) objClient.intJS = 1.5;   // 030110 - dmr
		else if (objClient.isOpera) objClient.intJS = 1.1;
		else if ((objClient.isNav4 && (intMinor <= 4.05)) || objClient.isIE4) objClient.intJS = 1.2;
		else if ((objClient.isNav4 && (intMinor > 4.05)) || objClient.isIE5) objClient.intJS = 1.3;
		else if (objClient.isNav5 && !(objClient.isNav6)) objClient.intJS = 1.4;
		else if (objClient.isHotJava3up) objClient.intJS = 1.4; // new 020128 - abk
		else if (objClient.isNav6up) objClient.intJS = 1.5;
	
		//NOTE: In the future, update this code when newer versions of JS
		//are released. For now, we try to provide some upward compatibility
		//so that future versions of Nav and IE will show they are at
		//*least* JS 1.x capable. Always check for JS version compatibility
		//with > or >=.
	
		else if (objClient.isNav && (intMajor > 5)) objClient.intJS = 1.4;
		else if (objClient.isIE && (intMajor > 5)) objClient.intJS = 1.3;
		else if (objClient.isMoz) objClient.intJS = 1.5;
		else if (objClient.isFb||objClient.isFx) objClient.intJS = 1.5; // 032504 - dmr
	
		//what about ie6 and ie6up for js version? abk
	
		//HACK: no idea for other browsers; always check for JS version 
		//with > or >=
		else objClient.intJS = 0.0;
		//HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
		if ((agt.indexOf("mac")!=-1) && objClient.isIE5up) objClient.intJS = 1.4; // 020128 - abk
	
		//Done with intMinor testing; revert to real for N6/7
		if (objClient.isNav6up) intMinor = Number(navigator.vendorSub);
	
		//*** PLATFORM ***
		objClient.isWin   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
		//NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
	//	       Win32, so you can't distinguish between Win95 and WinNT.
		objClient.isWin95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
	
		//is this a 16 bit compiled version?
		objClient.isWin16 = ((agt.indexOf("win16")!=-1) ||
							(agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
							(agt.indexOf("windows 16-bit")!=-1) );
	
		objClient.isWin31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
							(agt.indexOf("windows 16-bit")!=-1));
	
		objClient.isWinME = ((agt.indexOf("win 9x 4.90")!=-1));    // new 020128 - abk
		objClient.isWin2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
		objClient.isWinXP = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr
	
		//NOTE: Reliable detection of Win98 may not be possible. It appears that:
	//	      - On Nav 4.x and before you'll get plain "Windows" in userAgent.
	//	      - On Mercury client, the 32-bit version will return "Win98", but
	//	        the 16-bit version running on Win98 will still return "Win95".
		objClient.isWin98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
		objClient.isWinNT = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1) && !objClient.isWinXP);
		objClient.isWin32 = (objClient.isWin95 || objClient.isWinNT || objClient.isWin98 ||
							((intMajor >= 4) && (navigator.platform == "Win32")) || 
							(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
	
		objClient.isMac    = (agt.indexOf("mac")!=-1);
		if (objClient.isMac) objClient.isWin = !objClient.isMac; // dmr - 06/20/2002
	
		//additional checks, abk
		objClient.isFrames = (window.frames) ? isT : isF;
		if (objClient.isFrames) objClient.intFrames = window.frames.length;
		else objClient.intFrames = 0;
	
		//java
		objClient.isJava = (navigator.javaEnabled());
	
		//Flash checking code adapted from Doc JavaScript information; 
		//see http://webref.com/js/column84/2.html
	
		objClient.isFlash = isF;
		objClient.intFlashVer = 0;
	
		if ((objClient.isNav||objClient.isOpera||objClient.isMoz||objClient.isFb||objClient.isFx)||(objClient.isMac&&objClient.isIE5up)) {
			var plugin = (navigator.mimeTypes && 
						navigator.mimeTypes["application/x-shockwave-flash"] &&
						navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
						navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
			if (plugin) {
				objClient.isFlash = isT;
				objClient.intFlashVer = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
			}
		}
		
		return objClient;
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Top Menu
 ***************************************************************************************/
	function searchFieldKeyPress(e) {
		var keynum;
	    keynum = e.keyCode;
	    if (keynum == 13) {
	    	return checkForSearchKeywords();
	    } else {
		    return true;
	    }
	}
	
	function checkForSearchKeywords() {
		var kwrds = document.prodsearch.keywordInput.value;
	  	if ( kwrds == '' || kwrds == 'Enter keyword' ) {
	  		alert("Please enter a search term or keyword");
	  		return false;
	  	}
	  	changeSearchSuccessURL(kwrds);
	  	return true;
	}
	
	function changeSearchSuccessURL(keywords) {
		document.getElementById('CatalogSearchSuccessURL').value = "/search/results.do?viewAll=true&newSearch=true&kwrds=" + keywords;
	   	return true;
	}
	
	function showTopMenu(makeTopMenuInvisible) {
		var xhrArgs = {
            url: "/topMenu.do?makeTopMenuInvisible=" + makeTopMenuInvisible,
            handleAs: "text",
            preventCache: true,
            load: function(data) {
	    		replaceDivContent("topMenu", data);
            }
        };
		dojo.xhrGet(xhrArgs);
	}
	
	function toggleFullCart(itemsInCart) {
		if (objInlineCart.objClipLayer.style){
			if(itemsInCart == 0){
				var cartUrl = '/checkout/empty_cart.jsp';
			} else if(itemsInCart > 0 &&  itemsInCart < 4){
				var cartUrl = '/checkout/minicart.jsp';
			} else {
				var cartUrl = '/checkout/miniscrollcart.jsp';
			}
	
			if (objInlineCart.isOpen){
				objInlineCart.closeInlineCart(false);
			} else {
		     	var xmlhttp = getHTTPRequest();
		     	xmlhttp.open("GET",cartUrl, true);
		     	xmlhttp.onreadystatechange = 
		     		function() {	
		     			if (xmlhttp.readyState == 4) {
		     				objInlineCart.setInlineCartData(xmlhttp.responseText);
							objInlineCart.doOpenBag = true;
							objInlineCart.openInlineCart(false);
		 	  	    	}
		     		};
		     	xmlhttp.send(null);
		   }
		}
	}
	
/***************************************************************************************/

/****************************************************************************************
 * Show Breadcrumb
 ***************************************************************************************/
	function showBreadcrumb(blankContent) {
		var breadcrumb = document.getElementById("breadcrumb");
		if (blankContent) {
			breadcrumb.innerHTML = "";
		} else {
			var xhrArgs = {
					url: "/struts/breadcrumb.jsp",
		            handleAs: "text",
		            preventCache: true,
		            load: function(data) {
						replaceDivContent("breadcrumb", data);
		            }
		        };
			dojo.xhrGet(xhrArgs);
		}
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Categories Menu
 ***************************************************************************************/
	function showCategoriesMenu(makeCategoriesMenuInvisible, categoryId, makeRootCategoryClickable) {
		
		var xhrArgs = {
				url: "/ShowDynamicMenu.do?makeRootCategoryClickable=" + makeRootCategoryClickable + (categoryId == null ? "" : "&categoryId=" + categoryId),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					replaceDivContent("categoriesMenu", data);
	            }
	        };
		dojo.xhrGet(xhrArgs);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Footer
 ***************************************************************************************/
	function showFooter(selectedMenu, makeFooterInvisible) {
		var xhrArgs = {
			url: "/footer.do?selectedMenu=" + selectedMenu + "&makeFooterInvisible=" + makeFooterInvisible,
            handleAs: "text",
            preventCache: true,
            load: function(data) {
				replaceDivContent("footerInfo", data);
            }
        };
		dojo.xhrGet(xhrArgs);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Homepage
 ***************************************************************************************/
	function fadeSlideShowImagesFunction(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor) {
    	
    	var fadeInDiv = document.getElementById('fadeInDiv');
    	var fadeOutDiv = document.getElementById('fadeOutDiv');
    	
    	if (!fadeInDiv) {
    		return;
    	}
    	
    	var fadeInDivOpacity = parseFloat(fadeInDiv.style.opacity);
    	var fadeOutDivOpacity = parseFloat(fadeOutDiv.style.opacity);

    	try { fadeInDiv.style.opacity = fadeInDivOpacity + fadeFactor; } catch(err) {}
    	try { fadeInDiv.style.MozOpacity = fadeInDivOpacity + fadeFactor; } catch(err) {}
    	try { fadeInDiv.style.filter = 'alpha(opacity=' + ((fadeInDivOpacity + fadeFactor) * 100) + ')'; } catch(err) {}

    	try { fadeOutDiv.style.opacity = fadeOutDivOpacity - fadeFactor; } catch(err) {}
    	try { fadeOutDiv.style.MozOpacity = fadeOutDivOpacity - fadeFactor; } catch(err) {}
    	try { fadeOutDiv.style.filter = 'alpha(opacity=' + ((fadeOutDivOpacity - fadeFactor) * 100) + ')'; } catch(err) {}

    	fadeOutDivOpacity = fadeOutDivOpacity - fadeFactor;
    	
    	if (fadeOutDivOpacity > 0.0) { 
    		var callFadeSlideShowImagesFunction = function() { fadeSlideShowImagesFunction(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor); };
    		rotateSlideShowThread = setTimeout(callFadeSlideShowImagesFunction, fadeInterval);
    	} else {
    		var callRotateSlideShowImages = function() { rotateSlideShowImages(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor); };
    		rotateSlideShowThread = setTimeout(callRotateSlideShowImages, fixedImageTime);
    	}
    	
    }

	function rotateSlideShowImages(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor) {

		if (homepageImages.length == 0) {
			clearTimeout(rotateSlideShowThread);
		}
		
    	var currentImage = homepageImages[homepageImageIndex];
    	var firstRun = (homepageImages.length == 0);
    	var fadeInSlideShow = document.getElementById('fadeInSlideShow');
    	var fadeOutSlideShow = document.getElementById('fadeOutSlideShow');
    	var fadeInDiv = document.getElementById('fadeInDiv');
    	var fadeOutDiv = document.getElementById('fadeOutDiv');

    	if (currentImage == null) {
    		currentImage = new Image();
    		var nextImagePrefix = ((homepageImageIndex + 1) < 10 ? "0" : "");
    		currentImage.src = imagesPath + "/" + nextImagePrefix + (homepageImageIndex + 1) + '.jpg';
    		homepageImages[homepageImageIndex] = currentImage;
    	}

    	homepageImageIndex++;
    	if (homepageImageIndex > (numImages-1)) {
    		homepageImageIndex = 0;
    	}

    	if (firstRun) {

    		fadeOutSlideShow.src = currentImage.src;
      		fadeInSlideShow.src = currentImage.src;
      		
    		var contentInfo = document.getElementById('contentInfo');
    		var curleft = curtop = 0;
    		if (contentInfo.offsetParent) {
    			do {
    				curleft += contentInfo.offsetLeft;
    				curtop += contentInfo.offsetTop;
    			} while (contentInfo = contentInfo.offsetParent);
    		}
    		
    		fadeOutDiv.style.top = curtop;
    		fadeOutDiv.style.display = 'block';
    	  	fadeInDiv.style.top = curtop;
    	  	fadeInDiv.style.display = 'block';
      	  	
    	  	if (numImages > 1) {
    	  		var callRotateSlideShowImages = function() { rotateSlideShowImages(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor); };
    	  		rotateSlideShowThread = setTimeout(callRotateSlideShowImages, fixedImageTime);
    	  	}
    		
    	} else {
      		
    		if (!fadeOutSlideShow) {
    			return;
    		}
    		
    		fadeOutSlideShow.src = fadeInSlideShow.src; 
      		fadeInSlideShow.src = currentImage.src;
      		
    		try { fadeInDiv.style.opacity = 0.00; } catch(err) {}
    		try { fadeInDiv.style.MozOpacity = 0.00; } catch(err) {}
    		try { fadeInDiv.style.filter = 'alpha(opacity=0)'; } catch(err) {}
    		try { fadeOutDiv.style.opacity = 1.00; } catch(err) {}
    		try { fadeOutDiv.style.MozOpacity = 1.00; } catch(err) {}
    		try { fadeOutDiv.style.filter = 'alpha(opacity=100)'; } catch(err) {}
    		
    		var callFadeSlideShowImagesFunction = function() { fadeSlideShowImagesFunction(homepageImageIndex, homepageImages, numImages, imagesPath, fixedImageTime, fadeInterval, fadeFactor); };
    		rotateSlideShowThread = setTimeout(callFadeSlideShowImagesFunction, fadeInterval);
    		
    	}
    	
    }
		
	function showHomepage(isFullReload) {
		
		clearTimeout(landingPageEffectThread);
	
		var headerAndFooterFadeInFunction = 
			function() {
			
				var fadeFactor = 0.08;
				var topMenuOptions = document.getElementById('topMenuOptions');
				var categoriesMenuOptions = document.getElementById('categoriesMenuOptions');
				var footerOptions = document.getElementById('footerOptions');
	
				var opacity = parseFloat(footerOptions.style.opacity);
				if (isNaN(opacity)) {
					opacity = 0;
				}
				
				try { topMenuOptions.style.opacity = opacity + fadeFactor; } catch(err) {}
				try { topMenuOptions.style.MozOpacity = opacity + fadeFactor; } catch(err) {}
				try { topMenuOptions.style.filter = 'alpha(opacity=' + ((opacity + fadeFactor) * 100) + ')'; } catch(err) {}
		
				try { categoriesMenuOptions.style.opacity = opacity + fadeFactor; } catch(err) {}
				try { categoriesMenuOptions.style.MozOpacity = opacity + fadeFactor; } catch(err) {}
				try { categoriesMenuOptions.style.filter = 'alpha(opacity=' + ((opacity + fadeFactor) * 100) + ')'; } catch(err) {}
				
				try { footerOptions.style.opacity = opacity + fadeFactor; } catch(err) {}
				try { footerOptions.style.MozOpacity = opacity + fadeFactor; } catch(err) {}
				try { footerOptions.style.filter = 'alpha(opacity=' + ((opacity + fadeFactor) * 100) + ')'; } catch(err) {}
		
				opacity = opacity + fadeFactor;
		
				if (opacity < 1.00) { 
					setTimeout(headerAndFooterFadeInFunction, 50);
				}
		
			};
	
		var setHtmlMouseOverFunction = 
			function() {
				var htmlObj = document.getElementById("htmlObj");
				htmlObj.onmousemove = function() { headerAndFooterFadeInFunction(); document.getElementById("htmlObj").onmousemove = ""; };
			};
			
		var startHomepageEffectsFunction =  
			function() {
		
				var mobile = false;
			    if ((navigator.userAgent.indexOf('iPod') >=0) ||
			    	(navigator.userAgent.indexOf('iPhone') >= 0) ||
			    	(navigator.userAgent.indexOf('iPad') >= 0) ||
			    	(navigator.userAgent.indexOf('Android') >= 0)) {
			    	mobile = true;
			    }

				var topMenuOptions = document.getElementById("topMenuOptions");
				try { topMenuOptions.style.opacity = 0.00; } catch(err) {}
				try { topMenuOptions.style.MozOpacity = 0.00; } catch(err) {}
				try { topMenuOptions.style.filter = 'alpha(opacity=0)'; } catch(err) {}
			
				var categoriesMenuOptions = document.getElementById("categoriesMenuOptions");
				try { categoriesMenuOptions.style.opacity = 0.00; } catch(err) {}
				try { categoriesMenuOptions.style.MozOpacity = 0.00; } catch(err) {}
				try { categoriesMenuOptions.style.filter = 'alpha(opacity=0)'; } catch(err) {}
			
				var footerOptions = document.getElementById("footerOptions");
				try { footerOptions.style.opacity = 0.00; } catch(err) {}
				try { footerOptions.style.MozOpacity = 0.00; } catch(err) {}
				try { footerOptions.style.filter = 'alpha(opacity=0)'; } catch(err) {}

				var fixedImageTime, fadeInterval, fadeFactor;
				
				if (objClient.isIE) {
					fixedImageTime = 3000;
					fadeInterval = 1;
					fadeFactor = 0.06;
				} else if (objClient.isMoz) {
					fixedImageTime = 3100;
					fadeInterval = 15;
					fadeFactor = 0.04;
				} else if (objClient.isSafari) {
					if (objClient.isMac) {
						fixedImageTime = 2900;
						fadeInterval = 0;
						fadeFactor = 0.18;
					} else {
						fixedImageTime = 3000;
						fadeInterval = 1;
						fadeFactor = 0.06;
					}
				} else {
					fixedImageTime = 3000;
					fadeInterval = 15;
					fadeFactor = 0.02;
				}
				
				// Starts slideshow presentation
				rotateSlideShowImages(0, new Array(), 1, '/slideshow1', fixedImageTime, fadeInterval, fadeFactor); 
			
				// Make Header and Menu Fade In on Mouse Move
			    if (mobile) {
			    	headerAndFooterFadeInFunction();
			    } else {
					setTimeout(setHtmlMouseOverFunction, 500);
			    }
					
			};
			
		if (!isFullReload) {
			
			// Loads top menu section
			showTopMenu(true);
			
			// Loads categories menu
			showCategoriesMenu(true, null, false);
			
			// Loads footer section
			showFooter('', true);
		    
			// Loads content section
			var xhrArgs = {
				url: "/index.jsp?pageFullRefresh=false",
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					// Sets page content
					replaceDivContent("contentInfo", data);

		    		// Loads breadcrumb
					showBreadcrumb(true);

					// Sets page title
					document.title = 'James Perse - Los Angeles';
					
					// Starts page effects
					startHomepageEffectsFunction();
	            },
	            error: function(response, ioArgs) {
	            	window.location = "/index.jsp";
	            } 
	        };
			dojo.xhrPost(xhrArgs);
			
		} else {
	
			// Starts page effects
			startHomepageEffectsFunction();

		}
		
		// Loads partners tags
	    addPartnerTags(true, true, true, "/index.jsp", true, '20473723');
		
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Static Page 
 ***************************************************************************************/
	function showBasicPage(isFullReload, footerSelectedMenu, pageUrl, pageTitle, functionToCallAfterLoad) {
		
		var separator = (pageUrl.indexOf("?") < 0 ? "?" : "&");
		
		if (!isFullReload) {
			
			// Loads top menu section
			// showTopMenu(false);
			
			// Loads categories menu
			showCategoriesMenu(false, null, false);

			// Loads footer section
			showFooter(footerSelectedMenu, false);
			
			// Loads content section
			var xhrArgs = {
				url: (pageUrl + separator + "pageFullRefresh=false"),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					// Sets page content
					replaceDivContent("contentInfo", data);
					
		    		// Loads breadcrumb
					showBreadcrumb(false);

					// Sets page title
					document.title = pageTitle;
					
					if (functionToCallAfterLoad != null) {
						functionToCallAfterLoad();
					}
	            },
	            error: function(response, ioArgs) {
	            	window.location = pageUrl;
	            }
	        };
			dojo.xhrGet(xhrArgs);
			
		} else {

			if (functionToCallAfterLoad != null) {
				functionToCallAfterLoad();
			}
			
		}
		
		// Loads partners tags
	    addPartnerTags(true, true, true, pageUrl, false, null);
		
	}
/***************************************************************************************/

	
/****************************************************************************************
 * Show Contact Us 
 ***************************************************************************************/
	function showContactUs(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ContactUs.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show FAQs 
 ***************************************************************************************/
	function showFAQs(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/FAQs.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Ordering Info
 ***************************************************************************************/
	function showOrderingInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/OrderingInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Shipping and Delivery Info
 ***************************************************************************************/
	function showShippingAndDeliveryInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ShippingAndDeliveryInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Holiday Shipping Calendar Info
 ***************************************************************************************/
	function showHolidayShippingCalendarInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/HolidayShippingCalendarInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Sales Tax Info
 ***************************************************************************************/
	function showSalesTaxInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/SalesTaxInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Size Charts Info
 ***************************************************************************************/
	function showSizeChartsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/SizeChartsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Payment Options Info
 ***************************************************************************************/
	function showPaymentOptionsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/PaymentOptionsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Placing an Order Info
 ***************************************************************************************/
	function showPlacingAnOrderInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/PlacingAnOrderInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Tracking an Order Info
 ***************************************************************************************/
	function showTrackingAnOrderInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/TrackingAnOrderInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show International Ordering Info
 ***************************************************************************************/
	function showInternationalOrderingInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/InternationalOrderingInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Returns And Exchanges Info
 ***************************************************************************************/
	function showReturnsAndExchangesInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ReturnsAndExchangesInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Return Policy Info
 ***************************************************************************************/
	function showReturnPolicyInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ReturnPolicyInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Express Exchanges Info
 ***************************************************************************************/
	function showExpressExchangesInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ExpressExchangesInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show How To Return Info
 ***************************************************************************************/
	function showHowToReturnInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/HowToReturnInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Store Returns Info
 ***************************************************************************************/
	function showStoreReturnsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/StoreReturnsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Return Notifications Info
 ***************************************************************************************/
	function showReturnNotificationsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/ReturnNotificationsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Gift Services Info
 ***************************************************************************************/
	function showGiftServicesInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/GiftServicesInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Registration Info
 ***************************************************************************************/
	function showRegistrationInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/RegistrationInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Signing In Signing Out Info
 ***************************************************************************************/
	function showSigningInSigningOutInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/SigningInSigningOutInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Account Benefits Info
 ***************************************************************************************/
	function showAccountBenefitsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/AccountBenefitsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Subscription Benefits Info
 ***************************************************************************************/
	function showSubscriptionBenefitsInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/SubscriptionBenefitsInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Privacy And Security Info
 ***************************************************************************************/
	function showPrivacyAndSecurityInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/PrivacyAndSecurityInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Terms Of Use Info
 ***************************************************************************************/
	function showTermsOfUseInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/TermsOfUseInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Privacy Policy Info
 ***************************************************************************************/
	function showPrivacyPolicyInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/PrivacyPolicyInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Security Info
 ***************************************************************************************/
	function showSecurityInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/SecurityInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Cookies And Browsers Info
 ***************************************************************************************/
	function showCookiesAndBrowsersInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/CookiesAndBrowsersInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Jacket Recall Info
 ***************************************************************************************/
	function showJacketRecallInfo(isFullReload) {
		showBasicPage(isFullReload, 'CUSTOMER_SERVICE', "/JacketRecallInfo.do", 'Customer Service - James Perse - Los Angeles', null);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Biography
 ***************************************************************************************/
	var biographyScrollDefaultOffset = 5;
	var biographyScrolling = false;
	
	function biographyScrollPictures(offSet) {
		var scrollLeft = document.getElementById('jpChildhoodPictures').scrollLeft + offSet;
		document.getElementById('jpChildhoodPictures').scrollLeft = scrollLeft;
		if ((offSet > 0) && (document.getElementById('jpChildhoodPictures').scrollLeft < scrollLeft)) {
			document.getElementById('jpChildhoodPictures').innerHTML += document.getElementById('jpChildhoodPictures').innerHTML;
			document.getElementById('jpChildhoodPictures').scrollLeft = scrollLeft;
		} else if ((offSet < 0) && (scrollLeft < 0)) {
			document.getElementById('jpChildhoodPictures').innerHTML += document.getElementById('jpChildhoodPictures').innerHTML;
			document.getElementById('jpChildhoodPictures').scrollLeft = 1054 + offSet;
		}
	}
	
	function biographyScrollPicturesLeft() {
		if (biographyScrolling) {
			biographyScrollPictures(biographyScrollDefaultOffset*-1);
			setTimeout(biographyScrollPicturesLeft, 50);
		}
	}
	
	function biographyScrollPicturesRight() {
		if (biographyScrolling) {
			biographyScrollPictures(biographyScrollDefaultOffset*1);
			setTimeout(biographyScrollPicturesRight, 50);
		}
	}
	
	function biographyScrollWheel(event){
		var delta = event.wheelDelta;
		if (event.detail) {
			delta = event.detail*-1;
		}
		if (event.preventDefault) {
            event.preventDefault();
		}
		if (delta < 0) {
			biographyScrollPictures(biographyScrollDefaultOffset*5);
		} else {
			biographyScrollPictures(biographyScrollDefaultOffset*-5);
		}
		event.returnValue = false;
	}
	
	function showBiography(isFullReload) {
		
		var initScrollFunction = 
			function() {
				if (document.getElementById('jpChildhoodPictures').addEventListener) {
					document.getElementById('jpChildhoodPictures').addEventListener('DOMMouseScroll', biographyScrollWheel, false);
				}
		};
				
		showBasicPage(isFullReload, 'COMPANY', "/Biography.do", 'About James Perse Company - Los Angeles', initScrollFunction);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Careers
 ***************************************************************************************/
	function showCareers(isFullReload) {
		showBasicPage(isFullReload, 'CAREERS', "/Careers.do", 'Careers - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Careers
 ***************************************************************************************/
	function showCareersCorporatePositions(isFullReload) {
		showBasicPage(isFullReload, 'CAREERS', "/CareersCorporatePositions.do", 'Careers - Corporate Positions - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Careers Retail Opportunities
 ***************************************************************************************/
	function showCareerOpportunity(id) {
		// Hiding any possible visible opportunity	
		var count = 1;
		opportunityDiv = document.getElementById('opportunity' + count); 
		while ((opportunityDiv) && (count < 10)) {
			opportunityDiv.style.display = 'none';
			count = count + 1;
			opportunityDiv = document.getElementById('opportunity' + count);
		}

		// Showing selected opportunity
		opportunityDiv = document.getElementById('opportunity' + id);
		if (opportunityDiv) {
			opportunityDiv.style.display = 'block';
		}
	}

	function showCareersRetailOpportunities(isFullReload) {
		showBasicPage(isFullReload, 'CAREERS', "/CareersRetailOpportunities.do", 'Careers -	Retail Opportunities - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Careers Internships
 ***************************************************************************************/
	function showCareersInternships(isFullReload) {
		showBasicPage(isFullReload, 'CAREERS', "/CareersInternships.do", 'Careers -	Internships - James Perse - Los Angeles', null);
	}
/***************************************************************************************/
	
/****************************************************************************************
 * Show Press
 ***************************************************************************************/
	function showPress(isFullReload) {
		showBasicPage(isFullReload, 'COMPANY', "/Press.do", 'About James Perse Company - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Wholesale Info USA
 ***************************************************************************************/
	function showWholesaleInfoUSA(isFullReload, siteArea) {
		if (siteArea == 'company') {
			showBasicPage(isFullReload, 'COMPANY', "/WholesaleInfoUSA.do?siteArea=company", 'James Perse Stores - Locate a James Perse Store', null);
		} else {
			showBasicPage(isFullReload, 'STORES', "/WholesaleInfoUSA.do?siteArea=stores", 'James Perse Stores - Locate a James Perse Store', null);
		}
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Wholesale Info International
 ***************************************************************************************/
	function getWholesaleInfoInternationalStores() {
		var wholesaleInfoInternationalForm = document.WholesaleInfoInternationalActionForm;
		var siteArea = wholesaleInfoInternationalForm.siteArea.value;
		if (siteArea == 'company') {
			showBasicPage(false, 'COMPANY', ("/WholesaleInfoInternational.do?siteArea=company&country=" + wholesaleInfoInternationalForm.country.value), 'James Perse Stores - Locate a James Perse Store', null);
		} else {
			showBasicPage(false, 'STORES', ("/WholesaleInfoInternational.do?siteArea=stores&country=" + wholesaleInfoInternationalForm.country.value), 'James Perse Stores - Locate a James Perse Store', null);
		}
	}
	
	function showWholesaleInfoInternational(isFullReload, siteArea) {
		if (siteArea == 'company') {
			showBasicPage(isFullReload, 'COMPANY', "/WholesaleInfoInternational.do?siteArea=company", 'James Perse Stores - Locate a James Perse Store', null);
		} else {
			showBasicPage(isFullReload, 'STORES', "/WholesaleInfoInternational.do?siteArea=stores", 'James Perse Stores - Locate a James Perse Store', null);
		}
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Boutiques Locator
 ***************************************************************************************/
	function getBoutiqueLocation() {
		var boutiqueOptions = document.BoutiquesLocatorActionForm.store;
		if ((boutiqueOptions.value.length > 0) &&
			(boutiqueOptions.value != "-")) {
			var xhrArgs = {
					url: ("/BoutiquesLocator.do?store=" + boutiqueOptions[boutiqueOptions.selectedIndex].value + "&processForm=true&pageFullRefresh=false"),
		            handleAs: "text",
		            preventCache: true,
		            load: function(data) {
						// Sets page content
						replaceDivContent("contentInfo", data);
		            },
		            error: function(response, ioArgs) {
		            	window.location = ("/BoutiquesLocator.do?store=" + boutiqueOptions[boutiqueOptions.selectedIndex].value + "&processForm=true");
		            }
		        };
			dojo.xhrGet(xhrArgs);
		}
	}

	function showBoutiquesLocator(isFullReload, store) {
		var storeParams = "";
		if (store != null) {
			storeParams = "?store=" + store + "&processForm=true";
		}
		showBasicPage(isFullReload, 'STORES', ("/BoutiquesLocator.do" + storeParams), 'James Perse Stores - Locate a James Perse Store', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Studio Services
 ***************************************************************************************/
	function showStudioServices(isFullReload) {
		showBasicPage(isFullReload, 'STORES', "/StudioServices.do", 'James Perse Stores - Locate a James Perse Store', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Retailers Locator USA
 ***************************************************************************************/
	function reloadRetailersResults(pageUrl) {
		var xhrArgs = {
				url: (pageUrl + "&pageFullRefresh=false"),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					// Sets page content
					replaceDivContent("contentInfo", data);
	            },
	            error: function(response, ioArgs) {
	            	window.location = pageUrl;
	            }
	        };
		dojo.xhrGet(xhrArgs);
	}
	
	function getRetailStoresByZipcode(alreadySubmitted) {
		var zipcodeField = document.RetailersLocatorUSAActionForm[0].zipcode;
		var milesField = document.RetailersLocatorUSAActionForm[0].miles;
		if (zipcodeField.value != '') {
			document.RetailersLocatorUSAActionForm[1].state.selectedIndex = 0;
			if (!alreadySubmitted) {
				reloadRetailersResults("/RetailersLocatorUSA.do?search=zipcode&processForm=true&zipcode=" + zipcodeField.value + "&miles=" + milesField[milesField.selectedIndex].value);
				return false;
			}
		}
	}
	
	function getRetailStoresByState() {
		var stateField = document.RetailersLocatorUSAActionForm[1].state;
    	if (stateField.selectedIndex != 0) {       	
    		document.RetailersLocatorUSAActionForm[0].zipcode.value = "";
    		document.RetailersLocatorUSAActionForm[0].miles.selectedIndex = 2;
    		reloadRetailersResults("/RetailersLocatorUSA.do?search=state&processForm=true&state=" + stateField[stateField.selectedIndex].value);
    	}  
	}

	function showRetailersLocatorUSA(isFullReload) {
		showBasicPage(isFullReload, 'STORES', "/RetailersLocatorUSA.do", 'James Perse Stores - Locate a James Perse Store', null);
	}
/***************************************************************************************/


/****************************************************************************************
 * Show Retailers Locator International
 ***************************************************************************************/
	function getInternationalRetailersInfo() {
		var countryField = document.RetailersLocatorInternationalActionForm.country;
		if (countryField.selectedIndex > 0) {
			//document.RetailersLocatorInternationalActionForm.submit();
			var xhrArgs = {
					url: ("/RetailersLocatorInternational.do?processForm=true&country=" + countryField[countryField.selectedIndex].value + "&pageFullRefresh=false"),
		            handleAs: "text",
		            preventCache: true,
		            load: function(data) {
						// Sets page content
						replaceDivContent("contentInfo", data);
		            },
		            error: function(response, ioArgs) {
		            	window.location = ("/RetailersLocatorInternational.do?processForm=true&country=" + countryField[countryField.selectedIndex].value);
		            }
		        };
			dojo.xhrGet(xhrArgs);
			return false;
		}
	}
	
	function showRetailersLocatorInternational(isFullReload) {
		showBasicPage(isFullReload, 'STORES', "/RetailersLocatorInternational.do", 'James Perse Stores - Locate a James Perse Store', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Stores
 ***************************************************************************************/
	function showStores(isFullReload) {

		var fixedImageTime, fadeInterval, fadeFactor;
		
		if (objClient.isIE) {
			fixedImageTime = 1800;
			fadeInterval = 6;
			fadeFactor = 0.08;
		} else if (objClient.isMoz) {
			fixedImageTime = 1800;
			fadeInterval = 0;
			fadeFactor = 0.05;
		} else if (objClient.isSafari) {
			if (objClient.isMac) {
				/*
				fixedImageTime = 1700;
				fadeInterval = 0;
				fadeFactor = 0.18;
				*/
				fixedImageTime = 1800;
				fadeInterval = 6;
				fadeFactor = 0.08;
			} else {
				fixedImageTime = 1800;
				fadeInterval = 6;
				fadeFactor = 0.08;
			}
		} else {
			fixedImageTime = 1800;
			fadeInterval = 10;
			fadeFactor = 0.02;
		}
		
		if (!isFullReload) {
			
			// Loads top menu section
			showTopMenu(false);
			
			// Loads categories menu
			showCategoriesMenu(false, null, false);
			
			// Loads footer section
			showFooter('STORES', false);
		    
			// Loads content section
			var xhrArgs = {
				url: "/Stores.do?pageFullRefresh=false",
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					// Sets page content
					replaceDivContent("contentInfo", data);

		    		// Loads breadcrumb
					showBreadcrumb(false);

					// Sets page title
					document.title = 'James Perse Stores - Locate a James Perse Store';

					// Starts slideshow presentation
					rotateSlideShowImages(0, new Array(), 16, '/slideshow2_images', fixedImageTime, fadeInterval, fadeFactor); 

	            },
	            error: function(response, ioArgs) {
	            	window.location = "/Stores.do";
	            }
	        };
			dojo.xhrGet(xhrArgs);
			
		} else {

			// Starts page effects
			rotateSlideShowImages(0, new Array(), 16, '/slideshow2_images', fixedImageTime, fadeInterval, fadeFactor);

		}
	
		// Loads partners tags
	    addPartnerTags(true, true, true, "/Stores.do", false, null);
		
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Studio Services
 ***************************************************************************************/
	function showSitemap(isFullReload) {
		showBasicPage(isFullReload, 'SITE_MAP', "/sitemap.do", 'Site Map - James Perse - Los Angeles', null);
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Category Landing Page
 ***************************************************************************************/
	function fadeCategoryImageIn(col, categoryBannerWidth, categoryImages, categoryLinks) { 
		//var fadeFactor = 0.2;
		var currentImage = document.getElementById('menuItem_' + col);
		var opacity = parseFloat(currentImage.style.opacity);
		try { currentImage.style.opacity = opacity + fadeFactor; } catch(err) {}
		try { currentImage.style.MozOpacity = opacity + fadeFactor; } catch(err) {}
		try { currentImage.style.filter = 'alpha(opacity=' + ((opacity + fadeFactor) * 100) + ')'; } catch(err) {}
		opacity = opacity + fadeFactor;
		if (opacity < 1.0) { 
			var callFadeCategoryImageIn = function() { fadeCategoryImageIn(col, categoryBannerWidth, categoryImages, categoryLinks); };
			landingPageEffectThread = setTimeout(callFadeCategoryImageIn, fadeCategoryImageInSpeed);
		} else {
			var callRunMenuItemsEffect = function() { runMenuItemsEffect((col + 1), 0, categoryBannerWidth, categoryImages, categoryLinks); };
			landingPageEffectThread = setTimeout(callRunMenuItemsEffect, runCategoryImageEffectSpeed);
		}
	}
	
	function runCategoryImageEffec(col, categoryBannerWidth, categoryImages, categoryLinks, lastCol) {
		var offSet = (lastCol ? 0 : 10);
		var contentInfoDiv = document.getElementById('contentInfo');
		if (categoryLinks[col] != "") {
			contentInfoDiv.innerHTML = contentInfoDiv.innerHTML + "<div style='width: " + (categoryBannerWidth + offSet) + "px; height: 350px; float:left;'><a href='" + categoryLinks[col] + "'><img id='menuItem_" + col + "' src='/img/top_nav/empty.gif' width='" + categoryBannerWidth + "' height='350' border='0' style='filter:alpha(opacity=0); -moz-opacity: 0.00; opacity: 0.00;'/></a></div>";
		} else {
			contentInfoDiv.innerHTML = contentInfoDiv.innerHTML + "<div style='width: " + (categoryBannerWidth + offSet) + "px; height: 350px; float:left;'><img id='menuItem_" + col + "' src='/img/top_nav/empty.gif' width='" + categoryBannerWidth + "' height='350' border='0' style='filter:alpha(opacity=0); -moz-opacity: 0.00; opacity: 0.00;'/></div>";
		}
		var currentImage = document.getElementById('menuItem_' + col);
		currentImage.src = categoryImages[col].src;
		fadeCategoryImageIn(col, categoryBannerWidth, categoryImages, categoryLinks);
	}
	
	function runMenuItemsEffect(col, row, categoryBannerWidth, categoryImages, categoryLinks) {

		if ((col == 0) && (row == 0)) {
			clearTimeout(landingPageEffectThread);
		}

		var currentMenuItem = document.getElementById('menuItem_' + col + '_' + row);
		var contentInfoDiv = document.getElementById('contentInfo');
		if ((!currentMenuItem) && (row == 0)) {
			// end
		} else if ((!currentMenuItem) && (row != 0)) {
			var lastCol = ((categoryImages.length -1) == col);
			runCategoryImageEffec(col, categoryBannerWidth, categoryImages, categoryLinks, lastCol);
		} else {
			var nextMenuItem = document.getElementById('menuItem_' + col + '_' + (row + 1));
			if ((!nextMenuItem) && (currentMenuItem.innerHTML.indexOf('VIEW ALL') >= 0)) {
				currentMenuItem.style.color = '#AAAAAA';
			} else {
				/*
				alert(currentMenuItem.style.color);
				if (currentMenuItem.style.color == '#0C0C0C') {
					currentMenuItem.style.color = 'black';
				} else {
					currentMenuItem.style.color = 'black';
				}
				currentMenuItem.style.color = 'blue'';
				*/
			}
			var callRunMenuItemsEffect = function() { runMenuItemsEffect(col, (row + 1), categoryBannerWidth, categoryImages, categoryLinks); };
			landingPageEffectThread = setTimeout(callRunMenuItemsEffect, runMenuItemsEffectSpeed);
		}
	}

	function showCategoryLandingPage(isFullReload, rootCategoryId, rootCategoryName, rootCategoryToken, rootCategoryTemplate) {

		if (!isFullReload) {
			
			// Loads top menu section
			showTopMenu(false);
			
			// Loads categories menu
			showCategoriesMenu(false, rootCategoryId, false);
			
			// Loads footer section
			showFooter('', false);
		    
			var contentInfoDiv = document.getElementById('contentInfo');
			contentInfoDiv.innerHTML = '';
			
			// Loads content section
			var xhrArgs = {
				url: "/ShowDynamicMenuItems.do?runDropDownMenuEffect=true&categoryId=" + rootCategoryId + "&pageFullRefresh=false",
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {

					// Sets page content
					replaceDivContent("breadcrumb", data);

					// Sets page title
					document.title = 'Shopping for ' + rootCategoryName.toUpperCase() + ' at James Perse - Los Angeles';

					runMenuItemsEffect(0, 0, getCategoryBannerWidth(), getCategoryLandingPageImages(), getCategoryLandingPageLinks()); 

	            },
	            error: function(response, ioArgs) {
	            	window.location = ("/" + rootCategoryToken.toLowerCase() + rootCategoryTemplate + "?categoryId=" + rootCategoryId);
	            }
	        };
			dojo.xhrGet(xhrArgs);
			
		} else {
			
			// Sets page title
			document.title = 'Shopping for ' + rootCategoryName.toUpperCase() + ' at James Perse - Los Angeles';
			
			var contentInfoDiv = document.getElementById('contentInfo');
			contentInfoDiv.innerHTML = '';
			
			runMenuItemsEffect(0, 0, getCategoryBannerWidth(), getCategoryLandingPageImages(), getCategoryLandingPageLinks());

		}
	
		var addRocketFuelTags = false; 
		var rocketFuelCode = null;
		//MEN
		if (rootCategoryId == 'cat20002') {
			addRocketFuelTags = true;
			rocketFuelCode = '20473725';
		} else if (rootCategoryId == 'cat20004') {
			addRocketFuelTags = true;
			rocketFuelCode = '20473724';
		}
		
		// Loads partners tags
	    addPartnerTags(true, true, true, "/" + rootCategoryToken.toLowerCase() + rootCategoryTemplate + "?categoryId=" + rootCategoryId, addRocketFuelTags, rocketFuelCode);
		
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Category Page
 ***************************************************************************************/
	var categoryScrolling = false;
	if (objClient.isIE) {
		var categoryScrollDefaultOffset = 5;
		var categoryScrollDelay = 2;
	} else if (objClient.isSafari) {
		var categoryScrollDefaultOffset = 3;
		var categoryScrollDelay = 9;
	} else if (objClient.isMoz) {
		var categoryScrollDefaultOffset = 2;
		var categoryScrollDelay = 8;
	} else {
		var categoryScrollDefaultOffset = 1;
		var categoryScrollDelay = 4;
	}
	
	function showCategoryProductImage(imageIndex) {
		
		var itemDescription = getCategoryProductInfo()[imageIndex][2];
		var itemPrice = getCategoryProductInfo()[imageIndex][3];
		if ((itemPrice != null) && (itemPrice != undefined)) {
			itemDescription = itemDescription + " | " + itemPrice;
		}
		
		var categoryProductImage = document.getElementById('categoryProductImage');
		var categoryProductLink = document.getElementById('categoryProductLink');
		var categoryProductSwatch = document.getElementById('categoryProductSwatch' + imageIndex);
		var categoryProductInfoDiv = document.getElementById('categoryProductInfoDiv');
		categoryProductImage.src = getCategoryProductInfo()[imageIndex][0].src;
		categoryProductLink.href = getCategoryProductInfo()[imageIndex][1];
		categoryPageFloatingProductName = getCategoryProductInfo()[imageIndex][2];
		categoryProductInfoDiv.innerHTML = itemDescription;
		for (i = 0 ; i < getCategoryItemsCount() ; i++) {
			document.getElementById('categoryProductSwatch' + i).className = 'styleScrollOff';
		}
		categoryProductSwatch.className = 'styleScrollOn';
	}
	
	function categoryScrollPictures(offSet) {
		var scrollLeft = document.getElementById('jpChildhoodPictures').scrollLeft + offSet;
		document.getElementById('jpChildhoodPictures').scrollLeft = scrollLeft;
		/*
		if ((offSet > 0) && (document.getElementById('jpChildhoodPictures').scrollLeft < scrollLeft)) {
			document.getElementById('jpChildhoodPictures').innerHTML += document.getElementById('jpChildhoodPictures').innerHTML;
			document.getElementById('jpChildhoodPictures').scrollLeft = scrollLeft;
		} else if ((offSet < 0) && (scrollLeft < 0)) {
			document.getElementById('jpChildhoodPictures').innerHTML += document.getElementById('jpChildhoodPictures').innerHTML;
			document.getElementById('jpChildhoodPictures').scrollLeft = 1054 + offSet;
		}
		*/
	}
	
	function categoryScrollPicturesLeft() {
		if (categoryScrolling) {
			categoryScrollPictures(categoryScrollDefaultOffset*-1);
			setTimeout(categoryScrollPicturesLeft, categoryScrollDelay);
		}
	}
	
	function categoryScrollPicturesRight() {
		if (categoryScrolling) {
			categoryScrollPictures(categoryScrollDefaultOffset*1);
			setTimeout(categoryScrollPicturesRight, categoryScrollDelay);
		}
	}
	
	function categoryScrollWheel(event){
		var delta = event.wheelDelta;
		if (event.detail) {
			delta = event.detail*-1;
		}
		if (event.preventDefault) {
            event.preventDefault();
		}
		if (delta < 0) {
			categoryScrollPictures(categoryScrollDefaultOffset*5);
		} else {
			categoryScrollPictures(categoryScrollDefaultOffset*-5);
		}
		event.returnValue = false;
	}
	
	function showDropDownMenu(rootCategoryId, menuObj) {

		stopHideDropDownMenuCountdown(); 

		var divBreadcrumb = document.getElementById('breadcrumb');
		var dropDownMenuOptions = document.getElementById('dropDownMenuOptions');
		var divDropDownMenuBackground = document.getElementById('dropDownMenuBackground');

		if (dropDownMenuOptions.style.display == 'none') {

			// Loads content section
			var xhrArgs = {
				url: ("/ShowDynamicMenuItems.do?categoryId=" + rootCategoryId),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {

					var changePosition = false;
					if (dropDownMenuOptions.innerHTML == '?') {
						changePosition = true;
					}
						
					// Sets page content
					replaceDivContent("dropDownMenuOptions", data);
					var maxMenuRows = parseInt(document.getElementById('maxMenuRows').innerHTML);

					if (changePosition) {
						var minDropDownMenuHeight = 75;
						var newDropDownMenuHeight;
						var refDiv = divBreadcrumb;
						var curleft = curtop = 0;
						if (refDiv.offsetParent) {
							do {
								curleft += refDiv.offsetLeft;
								curtop += refDiv.offsetTop;
							} while (refDiv = refDiv.offsetParent);
						}
	
						newDropDownMenuHeight = (maxMenuRows * 13)+3
						if (newDropDownMenuHeight < minDropDownMenuHeight) {
							newDropDownMenuHeight = minDropDownMenuHeight;
						}
							
						divDropDownMenuBackground.style.top = curtop;
						divDropDownMenuBackground.style.left = curleft;
						divDropDownMenuBackground.style.width = 1000;
						divDropDownMenuBackground.style.height = newDropDownMenuHeight;
						
						dropDownMenuOptions.style.top = divDropDownMenuBackground.style.top;
						dropDownMenuOptions.style.left = divDropDownMenuBackground.style.left;
						dropDownMenuOptions.style.width = divDropDownMenuBackground.style.width;
						dropDownMenuOptions.style.height = divDropDownMenuBackground.style.height;
					}

					divBreadcrumb.style.display = 'none';
					divDropDownMenuBackground.style.display = 'block';
					dropDownMenuOptions.style.display = 'block';
		
		        }
		    };
			dojo.xhrGet(xhrArgs);
			
		} else {
			
			/*
			dropDownMenuOptions.style.display = 'none';
			divDropDownMenuBackground.style.display = 'none';
			divBreadcrumb.style.display = 'block';
			*/
		}
		
	}
	
	function startHideDropDownMenuCountdown() {
		if (removeDropDownMenuThread == null) {
			removeDropDownMenuThread = setTimeout('hideDropDownMenu()', 1800);
		}
	}
	
	function stopHideDropDownMenuCountdown() {
		clearTimeout(removeDropDownMenuThread);
		removeDropDownMenuThread = null;
	}

	function hideDropDownMenu() {
		
		var divBreadcrumb = document.getElementById('breadcrumb');
		var dropDownMenuOptions = document.getElementById('dropDownMenuOptions');
		var divDropDownMenuBackground = document.getElementById('dropDownMenuBackground');
		
		dropDownMenuOptions.style.display = 'none';
		divDropDownMenuBackground.style.display = 'none';
		divBreadcrumb.style.display = 'block';
		
	}
	
	var isCategoryPageFloatingProductName = false;
	var categoryPageFloatingProductName = "";
	var categoryPageTempX = 0;
	var categoryPageTempY = 0;

	function getMouseXYOnCategoryPage(e) {

		if (objClient.isIE) { // grab the x-y pos.s if browser is IE
			categoryPageTempX = event.clientX + document.body.scrollLeft;
			categoryPageTempY = event.clientY + document.body.scrollTop;
		} else {  // grab the x-y pos.s if browser is NS
			categoryPageTempX = e.pageX;
			categoryPageTempY = e.pageY;
		}  
		// catch possible negative values in NS4
		if (categoryPageTempX < 0){categoryPageTempX = 0;}
		if (categoryPageTempY < 0){categoryPageTempY = 0;}  
		
		var divFloatingProductName = document.getElementById('floatingProductName');
		if (!divFloatingProductName) {
			document.onmousemove = null;
		} else {
			if ((isCategoryPageFloatingProductName) && (categoryPageFloatingProductName != "")) {
				divFloatingProductName.style.left = (categoryPageTempX + 13) + 'px';
				divFloatingProductName.style.top = (categoryPageTempY + 22) + 'px';
				divFloatingProductName.innerHTML = "<table cellpadding='0' cellspacing='0'><tr><td valign='middle' style='font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#000;text-decoration:none;line-height:12px;'>&nbsp;" + categoryPageFloatingProductName + "&nbsp;</td></tr></table>";
				divFloatingProductName.style.display = 'block';
			} else {
				divFloatingProductName.style.display = 'none';
			}
		}
	}
	
	function showCategoryPageFloatingProductName() {
		isCategoryPageFloatingProductName = true;
	}

	function hideCategoryPageFloatingProductName() {
		isCategoryPageFloatingProductName = false;
	}
	
	function showCategoryPage(isFullReload, categoryId, pageLink, categoryName, rootCategoryId, rootCategoryName) {
		
		clearTimeout(landingPageEffectThread);
		
		if (!isFullReload) {
			
			// Loads top menu section
			showTopMenu(false);
			
			// Loads categories menu
			showCategoriesMenu(false, categoryId, true);
			
			// Loads footer section
			showFooter('', false);
		    
			// Loads content section
			var xhrArgs = {
				url: pageLink + "&pageFullRefresh=false",
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {

					// Sets page content
					replaceDivContent("contentInfo", data);

		    		// Loads breadcrumb
					showBreadcrumb(false);
					
					// Sets page title
					//document.title = 'Shopping for ' + rootCategoryName.toUpperCase() + ' at James Perse - Los Angeles';

	            },
	            error: function(response, ioArgs) {
	            	window.location = pageLink;
	            }
	        };
			dojo.xhrGet(xhrArgs);
			
		} else {
			
		}

		try {
			if (!objClient.isIE) {
				document.captureEvents(Event.MOUSEMOVE);
			}
			document.onmousemove = getMouseXYOnCategoryPage;
			categoryPageFloatingProductName = getCategoryProductInfo()[0][2];
		} catch (err) {
		}
		
		// Loads partners tags
	    addPartnerTags(true, true, true, pageLink, false, null);
		
	}
	
/***************************************************************************************/
	
/****************************************************************************************
 * Show Product Page
 ***************************************************************************************/
	var dragObject = null;
	var dragXAnchor = null;
	var dragYAnchor = null;
	var bkpImageUrl = null;
	var zoomImageObj = null;

	function switchProductImage(imageIndex) {
		var productImageObj = document.getElementById('productImage');
		var productImageZoomControl = document.getElementById('productImageZoomControl');
		productImageObj.style.width = 600;
		productImageObj.style.height = 465;
		productImageObj.style.top = 0;
		productImageObj.style.left = 0;
		if ((imageIndex == 1) && (productImageObj.src != imgL2A.src)) {
			productImageObj.src = imgL2A.src;
			zoomImageObj = imgZoom;
	    	try { productImageZoomControl.style.opacity = 1; } catch(err) {}
	    	try { productImageZoomControl.style.MozOpacity = 1; } catch(err) {}
	    	try { productImageZoomControl.style.filter = 'alpha(opacity=100)'; } catch(err) {}
		} else if ((imageIndex == 2) && (productImageObj.src != imgL2B.src)) {
			productImageObj.src = imgL2B.src;
			zoomImageObj = null;
			dragObject = null;
	    	try { productImageZoomControl.style.opacity = 0; } catch(err) {}
	    	try { productImageZoomControl.style.MozOpacity = 0; } catch(err) {}
	    	try { productImageZoomControl.style.filter = 'alpha(opacity=0)'; } catch(err) {}
		} else if ((imageIndex == 3) && (productImageObj.src != imgL2C.src)) {
			productImageObj.src = imgL2C.src;
			zoomImageObj = null;
			dragObject = null;
	    	try { productImageZoomControl.style.opacity = 0; } catch(err) {}
	    	try { productImageZoomControl.style.MozOpacity = 0; } catch(err) {}
	    	try { productImageZoomControl.style.filter = 'alpha(opacity=0)'; } catch(err) {}
		}
		categoryPageFloatingProductName = getProductName();
	}
	
	function productImageZoomIn(obj) {
		if (zoomImageObj != null) {
			if (dragObject == null) {
				dragObject = obj;
				bkpImageUrl = dragObject.src;
				dragObject.src = zoomImageObj.src; 
				var zoomInFunction = 
					function() {
						var currWidth = parseInt(dragObject.style.width.substring(0, dragObject.style.width.length - 2));
						var currHeight = parseInt(dragObject.style.height.substring(0, dragObject.style.height.length - 2));
						var currTop = parseInt(dragObject.style.top.substring(0, dragObject.style.top.length - 2));
						var currLeft = parseInt(dragObject.style.left.substring(0, dragObject.style.left.length - 2));
						if (currWidth < 1800) {
		  					obj.style.width = (currWidth + 40);
		  					obj.style.height = (currHeight + 31);
		  					obj.style.left = (currLeft - 20);
		  					obj.style.top = (currTop - 15);
							setTimeout(zoomInFunction, 1);
						} else {
		  					obj.style.width = 1800;
		  					obj.style.height = 1395;
							obj.style.cursor = 'pointer'; 
							dragXAnchor = null;
							dragYAnchor = null;
							categoryPageFloatingProductName = "";
						}                               
					}; 
				zoomInFunction();
			}
		}
	}

	function productImageZoomOut(obj) {
		if (zoomImageObj != null) {
			if (dragObject != null) {
				var zoomOutFunction = 
	  				function() {
						var currWidth = parseInt(dragObject.style.width.substring(0, dragObject.style.width.length - 2));
						var currTop = parseInt(dragObject.style.top.substring(0, dragObject.style.top.length - 2));
						var currLeft = parseInt(dragObject.style.left.substring(0, dragObject.style.left.length - 2));
	  					obj.style.width = 600;
	  					obj.style.height = 465;
	  					obj.style.top = 0;
	  					obj.style.left = 0;
						dragObject.src = bkpImageUrl;
	   					obj.style.cursor = 'default';
	   					dragObject = null; 
	   					dragXAnchor = null;
	   					dragYAnchor = null;
	   					categoryPageFloatingProductName = getProductName();
	  				}; 
				zoomOutFunction();
			}
		}
	}
	
	function productImageClick(obj) {
		if (zoomImageObj != null) {
			if (dragObject == null) {
				productImageZoomIn(obj);
			} else {
				productImageZoomOut(obj);
			}
		}
	}

	function productImageMouseDown(obj, event) {
		if (dragObject != null) {
			if (dragXAnchor == null) {
				dragXAnchor = event.clientX;
				dragYAnchor = event.clientY;
			}
		}
	}

	function productImageMouseMove(obj, event) {
		if (dragObject != null) {
			if (dragXAnchor != null) {
				var newXCoord = parseInt(obj.style.left.substring(0, obj.style.left.length - 2)) + (event.clientX - dragXAnchor);
				if ((newXCoord >= -1200) && (newXCoord <= 0)) {			
					obj.style.left = newXCoord;
				}
				dragXAnchor = event.clientX;	
				
				var newYCoord = parseInt(obj.style.top.substring(0, obj.style.top.length - 2)) + (event.clientY - dragYAnchor);
				if ((newYCoord >= -930) && (newYCoord <= 0)) {			
					obj.style.top = newYCoord;
				}
				dragYAnchor = event.clientY;
			}
		}
	}

	function productImageMouseUp(obj, event) {
		if (dragObject != null) {
			dragXAnchor = null;
			dragYAnchor = null;
		}
	}
	
	function enlargeView(productId, packCoupon, onlyOnRegularPrice, onlyOnSalePrice, urlTokensContext) {
		openNewMsg('/ShowProductImages.do?productId=' + productId + '&packCoupon=' + packCoupon + '&onlyOnRegularPrice=' + onlyOnRegularPrice + '&onlyOnSalePrice=' + onlyOnSalePrice + '&urlTokensContext=' + urlTokensContext + '&refreshOnClose=true', '680', '750');
	}
	
	/*
	function computeTotalSelected() {
		var i = 0;
		var dropdownIndex;
		var dropdownValue;
		var dropdownSlittedValues;
		var total = 0;
		var productQuantityField = document.getElementById('productQuantity' + i); 
		var totalSelectedField = document.getElementById('totalSelectedField');
		var addpackToBagButton = document.getElementById('addpackToBagButton');
		while (productQuantityField != undefined) {
			dropdownIndex = productQuantityField.selectedIndex;
			dropdownValue = productQuantityField[dropdownIndex].value;
			dropdownSlittedValues = dropdownValue.split('|');
			total = total + parseInt(dropdownSlittedValues[2]);  
			i++;
			productQuantityField = document.getElementById('productQuantity' + i);
		}
		totalSelectedField.innerHTML = total;
		if (total < <c:out value="${ShowProductInfoActionForm.packSize}"/>) {
			totalSelectedField.style.color = '#CC0000';
			addpackToBagButton.disabled = true;
			addpackToBagButton.className = 'iconOff';
		} else {
			totalSelectedField.style.color = '#666666';
			addpackToBagButton.disabled = false;
			addpackToBagButton.className = 'iconOn';
		}
	}

	function showPackSelectorPopup(processForm) {

		document.getElementById("packSelectorForm").processForm.value = processForm;
		
	    dojo.io.bind({
			load: function(type, data, evt){
					var packSelectorPopup = document.getElementById("packSelectorPopup");
					packSelectorPopup.innerHTML = data;
					showErrorMessage('packSelectorPopup', 400, 700);
			},
			formNode: document.getElementById("packSelectorForm")
		});
		
	}

	function showPackSelectorPopupForm() {
		showPackSelectorPopup(false);
	}

	function showPackSelectorPopupSuccess() {
		showPackSelectorPopup(true);
	}

	function submitPackSelectorInfo(processForm) {

		var dropdownIndex = document.getElementById("packProductSize").selectedIndex;
		var selectedSize = document.getElementById("packProductSize")[dropdownIndex].value;  

		if (!processForm) {
			
			document.getElementById("ShowPackSelectorActionForm").selectedSize.value = selectedSize;  
			document.getElementById("ShowPackSelectorActionForm").processForm.value = processForm;
		    dojo.io.bind({
				load: function(type, data, evt){
						var packSelectorPopup = document.getElementById("packSelectorPopup");
						packSelectorPopup.innerHTML = data;
						showErrorMessage('packSelectorPopup', 400, 700);
				},
				formNode: document.getElementById("ShowPackSelectorActionForm")
			});

		} else {

			document.getElementById("addPackToCart").selectedSize.value = selectedSize;  
			document.getElementById("addPackToCart").processForm.value = processForm;
			
			var i = 0;
			var dropdownIndex;
			var dropdownValue;
			var dropdownSlittedValues;
			var total = 0;
			var productQuantityField = document.getElementById('productQuantity' + i); 

			while (productQuantityField != undefined) {
				dropdownIndex = productQuantityField.selectedIndex;
				dropdownValue = productQuantityField[dropdownIndex].value;
				dropdownSlittedValues = dropdownValue.split('|');
				document.getElementById('packItemQuantity' + i).value = parseInt(dropdownSlittedValues[2]);  
				i++;
				productQuantityField = document.getElementById('productQuantity' + i);
			}
			
	    	document.getElementById('atgAddPackToBagBtn').click();

		}

	}
	*/

	function checkMaxTextareaLenght(textarea, maxLenght){
		var total = parseInt(textarea.value.length);
		var ycount = maxLenght - total;
		if( ycount < 0 ){
			alert("Message field can only have up to " + maxLenght + " characters.");
			var text = textarea.value;
			textarea.value = text.substring(0, maxLenght); 
		}
	}   
	
	function refreshProductPageContent(primaryProductId, primaryProductSelectedColor) {
		if ((document.getElementById('addPrimaryProductToBagButton') != undefined) && (document.getElementById('addPrimaryProductToBagButton') != null)) {		
	    	var addPrimaryProductToBagButton = document.getElementById('addPrimaryProductToBagButton');
	    	addPrimaryProductToBagButton.href = "javascript:return;";
		}
		var refreshContentForm = document.getElementById('refreshContentForm');
		var primaryProductForm = document.getElementById('primaryProductForm');
		refreshContentForm.productId.value = primaryProductId;
		refreshContentForm.selectedColor.value = primaryProductSelectedColor;
		if (primaryProductForm.primaryProductSelectedSize != undefined) {
			refreshContentForm.primaryProductSelectedSize.value = primaryProductForm.primaryProductSelectedSize.value;
		}
		if (primaryProductForm.primaryProductSelectedQuantity != undefined) {
			refreshContentForm.primaryProductSelectedQuantity.value = primaryProductForm.primaryProductSelectedQuantity.value;
		}
		var tempSelectedLookComponentsIndex = 0;
		while (document.getElementById('tempSelectedLookComponentsIds' + tempSelectedLookComponentsIndex) != undefined) {
			document.getElementById('selectedLookComponentsIds' + tempSelectedLookComponentsIndex).value = document.getElementById('tempSelectedLookComponentsIds' + tempSelectedLookComponentsIndex).value;
			document.getElementById('selectedLookComponentsSizes' + tempSelectedLookComponentsIndex).value = document.getElementById('tempSelectedLookComponentsSizes' + tempSelectedLookComponentsIndex).value;
			tempSelectedLookComponentsIndex++; 
		}
		var xhrArgs = {
			form: document.getElementById("refreshContentForm"),
            handleAs: "text",
            preventCache: true,
            load: function(data) {
				// Sets page content
				replaceDivContent("contentInfo", data);
				gapi.plusone.go();
				setGooglePlusOneEvents();
            }
        };
		dojo.xhrPost(xhrArgs);
	}

	function showSizeChart(param){
	    window.open(param, 'SizeChart', 'width=590,height=780,status=1,toolbar=0,menubar=0,scrollbars=1,resizable=1');
	}

	function showMustLoginToAddToWishListMsg() {
		showErrorMessage('mustLoginToAddToWishListMsg', 300, 300);
	}

	function showWishListSizeExceedMsg() {
		showErrorMessage('wishListSizeExceedMsg', 300, 270);
	}	

	function printProductPage(producId, skuId, colorId) {
		var popUrl = '/browse/product/print/print_productdetails.jsp?productId='+producId+'&skuId='+skuId+'&selectedColor='+colorId;
		openNewMsg(popUrl, '720','845');
	}

	function showDontSeeYourSizeMsg() {
		showErrorMessage('dontSeeYourSize', 500, 600);
	}

	function showSizeNotificationForm(productId) {
		var dontSeeYourSizeForm = document.getElementById("dontSeeYourSizeForm");
		dontSeeYourSizeForm.userAction.value = 'SHOWING_SIZE_NOTIFICATION';
		dontSeeYourSizeForm.productId.value = productId;
		var xhrArgs = {
			form: dontSeeYourSizeForm,
            handleAs: "text",
            preventCache: true,
            load: function(data) {
				// Sets page content
				replaceDivContent("dontSeeYourSize", data);
				showErrorMessage('dontSeeYourSize', 500, 600);
            }
        };
		dojo.xhrPost(xhrArgs);
	}
	
	function addPrimaryProductToBag() {
		var primaryProductForm = document.getElementById('primaryProductForm');
		if (primaryProductForm.primaryProductSelectedSku.value == '') { 
			showErrorMessage('addToBagSelectSizeMsg', 300, 300);
		} else {
			var addToCartQuantityField = document.getElementById('atgAddToCartQuantity');
			var atgAddItemToOrderSuccessURLField = document.getElementById('atgAddItemToOrderSuccessURL');
			var atgRemoveAndAddItemToOrderSuccessURLField = document.getElementById('atgRemoveAndAddItemToOrderSuccessURL');
			var addToCartATGBtn = document.getElementById('atgAddToBagBtn');
			var primaryProductSelectedQuantityValue = primaryProductForm.primaryProductSelectedQuantity.value; 
			addToCartQuantityField.value = primaryProductSelectedQuantityValue;
			atgAddItemToOrderSuccessURLField.value = atgAddItemToOrderSuccessURLField.value + primaryProductSelectedQuantityValue;
			atgRemoveAndAddItemToOrderSuccessURLField.value = atgRemoveAndAddItemToOrderSuccessURLField.value + primaryProductSelectedQuantityValue;
			addToCartATGBtn.click();
		}
	}	

	function addItemToWishList() {
		var primaryProductForm = document.getElementById('primaryProductForm');
		if (primaryProductForm.primaryProductSelectedSku.value == '') { 
			showErrorMessage('addToWishListSelectSizeMsg', 300, 300);
		} else {
			var addToWishListQuantityField = document.getElementById('atgAddToWishListQuantity');
			var primaryProductSelectedQuantityValue = primaryProductForm.primaryProductSelectedQuantity.value;
			addToWishListQuantityField.value = primaryProductSelectedQuantityValue;
			var xhrArgs = {
					form: document.getElementById("wishListForm"),
		            handleAs: "text",
		            preventCache: true,
		            load: function(data) {
						// Sets page content
						replaceDivContent("contentInfo", data);
						showErrorMessage('addToBagSuccessMsg', 280, 300);
		            }
		        };
			dojo.xhrPost(xhrArgs);
		}
	}

	function addSizeNotification() {

		var dontSeeYourSizeForm = document.getElementById('dontSeeYourSizeForm');
		var dontSeeYourSizeFormTemp = document.getElementById('dontSeeYourSizeFormTemp');

		dontSeeYourSizeForm.userAction.value = 'ADDING_SIZE_NOTIFICATION';
		dontSeeYourSizeForm.sizeInStockNotificationSku.value = dontSeeYourSizeFormTemp.sizeInStockNotificationSku[dontSeeYourSizeFormTemp.sizeInStockNotificationSku.selectedIndex].value;
		dontSeeYourSizeForm.sizeInStockNotificationEmail.value = dontSeeYourSizeFormTemp.sizeInStockNotificationEmail.value;

		var xhrArgs = {
				form: document.getElementById("dontSeeYourSizeForm"),
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {
					// Sets page content
					replaceDivContent("dontSeeYourSize", data);
	            }
	        };
		dojo.xhrPost(xhrArgs);
	}

    function emailFriend(productId, skuId){
		ajaxWinParams = "productId="+productId+"&skuId="+skuId;
    	ajaxFuncName ="emailFriend";
		ajaxWinOPen = "true";
        var name = "Email a Friend ";
		var params = null;
		ajaxCallMakeRequest('/browse/product/gadgets/emailAFriend.jsp?productId='+productId+'&skuId='+skuId, params, efm, null, 'text/plain', null);
    }
    
	function showAddedItem(skuId, quantity) {
		var cartUrl = "/browse/product/add_to_bag_confirm.jsp?skuId=" + skuId + "&quantity=" + quantity;
		if (objInlineCart.isOpen){
			objInlineCart.closeInlineCart(false);
		}
		var xhrArgs = {
			url: cartUrl,
			handleAs: "text",
	        preventCache: true,
	        load: function(data) {
				// Sets page content
				objInlineCart.setInlineCartData(data);
		        objInlineCart.doOpenBag = true;
		        objInlineCart.openInlineCart(false);
			}
		};
		dojo.xhrGet(xhrArgs);
	}

	function showAddedLook(productId) {
		var cartUrl = "/browse/product/add_look_to_bag_confirm.jsp?productId=" + productId;
		if (objInlineCart.isOpen){
			objInlineCart.closeInlineCart(false);
		}
		var xhrArgs = {
			url: cartUrl,
			handleAs: "text",
	        preventCache: true,
	        load: function(data) {
				// Sets page content
				objInlineCart.setInlineCartData(data);
		        objInlineCart.doOpenBag = true;
		        objInlineCart.openInlineCart(false);
			}
		};
		dojo.xhrGet(xhrArgs);
	}
	
	function showFabricColors(productId, onlyOnRegularPrice, onlyOnSalePrice) {
		var xhrArgs = {
			url: ("/showFabricColors.do?productId=" + productId + "&onlyOnRegularPrice=" + onlyOnRegularPrice + "&onlyOnSalePrice=" + onlyOnSalePrice),
			handleAs: "text",
	        preventCache: true,
	        load: function(data) {
				// Sets page content
				replaceDivContent("productDetailedInfo", data);
			}
		};
		dojo.xhrGet(xhrArgs);
	}
	
	function closeFabricColorsOverlay(productId, selectedColor) {
		var refreshContentForm = document.getElementById('refreshContentForm');
		refreshContentForm.productId.value = productId;
		refreshContentForm.selectedColor.value = selectedColor;
		var xhrArgs = {
				form: refreshContentForm,
				handleAs: "text",
		        preventCache: true,
		        load: function(data) {
					// Sets page content
					replaceDivContent("contentInfo", data);
				}
			};
		dojo.xhrGet(xhrArgs);
	}
	
	function showProductPage(isFullReload, productId, pageLink, productName, styleId, rootCategoryId, rootCategoryName) {
		
		clearTimeout(landingPageEffectThread);
		
		if (!isFullReload) {
			
			// Loads top menu section
			showTopMenu(false);
			
			// Loads categories menu
			//showCategoriesMenu(false, categoryId, true);
			
			// Loads footer section
			//showFooter('', false);
		    
			// Loads content section
			var xhrArgs = {
				url: pageLink + "&pageFullRefresh=false",
	            handleAs: "text",
	            preventCache: true,
	            load: function(data) {

					// Sets page content
					replaceDivContent("contentInfo", data);

		    		// Loads breadcrumb
					showBreadcrumb(false);
					
					// Sets page title
					//document.title = 'Shopping for ' + rootCategoryName.toUpperCase() + ' at James Perse - Los Angeles';

	            },
	            error: function(response, ioArgs) {
	            	window.location = pageLink;
	            }
	        };
			dojo.xhrGet(xhrArgs);
			
		} else {
			
		}

		if (!objClient.isIE) {
			document.captureEvents(Event.MOUSEMOVE);
		}
		document.onmousemove = getMouseXYOnCategoryPage;
		categoryPageFloatingProductName = getProductName();
		
		// Loads partners tags
	    addPartnerTags(true, true, true, pageLink, false, null);
		
	}
/***************************************************************************************/

/****************************************************************************************
 * Show Shopping Bag Page
 ***************************************************************************************/
	function wishListLoginMsg(){
		alert("Please sign in to save an item to your wish list");
	}
	
	function printShoppingBag(){
		browser = navigator.appName;
		ie = "Microsoft Internet Explorer";
		netscape = "Netscape";
		var printWinSize = "";
		if (browser == netscape) {
			printWinSize = "675";
		} else  {
			printWinSize = "685";
		}
		newwindow = window.open( 'printbag.jsp', 'PrintPage', 'width='+printWinSize+',height=800,status=yes,toolbar=no,menubar=no,scrollbars=1');
		newwindow.focus();
	}
	
	function submitCoupon() {
		document.applycoupon.submit();
	}

	function showInternationalOrderInfo() {
		newwindow = window.open('/InternationalOrderingInfoPopup.do', 'InternationalOrderingInfo', 'width=550px,height=600,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1');
		newwindow.focus();
	}

	function validateStore() {
		csStore = document.getElementById('csStore');
		if (csStore) {
			if (csStore.value == '') {
				alert('You must select a store.');
				csStore.focus();
				return false;
			}
		}
		window.location = '/checkout/shippingAndBilling.do';
	}

	function fun(){					
		document.update.shipping.value=document.cartform.ship.value;
		document.update.submit();
	}
	
	function save2list(skuid,productId,quantity,commerceItem){					
		document.listform.skuid.value=skuid;
		document.listform.productId.value=productId;
		document.listform.quantity.value=quantity;
		document.listform.itemId.value=commerceItem;
		setTimeout('ajaxSubmitForm(\'listform\',\'ajaxPopUp\')',500);
	}
	
	function showShoppingBagPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/checkout/shoppingbag.jsp", true, '20474107');
	}	
/***************************************************************************************/

/****************************************************************************************
 * Show Checkout Sign In Page
 ***************************************************************************************/
	function showCheckoutSignInPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, true, "/checkout/signin.jsp", false, null);
	}	
/***************************************************************************************/
	
/****************************************************************************************
 * Show Checkout Shipping And Billing Page
 ***************************************************************************************/
	function switchDiv(the_div,the_change) {
		var the_style = getStyleObject(the_div);
		if (the_style != false) {
			the_style.display = the_change;
		}
	}

	function dispalyBiling(section) {
		if (section == "do"){
			switchDiv("billing_address","block");
			switchDiv("shipping_submit","none");
		} else if (section == "dont"){
			switchDiv("billing_address","none");
			switchDiv("shipping_submit","block");
		}
	}

	function concatShippingPhoneNumber() {
		if ((document.newshippinggroupform.shippingAreaCode.value.length > 0) && 
		    (document.newshippinggroupform.shippingPhone.value.length > 0)) {
			document.newshippinggroupform.shippingPhoneNumber.value = document.newshippinggroupform.shippingAreaCode.value + '-' + document.newshippinggroupform.shippingPhone.value;
			if (document.newshippinggroupform.shippingExtension.value.length > 0) {
				document.newshippinggroupform.shippingPhoneNumber.value = document.newshippinggroupform.shippingPhoneNumber.value + '-' + document.newshippinggroupform.shippingExtension.value;
			}
		} else {
			document.newshippinggroupform.shippingPhoneNumber.value = "";
		}
	}

	function concatBillingPhoneNumber() {
		if ((document.newshippinggroupform.billingAreaCode.value.length > 0) && 
			(document.newshippinggroupform.billingPhone.value.length > 0)) {
			document.newshippinggroupform.billingPhoneNumber.value = document.newshippinggroupform.billingAreaCode.value + '-' + document.newshippinggroupform.billingPhone.value;
			if (document.newshippinggroupform.billingExtension.value.length > 0) {
				document.newshippinggroupform.billingPhoneNumber.value = document.newshippinggroupform.billingPhoneNumber.value + '-' + document.newshippinggroupform.billingExtension.value
			}
		} else {
			document.newshippinggroupform.billingPhoneNumber.value = "";
		}
		concatShippingPhoneNumber();
	}

	function shopBillingForm(radioValue){
		concatShippingPhoneNumber();
		document.newshippinggroupform.showBillingForm.value=radioValue;
		document.newshippinggroupform.billingChecked.value=radioValue;
		document.newshippinggroupform.billingRadioSelected.value="true";
		document.newshippinggroupform.submit();
	}

	function showShippingForm(){
		if (document.newshippinggroupform.selectedshippingGrpName.value == 'newAddress') {
			document.getElementById('showShipForm').style.display = 'block';
		} else {
			document.getElementById('showShipForm').style.display = 'none';
		}
	}

	function showtheBillForm() {
		if(document.newshippinggroupform.selectedBillAddress.value == 'NEW'){
			document.getElementById('showBillForm').style.display = 'block';
		} else {
			document.getElementById('showBillForm').style.display = 'none';
		}
	}
	
	function showCheckoutShippingAndBillingPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/checkout/shippingAndBilling.jsp", false, null);
	}	
/***************************************************************************************/

/****************************************************************************************
 * Show Checkout Gift Message Page
 ***************************************************************************************/
	function showCheckoutGiftMessagePage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/checkout/gift_message.jsp", false, null);
	}	
/***************************************************************************************/
	
/****************************************************************************************
 * Show Checkout Confirm Order Page
 ***************************************************************************************/
	function showCCFormFields() {
		if (document.confirmOrder.storedCardSelection.value == 'NEW') {
			document.getElementById('showCCForm').style.display = 'block';
		} else {
			document.getElementById('showCCForm').style.display = 'none';
		}
	}
	
	function showCheckoutConfirmOrderPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/checkout/confirm_order.jsp", false, null);
	}		
/***************************************************************************************/
	
/****************************************************************************************
 * Show Checkout Thank You Page
 ***************************************************************************************/
	function printConfirmation(){
		browser = navigator.appName;
		ie = "Microsoft Internet Explorer";
		netscape = "Netscape";
		var printWinSize = "";
		if (browser == netscape) {
			printWinSize = "650";
		} else  {
			printWinSize = "680";
		}
		newwindow = window.open( '/checkout/thank_you_print.jsp', 'PrintPage', 'width='+printWinSize+',height=700,status=yes,toolbar=no,menubar=no,scrollbars=1');
		newwindow.focus();
	 }
	
	function showCheckoutThankYouPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(false, true, true, "/checkout/thank_you.jsp", false, null);
	}		
/***************************************************************************************/
	
/****************************************************************************************
 * Show Wish List Sign In Page
 ***************************************************************************************/
	function showWishListSignInPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/wish_list_signin.jsp", false, null);
	}		
/***************************************************************************************/
	
/****************************************************************************************
 * Show Wish List Page
 ***************************************************************************************/
	function printWishList(){
		newwindow = window.open( '/account/printWishList.jsp', 'PrintPage', 'width=720,height=845,status=yes,toolbar=no,menubar=no,scrollbars=1');
		newwindow.focus();
	}
	function addFromWishList2Cart(skuid,productId,quantity){					
		document.add2cart.skuId.value=skuid;
		document.add2cart.productId.value=productId;
		document.add2cart.quantity.value=quantity;
		getAjaxPopupDivStyle('esrb', ' ');
		setTimeout('ajaxSubmitForm(\'add2cart\',\'ajaxPopUp\')',500);
	}		
	function addAllFromWishList2Cart(){					
		getAjaxPopupDivStyle('esrb', ' ');
		setTimeout('ajaxSubmitForm(\'addAll2Cart\',\'ajaxPopUp\')',500);
	}
	function showWishListPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/wish_list.jsp", false, null);
	}		
/***************************************************************************************/
	
/****************************************************************************************
 * Show Account Sign In Page
 ***************************************************************************************/
	function showAccountSignInPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/signin.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Register Page
 ***************************************************************************************/
	function showAccountRegisterPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/register.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Your Account Page
 ***************************************************************************************/
	function showAccountYourAccountPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/view_profile.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Billing Info Page
 ***************************************************************************************/
	function showAccountBillingInfoPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/billing.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Payment Info Page
 ***************************************************************************************/
	function showAccountPaymentInfoPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/payment_info.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Shipping Info Page
 ***************************************************************************************/
	function showAccountShippingInfoPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/shipping_book.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Email Preferences Page
 ***************************************************************************************/
	function showAccountEmailPreferencesPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/email_preferences.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Email Preferences Page
 ***************************************************************************************/
	function showAccountChangePasswordPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/change_password.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Order History Page
 ***************************************************************************************/
	function printOrderReceipt(orderId) {
		browser = navigator.appName;
		ie = "Microsoft Internet Explorer";
		netscape = "Netscape";
		var printWinSize = "";
		if (browser == netscape) {
			printWinSize = "650";
		} else  {
			printWinSize = "680";
		}
		newwindow = window.open( '/account/order_print.jsp?orderId='+orderId, 'PrintPage', 'width='+printWinSize+',height=700,status=yes,toolbar=no,menubar=no,scrollbars=1');
		newwindow.focus();
	}

	function showAccountOrderHistoryPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/order_history.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Account Order Details Page
 ***************************************************************************************/
	function showAccountOrderDetailsPage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/account/order_detail.jsp", false, null);
	}		
/***************************************************************************************/

/****************************************************************************************
 * Show Contacts Subscribe Page
 ***************************************************************************************/
	function showContactsSubscribePage(isFullReload) {
		// Loads partners tags
	    addPartnerTags(true, true, true, "/contacts/subscribe_form.jsp", false, null);
	}		
/***************************************************************************************/

