	top.name = "offerPage";

	var hasNS = false;
	var myPos = navigator.appVersion.indexOf("(");
	var myVersion = navigator.appVersion.substring(0,myPos);
	var strCustID = "";
	var priceWindow;

	if ( navigator.appName.indexOf("Netscape") != -1 )
		hasNS = true;

	if ( myVersion.valueOf() < 4 ) {
		alert ("This site was designed for version 4 or higher browsers")
		window.location = "/default.asp"
	}

	strCustID = getCookie("CRLID");

	if ( strCustID == null ) {
		strCustID = "";
	}

	if ( strCustID.length < 3 ) {
		strCustID = "";
	} else {
		if ( strCustID.charAt(0) == "-" ) {
			strCustID = "";
		}
		if ( strCustID.charAt(1) == "-" ) {
			strCustID = "";
		}
	}

//*******************************************************************************************************************
function doAlertCommon()
{
    alert("doAlert commontemplate");
}

//*******************************************************************************************************************
	function goBack() {
		history.back();
	}

//*******************************************************************************************************************
	function setLayers() {
		hideAll(hasNS);

		showOneLayer("lyrPriceLink1", hasNS);
//Removed by CKIM 082010		showOneLayer("lyrPriceLink2", hasNS);

		if ( strCustID != "" ) {
			var myMSDS = document.MainForm.hdnMSDS.value;
			var mySDS = document.MainForm.hdnSpecData.value;
			var NULL_DOC = "0000000";

			showOneLayer("lyrCustNav", hasNS);

			if ( myMSDS != null && myMSDS != "" && myMSDS != NULL_DOC ) {
				showOneLayer("lyrMSDS", hasNS);
			}

			if ( mySDS != null && mySDS != "" && mySDS != NULL_DOC ) {
				showOneLayer("lyrSpecData", hasNS);
			}
		}
		//Added by CKIM 092010
		var myTechDocs = document.MainForm.hdnTechDocs.value;
		var NULL_DOC = "0000000";
		if ( myTechDocs != null && myTechDocs != "" && myTechDocs != NULL_DOC ) {
			showOneLayer("lyrTechDocs", hasNS);
		}

		window.scroll(1,1);
	}

//*******************************************************************************************************************
	function selURL(mySelect) {
		var strRedir;

		switch ( mySelect[mySelect.selectedIndex].value ) {
			default:
				alert ( "Quick Link Redirect" );
		}
	}
//*******************************************************************************************************************
	function showPricingWindow(){
		var browserType = navigator.userAgent.toLowerCase();
		var myProduct = document.MainForm.hdnProduct.value;
		var myProductID = document.MainForm.hdnProductID.value;
		var strRedir;
		var w_Top = 0;
		var w_Left = 0;



		if ( myProduct != null && myProduct != "" ) {
			var strLoc = window.location.toString();

			if ( myProductID == null ) {
				myProductID = "0";
			}

	        strRedir = "/apps/order/showPricing.asp?ProductID=" + myProductID + "&Product=" + myProduct;
			if (browserType.indexOf('msie') != -1) {
				w_Top = (screen.availheight-400) / 2;
				w_Left = (screen.availwidth-600) / 2;
				priceWindow = window.open ( strRedir,"PriceWindow","left=" + w_Left + ",top=" + w_Top + ",scrollbars=yes,width=600,height=540,resizable=yes" );
			} else {
				priceWindow = window.open ( strRedir,"PriceWindow","left=100,top=86,scrollbars=yes,width=600,height=540,resizable=yes" );
			}
		}
	}


//*******************************************************************************************************************
	function showPricing() {
		if (priceWindow && !priceWindow.closed){
			priceWindow.close();
		}

		showPricingWindow();
	}

//*******************************************************************************************************************
	function focusNewProduct(myProductID, myProduct, myGroupID) {
		var strRedir = "";

		if ( myProduct != null && myProduct != "" && myProductID != null && myProductID != "" ) {
			var strLoc = window.location.toString();

			if ( strLoc.indexOf("8080") > -1 || strLoc.indexOf("intranet") > -1 || strLoc.indexOf("Page=temp") > -1) {
				if (strLoc.indexOf("www") > -1) {
					strRedir = "http://intranet.crlaurence.com/apps/internet/preview/previewLine.asp?GroupID=" + myGroupID + "&Product=" + myProduct + "&ProductID=" + myProductID + "&Test=True"
				} else {
					strRedir = "http://devweb.crlaurence.com:8080/apps/internet/preview/previewLine.asp?GroupID=" + myGroupID + "&Product=" + myProduct + "&ProductID=" + myProductID + "&Test=True"
				}

			} else {
				strRedir = "/ProductPages/pagegen.asp?GroupID=" + myGroupID + "&Product=" + myProduct + "&ProductID=" + myProductID + "&Test=False"
			}

			window.open (strRedir,"_top");
		}

	}

