// bool vars ns4 = (document.layers) ? true:false; ie4 = (document.all) ? true:false; ns6 = (document.getElementById)? true:false; if (ie4) ns6 = false; // swap image vars waitMode = false; var whitespace = " \t\n\r"; function browser(id){ var layer = (ns4) ? document.layers[id] : (ie4) ? document.all[id] : document.getElementById(id); return layer; } function showLayer(id) { layer = browser(id) if(ns4){ layer.visibility = "visible" } else{ layer.style.visibility = "visible" } } function hideLayer(id) { layer = browser(id) if(ns4){ layer.visibility = "hidden" } else{ layer.style.visibility = "hidden" } } //********* cookie functions ************ function setCookie(name,value,expires,path,domain,secure) { document.cookie = name + "=" +escape(value) + ( (expires) ? ";expires=" + expires.toGMTString() : "") + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ( (secure) ? ";secure" : ""); } function getCookie(name) { var start = document.cookie.indexOf(name+"="); var len = start+name.length+1; if ((!start) && (name != document.cookie.substring(0,name.length))) return null; if (start == -1) return null; var end = document.cookie.indexOf(";",len); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(len,end)); } function deleteCookie(name,path,domain) { if (Get_Cookie(name)) document.cookie = name + "=" + ( (path) ? ";path=" + path : "") + ( (domain) ? ";domain=" + domain : "") + ";expires=Thu, 01-Jan-70 00:00:01 GMT"; } //********* string functions ************ function replace(string,text,by) { // Replaces text with by in string var strLength = string.length, txtLength = text.length; if ((strLength == 0) || (txtLength == 0)) return string; var i = string.indexOf(text); if ((!i) && (text != string.substring(0,txtLength))) return string; if (i == -1) return string; var newstr = string.substring(0,i) + by; if (i+txtLength < strLength) newstr += replace(string.substring(i+txtLength,strLength),text,by); return newstr; } function isInteger(s) { for (var i = 0; i < s.length; i++) { var c = s.charAt(i); if (!((c >= "0") && (c <= "9"))) { return false; } } return true; } function containsInteger(s) { for (var i = 0; i < s.length; i++) { var c = s.charAt(i); if (((c >= "0") && (c <= "9"))) { return true; } } return false; } function isTime(S) { return /^([01]?[0-9]|[2][0-3])(:[0-5][0-9])?$/.test(S) } function ltrim ( s ) { return s.replace( /^\s*/, "" ) } function rtrim ( s ) { return s.replace( /\s*$/, "" ); } function trim ( s ) { return rtrim(ltrim(s)); } function convertChars(sText) { // converts special chars (e.g. ϧ) to a JS alert format var i = sText.indexOf("&#"); while ( (i=sText.indexOf("&#"))>-1 ) { sAll = sText.substring(i,i+6); sNum = sText.substring(i+2,i+5); sText = replace(sText,sAll,String.fromCharCode(sNum)); } return sText; } // Returns true if s is empty or whitespaces only // function isEmpty(s) { var i; if ((s == null) || (s.length == 0)) return true; for (i = 0; i < s.length; i++) { var c = s.charAt(i); if (whitespace.indexOf(c) == -1) return false; } return true; } // Strips trailing whitespaces // function stripTrailWhite(s) { var i; var sln = s.length - 1; for (i = sln; i >= 0; i--) { var c = s.charAt(i); if (whitespace.indexOf(c) == -1) { // alert('substring is='+s.substring(0, i+1)); return s.substring(0, i+1); } } return s; } /*function validateemail(str) { // are regular expressions supported? var supported = 0; if (window.RegExp) { var tempStr = "a"; var tempReg = new RegExp(tempStr); if (tempReg.test(tempStr)) supported = 1; } if (!supported) return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); return (!r1.test(str) && r2.test(str)); }*/ function validateemail(strEmail){ validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i; // search email text for regular exp matches if (strEmail.search(validRegExp) == -1) { return false; } return true; } //********* get args from get ************ function getArgs() { var args = new Object(); // Get Query String var query = location.search.substring(1); // Split query at the comma var pairs = query.split("&"); // Begin loop through the querystring for(var i = 0; i < pairs.length; i++) { // Look for "name=value" var pos = pairs[i].indexOf('='); // if not found, skip to next if (pos == -1) continue; // Extract the name var argname = pairs[i].substring(0,pos); // Extract the value var value = pairs[i].substring(pos+1); // Store as a property args[argname] = unescape(value); } return args; // Return the Object } //********* other functions ************ function swapImage(imgObj,imgName) { if (ns4) { eval('document.images["'+imgObj+'"].src = "' + imgName + '.gif"'); } else { document.images[imgObj].src = eval("'" + imgName + ".gif'"); } } function popupwindow(urlpopup,bScroll,width,height) { var scroll; width = (width)?width:'450'; height = (height)?height:'550'; scroll = (bScroll) ?'yes' :'no'; window.open (urlpopup, 'Information','Width='+width+',Height='+height+',innerWidth=300,innerHeight=200,screenX=340,screenY=450,directories=no,location=no,menubar=no,resizable=yes,scrollbars='+scroll+',status=no,toolbar=no,titlebar=yes'); } function bigpopupwindow(urlpopup,bScroll,width,height) { var scroll; width = (width)?width:'800'; height = (height)?height:'600'; scroll = (bScroll) ?'yes' :'no'; window.open (urlpopup, 'Information','Width='+width+',Height='+height+',innerWidth=300,innerHeight=200,screenX=340,screenY=450,directories=no,location=no,menubar=no,resizable=yes,scrollbars='+scroll+',status=no,toolbar=no,titlebar=yes'); } function terms(urlpopup,bScroll) { var scroll; scroll = (bScroll) ?'yes' :'no'; window.open (urlpopup, 'Information','Width=400,Height=400,innerWidth=300,innerHeight=200,screenX=340,screenY=450,directories=no,location=no,menubar=no,resizable=yes,scrollbars='+scroll+',status=no,toolbar=no,titlebar=yes'); } function explode(item,delimiter) { tempArray=new Array(1); var Count=0; var tempString=new String(item); while (tempString.indexOf(delimiter)>0) { tempArray[Count]=tempString.substr(0,tempString.indexOf(delimiter)); tempString=tempString.substr(tempString.indexOf(delimiter)+1,tempString.length-tempString.indexOf(delimiter)+1); Count=Count+1 } tempArray[Count]=tempString; return tempArray; } function getSelectedRb(buttonGroup) { if (buttonGroup[0]) { // if the button group is an array (one button is not an array) for (var i=0; i 1) { selectText = tx_select_country; } else { selectText = '--Select country--'; }//End if //validate that the requestcountry is a valid one for (var i in allcountries) { if (allcountries[i]==def) { requestcountry=def; } } if ( (force=="SHOW_AUTO") && (requestcountry =="United States")) requestcountry=""; if ((force=="SHOW_AUTO") && (requestcountry !="") ) { cs.options.length=0; cs.options[0] = new Option(selectText,"",false,false); cs.options[cs.options.length]=new Option(requestcountry,requestcountry,false); //countries["SHOW_EURO"]="SHOW OTHER COUNTRIES"; } else if (cs.value=="SHOW_EURO" || (cs.options.length==0) ||(force=="SHOW_EURO") || (force=="SHOW_AUTO")) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option(selectText,"",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true); } countries=eurocountries; countries["SHOW_ALL"]="SHOW ALL COUNTRIES"; } else if ( (cs.value=="SHOW_ALL") ||(force=="SHOW_ALL") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option(selectText,"",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=allcountries; //countries["SHOW_EURO"]="SHOW EURO COUNTRIES ONLY"; } else if ( (cs.value=="SHOW_UK") ||(force=="SHOW_UK") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option(selectText,"",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=ukcountries; //countries["SHOW_EURO"]="SHOW EURO COUNTRIES ONLY"; countries["SHOW_ALL"]="SHOW ALL COUNTRIES"; } else if (isdefined(newobj)) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option(selectText,"",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=newobj; } else if ( (cs.value=="SHOW_CHINADAY") ||(force=="SHOW_CHINADAY") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option("--Select Country--","",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=chinadaycountries; } for (var i in countries) { cs.options[cs.options.length]=new Option(countries[i],i,false,false); } }