var gAutoPrint = true; // Flag for whether or not to automatically call the print function function printSpecial() { if (document.getElementById != null) { var html = '\n
\n'; if (document.getElementsByTagName != null) { var headTags = document.getElementsByTagName("head"); if (headTags.length > 0) html += headTags[0].innerHTML; } html += '\n\n\n'; var printReadyElem = document.getElementById("printReady"); if (printReadyElem != null) { html += printReadyElem.innerHTML; } else { alert("Could not find the printReady section in the HTML"); return; } html += '\n\n'; var printWin = window.open("","printSpecial"); printWin.document.open(); printWin.document.write(html); printWin.document.close(); if (gAutoPrint) printWin.print(); } else { alert("Sorry, the print ready feature is only available in modern browsers."); } } function check(field) { for (i = 0; i < field.length; i++) { if(field[i].disabled == false) field[i].checked = true; } field.checked = true; } function uncheck(field){ for (i = 0; i < field.length; i++) { if(field[i].disabled == false) field[i].checked = false; } field.checked = false; } function submitpage(action,form,domain,ssid) { switch(action) { //email.php to send.php case "addtobasket" : form.action = domain + "mywtexpo/basket.php?WTEXPOID=" + ssid + "&action=add&from=wtebw"; form.target="_self"; form.submit(); break; //click on 'enquiry' to goto sendenquiry.php case "enquiry" : form.action= domain + "sendenquiry.php?WTEXPOID=" + ssid + "&from=enquiry"; form.target="_blank"; form.submit(); } } function redirect(URLStr) { location = URLStr; } var popUpWin=0; function popUpWindow(URLStr, left, top, width, height) { if(popUpWin) { if(!popUpWin.closed) popUpWin.close(); } popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+''); } function isURL(elm) { var urlPrefix = "http" + "://"; var url = elm.value + ""; url = url.toLowerCase(); if (url.indexOf(urlPrefix) + "" != "-1") return true; else return false; } function isFilled(elm) { if (elm.value == "" || elm.value == null) return false; else return true; } // Check for email address: look for [@] and [.] function isEmail(elm) { if (isEmailString(elm.value) == false){ return false; } else { return true; } } //Check that a string is a valid email function isEmailString(email) { if (email == "") { return false; } if (email.indexOf(" ") + "" != "-1"){ return false; } if (isComposedOfChars("0123456789abcdefghijklmnopqrstuvwxyz&@.-_",email.toLowerCase()) == false) { return false; } if (email.indexOf("@") + "" == "-1"){ return false; } if (email.indexOf("@") != email.lastIndexOf("@")){ return false; } if (email.indexOf(".") + "" == "-1"){ return false; } if (email.indexOf("@") + "" == "0"){ return false; } if (email.indexOf(".") == email.length - 1){ return false; } return true; } function isComposedOfChars(validChars, inString) { return (indexOfFirstNotIn(validChars, inString) == -1); } function isNumeric(number) { number = number + ""; return ((number.length > 0) && isComposedOfChars("0123456789", number)); } function indexOfFirstNotIn(okayChars, inString) { var i; for (i=0; i < inString.length; i++) { var charm = inString.charAt(i); if (okayChars.indexOf(charm) == -1) { return i; } } return -1; } function setFocus() { if (is_ie3()== false) { self.focus(); } }| |
WTEbw.Constructor -- WTE BASIC WEBSITE CONSTRUCTOR | |
||||||||
| |
|
|
|
|
|
|
|
|
|
|
| Send Us Suggestion * Field that must be filled in |
Set Wtexpo.com as home | Frequently Asked Questions | Support
|