//*******************************************************************************************************************
	function showACProducts(myACCode) {
		var strRedir = "/apps/showACProducts.asp?ACCode=" + myACCode;

		if ( myACCode != null && myACCode != "" ) {
		}
	}

//*******************************************************************************************************************
	function addDocs(myType) {
		var myProduct = document.MainForm.hdnProduct.value;
		var myDocNum;
		var strRedir;
		var NULL_DOC = "0000000";

		if ( strCustID != null && strCustID != "" )
		{
			switch ( myType ) {
				case "MSDS":
					myDocNum = document.MainForm.hdnMSDS.value;
					break;

				case "SpecData":
					myDocNum  = document.MainForm.hdnSpecData.value;
					break;
			}
			if (myType == "SpecData") {
				strRedir = "/DataSheets/SpecData/" + document.MainForm.hdnSpecData.value;
				window.open( strRedir, "DocWindow", "location=no,toolbar=yes,scrollbars=yes,width=600,height=400,resizable=yes" );
			} else if ( myType != null && myType != "" && myProduct != null && myProduct != "" && myDocNum != null && myDocNum != "" && myDocNum != NULL_DOC ) {
				strRedir = "/apps/login/login.asp?Redirect=Documents&Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				window.open( strRedir, "DocWindow", "location=no,toolbar=yes,scrollbars=yes,width=600,height=400,resizable=yes" );
			}
		}

		if (myType=="TechDocs") {
			myDocNum = document.MainForm.hdnTechDocs.value;
			if ( myType != null && myType != "" && myProduct != null && myProduct != "" && myDocNum != null && myDocNum != "" && myDocNum != NULL_DOC ) {
				//strRedir = "/apps/login/login.asp?Redirect=techdocs&Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				strRedir = "/apps/techdocs/techdocs.asp?Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				window.open( strRedir, "DocWindow", "scrollbars=yes,width=600,height=400,resizable=yes" );
			}
		}
	}

//*******************************************************************************************************************
  function showRelated(myType) {
		var myProductID = document.MainForm.hdnProductID.value;
		var myProduct = document.MainForm.hdnProduct.value;
		var strRedir;

		if ( myType != null && myType != "" && myProduct != null && myProduct != "" ) {
			var strLoc = new String(window.location);
			var myLoc = new String(strLoc.toLowerCase());

			strRedir = "/ProductPages/ShowRelated.asp?Product=" + myProduct + "&ProductID=" + myProductID + "&Type=" + myType;
			window.open( strRedir, "DocWindow", "screenX=1,screenY=1,scrollbars=yes,width=750,height=500,resizable=yes" );
		}
	}

//*******************************************************************************************************************
	function getCookie(myCookie) {
		var strCookies;
		var strCookieName;
		var strCookieArray;
		var strMyCookieArray;
		var strTemp;
		var iStart;
		var iEnd;

		strCookieName = myCookie + "=";
		strCookies = unescape(document.cookie);
		strCookieArray = strCookies.split('; ');

		strTemp = ""

		for ( var i = 0; i < strCookieArray.length; i++ ) {
			if ( strCookieArray[i].substr(0,strCookieName.length) == strCookieName ) {
				strMyCookieArray = strCookieArray[i].split('=');
				strTemp = strMyCookieArray[1]
			}
		}

		return strTemp;
	}

//*******************************************************************************************************************
	function hideAll(hasNS) {
		var myLayer;

		if ( hasNS ) {
			for ( myLayer in document.layers ) {
				if ( myLayer.substr(0,3) == "lyr" ) {
					document.layers[myLayer].visibility = "hidden";
				}
			}
		}
		else {
			for ( myLayer in document.all ) {
				if ( myLayer.substr(0,3) == "lyr" ) {
					document.all[myLayer].style.visibility = "hidden";
				}
			}
		}

		return;
	}

//*******************************************************************************************************************
	function showOneLayer(myLayer, hasNS) {
		if ( hasNS ) {
			document.layers[myLayer].visibility = "visible";
		}
		else {
			document.all[myLayer].style.visibility = "visible";
		}
	}

