SecureList = new Array("frmOrder","frmEditProfiles","frmRegister","frmLogin","frmShoppingCart","frmCancelOrder","frmTrackOrder","frmPriceGrid","frmMyAccount"); Secure = false; URLstr = self.location.toString(); for (var i = 0; i <= SecureList.length - 1; i ++) { if (URLstr.toLowerCase().indexOf(SecureList[i].toLowerCase()) != -1) Secure = true; } Move = ((Secure && URLstr.toLowerCase().indexOf("https://") == -1) || (!Secure && URLstr.toLowerCase().indexOf("https://") != -1)) ? true: false; URLstr = (Move && Secure) ? "https:" + URLstr.substring(location.protocol.length, URLstr.length): "http:" + URLstr.substring(location.protocol.length, URLstr.length); if (Move && navigator.appName == "Netscape") { window.stop(); setTimeout("self.location = URLstr", 300) } else if (Move) { self.location = URLstr; } function SetCookie(name,value,expires,path,domain,secure) { if (expires) { expDate = new Date(); expDate.setTime(expDate.getTime() + (expires * 24 * 60 * 60 * 1000)); expires = expDate; } document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString(): "") + ((path) ? "; path=" + path: "") + ((domain) ? "; domain=" + domain: "") + ((secure) ? "; secure" + secure: ""); } function GetCookie(varName,returnStr) { if (returnStr == null || returnStr == "undefined") returnStr = "ERROR: There Is No Cookie Variable By That Name." if (document.cookie.indexOf(varName + "=") == -1) return returnStr; cookieString = document.cookie + ";"; cookieString = cookieString.substring((cookieString.indexOf(varName + "=") + 1 + varName.length),cookieString.length); cookieString = cookieString.substring(0,cookieString.indexOf(";")); return cookieString; } function SetVar(Str,Var,Value) { Value = '&' + Var + '=' + Value; Var = '&' + Var + '='; Str = (Str.indexOf('&EndVars') < 0) ? Str + '&EndVars' : Str; Var = (Str.indexOf(Var) < 0) ? '&EndVars' : Str.substring(Str.indexOf(Var), Str.indexOf('&',Str.indexOf(Var) + 1)); Str = Str.substring(0,Str.indexOf(Var)) + Value + Str.substring(Str.indexOf(Var)+Var.length,Str.length); Str = (Str.indexOf('&EndVars') < 0) ? Str + '&EndVars' : Str; return Str; } function GetVar(Str,Var) { Var = '&' + Var.toLowerCase() + '='; Str = Str.toLowerCase() + '&'; Index = Str.indexOf(Var) + Var.length; Value = (Str.indexOf(Var) < 0) ? "": Str.substring(Index,Str.indexOf('&',Index)); return Value; } function StripVar(Str,Var) { Var = '&' + Var + '='; Str = (Str.indexOf('&EndVars') < 0) ? Str + '&EndVars' : Str; Str = (Str.indexOf(Var) != -1) ? Str.substring(0,Str.indexOf(Var)) + Str.substring(Str.indexOf('&',Str.indexOf(Var) + 1),Str.length): Str; return Str; } function ReplaceChar(str,o,n) { while (str.indexOf(o) != -1) { str = str.substring(0,str.indexOf(o)) + (n == null ? "" : n ) + str.substring(str.indexOf(o)+o.length,str.length); } return str; } function FormatAs$(str,returnType) { if (returnType == null || (returnType != "abc" && returnType != "123")) returnType = "abc"; str = str.toString(); if (str.indexOf('$') == 0) str = str.substring(1,99); str = parseFloat(str); str = Math.round(str * 100) / 100; if (returnType == "123") return str; str = str.toString(); str = "$" + str + (str.indexOf(".") != -1 ? "" : ".00"); str.length == str.indexOf(".") + 2 ? str += "0" : str = str.substring(0,str.indexOf(".") + 3); return str; } function GetValue(name,returnType) { if (returnType == null || returnType == "undefined") returnType = "value"; returnVal = ""; objRef = eval("document.forms[0]." + name); fieldType = "select"; if (objRef.type == null) fieldType = eval("document.forms[0]." + name + "[0].type"); if (fieldType == "select") { for (loop = 0; loop < objRef.options.length; loop++) { if (objRef.options[loop].selected) { if (returnVal.length > 0) returnVal += "~"; returnVal += eval('objRef.options[loop].' + returnType); } } } if (fieldType == "radio") { for (loop = 0; loop < objRef.length; loop++) { if (objRef[loop].checked) { returnVal = eval('objRef[loop].' + returnType); } } } if (fieldType == "checkbox") { for (loop = 0; loop < objRef.length; loop++) { if (objRef[loop].checked) { if (returnVal.length > 0) returnVal += "~"; returnVal += eval('objRef[loop].' + returnType); } } } return returnVal; }