﻿	// Find the section the user is viewing based on the url
	myURL = window.location.href.split("/"); 
	FolderSection = myURL.length-2; 
	Section = (myURL[FolderSection].toString().toLowerCase());
	// end
	
	//get language -- chunk after third slash (http://server/lang/remainderofpath)
	currentLang = myURL[3];

	// Mouse over script
    browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
    if ((browserName == "Netscape" && browserVer >= 3) || (browserName == "Microsoft Internet Explorer" && browserVer >=4)) 
        browserOK = "yes";
    else
        browserOK = "no";
                      
    if (browserOK == "yes") {
		
		productsOFF = new Image;
		productsON = new Image;
		collectionsOFF = new Image;
		collectionsON = new Image;
		looksOFF = new Image;
		looksON = new Image;
		eddieOFF = new Image;
		eddieON = new Image;
		picksOFF = new Image;
		picksON = new Image;
		extrasOFF = new Image;
		extrasON = new Image;
		facebookOFF = new Image;
		facebookON = new Image;
		whereOFF = new Image;
		whereON = new Image;
		businessOFF = new Image;
		businessON = new Image;
		
		productsOFF.src = "/" + currentLang + "/images/productsOFF.gif";
		productsON.src = "/" + currentLang + "/images/productsON.gif";
		collectionsOFF.src = "/" + currentLang + "/images/collectionsOFF.gif";
		collectionsON.src = "/" + currentLang + "/images/collectionsON.gif";
		looksOFF.src = "/" + currentLang + "/images/looksOFF.gif";
		looksON.src = "/" + currentLang + "/images/looksON.gif";
		eddieOFF.src = "/" + currentLang + "/images/eddieOFF.gif";
		eddieON.src = "/" + currentLang + "/images/eddieON.gif";
		picksOFF.src = "/" + currentLang + "/images/picksOFF.gif";
		picksON.src = "/" + currentLang + "/images/picksON.gif";
		extrasOFF.src = "/" + currentLang + "/images/extrasOFF.gif";
		extrasON.src = "/" + currentLang + "/images/extrasON.gif";
		whereOFF.src = "/" + currentLang + "/images/wheretobuyOFF.gif";
		whereON.src = "/" + currentLang + "/images/wheretobuyON.gif";
		facebookOFF.src = "/" + currentLang + "/images/facebook.gif";
		facebookON.src = "/" + currentLang + "/images/facebook.gif";
		businessOFF.src = "/" + currentLang + "/images/businessopportunitiesOFF.gif";
		businessON.src = "/" + currentLang + "/images/businessopportunitiesON.gif";
        }

    function imageOff(imgName) {
        if (browserOK == "yes") {
            imgOff = eval(imgName + "OFF.src");
            document[imgName].src = imgOff;
        }
    }

    function imageOn(imgName) {
        if (browserOK == "yes") {
            imgOn = eval(imgName + "ON.src");
            document[imgName].src = imgOn;
        }
    }
	// end



	//function to write out the top navigational menu with selected item highlighted (if applicable) and mouseovers in place
	function renderMenu(lang) {
	    switch (lang) 
	    {
	         case "ja-jp":
	        	tableWidth="321";           //Main nav table width
	        	Height = "16";              //Height of all nav images
	            productsWidth = "70";       //Products image width
	            collectionsWidth = "91";   //collections image width
	            looksWidth = "70";          //looks image width
	            eddieWidth = "59";          //eddie  image width
	            picksWidth = "119";         //eddies picks  image width
	            extrasWidth = "68";         //extras image width
	        break;
	        case "de-de":
	        	tableWidth="321";           //Main nav table width
	        	Height = "16";              //Height of all nav images
	            productsWidth = "81";       //Products image width
	            collectionsWidth = "120";   //collections image width
	            looksWidth = "67";          //looks image width
	            eddieWidth = "61";          //eddie  image width
	            picksWidth = "135";         //eddies picks  image width
	            extrasWidth = "63";         //extras image width
	        break;
	        case "en":
	        	tableWidth="321";           //Main nav table width
	        	Height = "21";              //Height of all nav images
	            productsWidth = "85";       //Products image width
	            collectionsWidth = "107";   //collections image width
	            looksWidth = "68";          //looks image width
	            eddieWidth = "61";          //eddie  image width
	            picksWidth = "114";         //eddies picks  image width
	            extrasWidth = "61";         //extras image width
	        break;
	    	case "it-it":
	        	tableWidth="321";           //Main nav table width
	        	Height = "16";              //Height of all nav images
	            productsWidth = "76";       //Products image width
	            collectionsWidth = "102";   //collections image width
	            looksWidth = "62";          //looks image width
	            eddieWidth = "65";          //eddie  image width
	            picksWidth = "156";         //eddies picks  image width
	            extrasWidth = "55";         //extras image width   
	        break;
	        case "ko":
	        	tableWidth="321";           //Main nav table width
	        	Height = "16";              //Height of all nav images
	            productsWidth = "49";       //Products image width
	            collectionsWidth = "81";   //collections image width
	            looksWidth = "45";          //looks image width
	            eddieWidth = "65";          //eddie  image width
	            picksWidth = "128";         //eddies picks  image width
	            extrasWidth = "64";         //extras image width
	        break;
	        case "zh-tw":
	           	tableWidth="321";           //Main nav table width
	        	Height = "16";              //Height of all nav images
	            productsWidth = "50";       //Products image width
	            collectionsWidth = "101";   //collections image width
	            looksWidth = "101";          //looks image width
	            eddieWidth = "65";          //eddie  image width
	            picksWidth = "110";         //eddies picks  image width
	            extrasWidth = "86";         //extras image width
	        break;
	    }
	        
	    document.write("<table width=\"" + tableWidth + "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	    document.write("<tr>");
		
	    if (Section == "products") {document.write("<td><a href=\"/" + lang + "/products/default.aspx\"><img src=\"/" + lang + "/images/productsON.gif\" alt=\"" + L_productsAlt + "\" width=\"" + productsWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/products/default.aspx\" onmouseover=\"imageOn('products')\" onmouseout=\"imageOff('products')\"><img src=\"/" + lang + "/images/productsOFF.gif\" alt=\"" + L_productsAlt + "\" width=\"" + productsWidth + "\" height=\"" + Height + "\" border=\"0\" name=\"products\" /></a></td>");}
				
	    if (Section == "collections") {document.write("<td><a href=\"/" + lang + "/collections/default.aspx\"><img src=\"/" + lang + "/images/collectionsON.gif\" alt=\"" + L_collectionsAlt + "\" width=\"" + collectionsWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/collections/default.aspx\" onmouseover=\"imageOn('collections')\" onmouseout=\"imageOff('collections')\"><img src=\"/" + lang + "/images/collectionsOFF.gif\" alt=\"" + L_collectionsAlt + "\" name=\"collections\" width=\"" + collectionsWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
				
	    if (Section == "looks") {document.write("<td><a href=\"/" + lang + "/looks/default.aspx\"><img src=\"/" + lang + "/images/looksON.gif\" alt=\"" + L_looksAlt + "\" width=\"" + looksWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/looks/default.aspx\" onmouseover=\"imageOn('looks')\" onmouseout=\"imageOff('looks')\"><img src=\"/" + lang + "/images/looksOFF.gif\" alt=\"" + L_looksAlt + "\" name=\"looks\" width=\"" + looksWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
				
	    if (Section == "eddie") {document.write("<td><a href=\"/" + lang + "/eddie/default.aspx\"><img src=\"/" + lang + "/images/eddieON.gif\" alt=\"" + L_eddieAlt + "\" width=\"" + eddieWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/eddie/default.aspx\" onmouseover=\"imageOn('eddie')\" onmouseout=\"imageOff('eddie')\"><img src=\"/" + lang + "/images/eddieOFF.gif\" alt=\"" + L_eddieAlt + "\" name=\"eddie\" width=\"" + eddieWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
				
	    if (Section == "picks") {document.write("<td><a href=\"/" + lang + "/picks/eddie-picks.aspx\"><img src=\"/" + lang + "/images/picksON.gif\" alt=\"" + L_picksAlt + "\" width=\"" + picksWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/picks/eddie-picks.aspx\" onmouseover=\"imageOn('picks')\" onmouseout=\"imageOff('picks')\"><img src=\"/" + lang + "/images/picksOFF.gif\" alt=\"" + L_picksAlt + "\" name=\"picks\" width=\"" + picksWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
				
	    if (Section == "extras") {document.write("<td><a href=\"/" + lang + "/extras/default.aspx\"><img src=\"/" + lang + "/images/extrasON.gif\" alt=\"" + L_extrasAlt + "\" width=\"" + extrasWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}
	    else {document.write("<td><a href=\"/" + lang + "/extras/default.aspx\" onmouseover=\"imageOn('extras')\" onmouseout=\"imageOff('extras')\"><img src=\"/" + lang + "/images/extrasOFF.gif\" alt=\"" + L_extrasAlt + "\" name=\"extras\" width=\"" + extrasWidth + "\" height=\"" + Height + "\" border=\"0\" /></a></td>");}

		document.write("</tr>");
		document.write("</table>");
	}

	//general pop window function
	function popWin(deeURL, namen, w, h) 
	{
		var newWin = window.open( deeURL, namen, "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",resizable=yes" );
		newWin.focus();
		newWin.visibility = "visible";
		window.status = "";
		return true;
	}