//*******************************************************************************************************************
	function hideOneLayer(myLayer,hasNS) {
		if ( hasNS ) {
			document.layers[myLayer].visibility = "hidden";
		}
		else {
			document.all[myLayer].style.visibility = "hidden";
		}
	}

//*******************************************************************************************************************
	function showLayers(myCurr) {
		var strLayerPath;
		var ns4;
		var ie4;

	  ns4 = (document.layers) ? 1:0;
		ie4 = (document.all) ? 1:0;

		if ( ns4 == 0 && ie4 == 0 ) {
			alert ("This site is designed for version 4 or higher browsers.")
			location = "/default.asp";
		}


		hideAll(ns4);

		// 0 = USD, 1 = CND, 2 = Browse Only

		if (myCurr < 2) {
			showOneLayer("lyrTable1",ns4);
			showOneLayer("lyrTable2",ns4);
			showOneLayer("lyrYOF",ns4);

			if ( myCurr == 0 ) {
				showOneLayer("lyrDiscUS",ns4);
			}
			else {
				showOneLayer("lyrDiscCan",ns4);
			}

			if ( document.forms["frmData"].hasMSDS.value != '' ) {
				showOneLayer("lyrMSDS",ns4);
			}
		}
		else {
			showOneLayer("lyrDiscBrowse",ns4);
			showOneLayer("lyrBrowseHead",ns4);
		}

		return;
	}

//*******************************************************************************************************************
	function setStartLayers() {
		var strCRLID;
		var strCurrType;

		strCurrType = "";

		strCRLID = getCookie("CRL_ID");

		if (strCRLID != "") {
			strCurrType = strCRLID.substr(0,1);
			strCRLID = strCRLID.substr(1);
		}

		if (strCRLID != "") {
			showLayers (strCurrType);
		}
		else {
			showLayers(2);
		}

		return;
	}

//*******************************************************************************************************************
	function showCustomerModules(myType) {
		var strRedir = "";
		var blnNewPage = false;
		var newWindow = 0;

		if ( strCustID != null && strCustID != "" )
		{
			switch (myType)
			{
				case 0:
					strRedir = "/apps/order/revieworder.asp"; //Review your order
					break;
				// Modified By CKIM 082801
				case 1:
					strRedir = "/apps/orderhistory/orderhistory.asp"; //View purchase history
					strRedir = strRedir + "?Product=" + document.MainForm.hdnProduct.value;
					newWindow = 1;
					break;
				case 2:
					if ( strCustID != null && strCustID != "" ) {
						strRedir = "/apps/personalcatalog/managePersonalCatalog.asp"; //View personal catalog
					} else {
						strRedir = "nowhere"
					}
					break;
				case 3:
					if ( strCustID != null && strCustID != "" ) {
						strRedir = "/apps/personalcatalog/addPersonalItem.asp"; //Add to personal catalog
						strRedir = strRedir + "?Product=" + document.MainForm.hdnProduct.value;
						strRedir = strRedir + "&New=True";
						blnNewPage = true;
					} else {
						strRedir = "nowhere"
					}
					break;
			}
				// Modified By CKIM 082801
			if (newWindow == 1)
			{
				orderhistoryWindow = window.open (strRedir,"orderhistoryWindow","toolbar=yes,location=yes,scrollbars=yes,resizable=yes,menubar=yes,status=yes");
			}
			else
			{
				if (strRedir == "") {
					alert ("Coming Soon!");
				} else if (strRedir != "nowhere") {
					if (blnNewPage) {
						window.open (strRedir, "CustomerPCAdd", "height=150,width=500,resizable=yes");
					} else {
						window.location = strRedir;
					}
				}
			}
		}
	}

//*******************************************************************************************************************
	function confirmWin (strhost) {
		var strhost;
		var strRedir;

		strhost = strhost;
		strRedir = "http://" + strhost + "/apps/internet/ExecutiveReview/Notes.asp";
		open (strRedir, "confirm", "height=400,width=600");
	}

	function addDocs1(myType, myTechDocs) {
		var myProduct = document.MainForm.hdnProduct.value;
		var myDocNum;
		var strRedir;
		var NULL_DOC = "0000000";
		var strCustID;
			switch ( myType ) {
				case "MSDS":
					myDocNum = myTechDocs;
					break;
				case "SpecData":
					myDocNum  = myTechDocs;
					break;
				case "ProdSpec":
					myDocNum = myTechDocs;
					break;
			}
			if (myType == "SpecData") {
				strRedir = "/DataSheets/SpecData/" + myTechDocs;
				window.open( strRedir, "DocWindow", "location=no,toolbar=yes,scrollbars=yes,width=600,height=400,resizable=yes" );
			} else if (myType == "ProdSpec") {
				strRedir = "/apps/ProdSpec/prodspec.asp?ProductID=" + myTechDocs;
				window.open( strRedir, "DocWindow", "location=no,toolbar=yes,scrollbars=yes,width=600,height=400,resizable=yes" );
			} else if ( myType != null && myType != "" && myProduct != null && myProduct != "" && myDocNum != null && myDocNum != "" && myDocNum != NULL_DOC ) {
				//strRedir = "/apps/login/login.asp?Redirect=Documents&Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				strRedir = "/apps/documents/documentMenu.asp?Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				window.open( strRedir, "DocWindow", "location=no,toolbar=yes,scrollbars=yes,width=600,height=400,resizable=yes" );
			}
		if (myType=="TechDocs") {
			myDocNum = myTechDocs;
			if ( myType != null && myType != "" && myProduct != null && myProduct != "" && myDocNum != null && myDocNum != "" && myDocNum != NULL_DOC ) {
				//strRedir = "/apps/login/login.asp?Redirect=techdocs&Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				strRedir = "/apps/techdocs/techdocs.asp?Product=" + myProduct + "&DocNum=" + myDocNum + "&Type=" + myType;
				window.open( strRedir, "DocWindow", "scrollbars=yes,width=600,height=400,resizable=yes" );
			}
		}
	}


			var winRelated = "";
			function show_related(myProduct, myProductID, myType) {
				var strRedir = "/productpages/showrelated.asp?Product=" + myProduct + "&ProductID=" + myProductID + "&Type=" + myType;
				if (winRelated && !winRelated.closed) {winRelated.close();}

				winRelated = window.open(strRedir,"related","top=1,left=1,scrollbars=yes,height=400,width=700,resizable=yes");
			}

			var winLarger = "";
			function view_larger(myProductID) {
				var strRedir = "/productpages/largerimage.asp?ProductID=" + myProductID;
				if (winLarger && !winLarger.closed) {winLarger.close();}
				winLarger = window.open(strRedir,"largerimage","top=1,left=1,scrollbars=yes,height=400,width=600,resizable=yes");
			}

			function setPOMBackground()	{
				var hasIE = true;
				if ( navigator.appName.indexOf("Netscape") != -1 )
					hasIE = false;

				var objDate = new Date();
				var objPOMStart = new Date(document.MainForm.hdnPOMStart.value);
				var objPOMEnd = new Date(document.MainForm.hdnPOMEnd.value);
				var Current = objDate.getTime();
				var Start = objPOMStart.getTime();
				var End = objPOMEnd.getTime();

				if (((Current >= Start) && (Current < End)) && hasIE)
				{
					document.body.background = '/templates/images/background/sale_background1.gif';
				}
			}

			function setPOMImage()	{
				var hasIE = true;
				if ( navigator.appName.indexOf("Netscape") != -1 )
					hasIE = false;

				var objDate = new Date();
				var objPOMStart = new Date(document.MainForm.hdnPOMStart.value);
				var objPOMEnd = new Date(document.MainForm.hdnPOMEnd.value);
				var Current = objDate.getTime();
				var Start = objPOMStart.getTime();
				var End = objPOMEnd.getTime();

				if (hasIE == true) {
					if (document.MainForm.hdnBB.value != "True" && ((Current >= Start) && (Current < End))) {
						if (document.all['productsale']) {
							document.all['productsale'].style.visibility = "visible";
						}
					} else {
						if (document.all['productsale']) {
							document.all['productsale'].style.visibility = "visible";
							document.all['productsale'].style.position = "absolute";
							document.all['productsale'].style.visibility = "hidden";
						}
					}
				} else {
					if (document.MainForm.hdnBB.value != "True" && ((Current >= Start) && (Current < End))) {
						document.getElementById('productsale').style.display="block";
						document.getElementById('productsale').style.visibility="visible";
					} else {
						document.getElementById('productsale').style.display="none";
						document.getElementById('productsale').style.visibility="hidden";
					}
				}
			}

			function setBBImage()	{
				var hasIE = true;
				if ( navigator.appName.indexOf("Netscape") != -1 )
					hasIE = false;

				if (hasIE == true) {
					if (document.MainForm.hdnBB.value == "True") {
						if (document.all['bbsale']) {
							document.all['bbsale'].style.visibility = "visible";
						}
					} else {
						if (document.all['bbsale']) {
							document.all['bbsale'].style.visibility = "visible";
							document.all['bbsale'].style.position = "absolute";
							document.all['bbsale'].style.visibility = "hidden";
						}
					}
				} else {
					if (document.MainForm.hdnBB.value == "True") {
						document.getElementById('bbsale').style.display="block";
						document.getElementById('bbsale').style.visibility="visible";
					} else {
						document.getElementById('bbsale').style.display="none";
						document.getElementById('bbsale').style.visibility="hidden";
					}
				}
			}


			var winColors = "";
			function more_colors(myProductID, myGroupID) {
				var strRedir = "/productpages/differentcolors.asp?ProductID=" + myProductID + "&GroupID=" + myGroupID;
				if (winColors && !winColors.closed) {winColors.close();}
				winColors = window.open(strRedir,"colors","top=1,left=1,scrollbars=yes,height=400,width=600,resizable=yes");
			}

			var video_window = "";
			function product_video(myID) {
				if (video_window && !video_window.closed) {
					video_window.close();
				}
				video_window = window.open("/apps/video/productvideo.asp?productid=" + myID,"video","left=1,top,scrollbars=yes,height=400,width=600,resizable=yes");
			}

			var howtodoit_window = "";
			function product_hashowtodoit(myID) {
				if (howtodoit_window && !howtodoit_window.closed) {
					howtodoit_window.close();
				}
				howtodoit_window  = window.open("/apps/TechDoc/howtodoit.asp?productid=" + myID,"howtodoit","left=1,top,scrollbars=yes,height=400,width=600,resizable=yes");
			}
//*******************************************************************************************************************
function emailpage(product)
{
/////////////////////////
//start get ip address = server_ip
function getXMLHttpObj_Foot()
{
        if(typeof(XMLHttpRequest)!='undefined')
                return new XMLHttpRequest();

        var axO=['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i;

        for(i=0;i<axO.length;i++)
                try
				{
                    return new ActiveXObject(axO[i]);
                }
				catch(e){}

        return null;
}

function loadScript_Foot()
{
        var oXML = getXMLHttpObj_Foot();
	    oXML.open('GET', '/includes/ServerIP2.stm', false);
        oXML.send('');
        eval(oXML.responseText);
}

var server_ip = '';
loadScript_Foot();
//end get ip address = server_ip
//var product = document.getElementById("hdnProduct").value;
//alert(server_ip)
//alert(product)
    if (server_ip.substring(0,7) == "172.21.")
    {
        //is an internal user
        var sHost = location.host;
        var sPath = "";
        if (sHost.substring(0, 4).toLowerCase() == "dev2")
        {
            sHost = "idev.crlaurence.com";  
        }
        else
        {
            sHost = "intranet";  
        }
        window.parent.location = "http://" + sHost + "/apps/emailproductpage/default.aspx?prod=" + product;  //?directory=" + dir + "&pageNum=" + pageNum;
    }
    else
    {
        //is an external user - opens their email app
        var strLoc2 ="?prod=" + product; 
        var LOC = location.host;
        LOC += location.pathname;
        var LOC2 = escape("http://" + LOC + strLoc2);
        mail_str = "mailto:?subject=Check out this " + document.title;
        mail_str += "&body=I thought you might be interested in this " + document.title + ".";
        mail_str += "%0D%0A%0D%0A";
        mail_str += "You can view by going to the link below. ";
        mail_str += "%0D%0A%0D%0A";
        mail_str += LOC2;
        location.href = mail_str;
    }
}

//*******************************************************************************************************************
    function translateAU()
    {
        //Catalog Number B5S10 - CRL 120" B5S Series Standard Square <span id='u1' class='show'>Aluminum</span><span id='a1' class='hide'>Aluminium</span> Base Shoe Extrusion Only Without Holes</TITLE>
        var i;
        var sHost = window.location.hostname;
		if (sHost.indexOf("crlaurence.com.au") > 1) 
        {
            for (i = 1; i < 300; i++)
            {
                var u = document.getElementById("u" + i);
                var a = document.getElementById("a" + i);        
                if (u)
                {
                    u.className = "hide";
                    a.className = "show";
                }
//                else
//                {
//                    break;
//                }
            }//for i
        }//if au

    }//translateAU


//*******************************************************************************************************************
