function winresize() { // Check if it is Opera browsers if(navigator.appName == "Opera"){ document.all.banner.style.pixelWidth=window.innerWidth-48; //189; document.all.banner.style.pixelLeft=0; if(document.all.front){ document.all.front.style.pixelWidth=window.innerWidth-30; document.all.front.style.pixelLeft=10; } if(document.all.content){ document.all.content.style.pixelWidth=window.innerWidth-48; //191; document.all.content.style.pixelLeft=0; document.all.maincontainer.style.backgroundColor = "#FFFFCC"; } if(document.all.register){ document.all.register.style.pixelWidth=window.innerWidth-198; // 198; } } // Check if it is Netscape browsers if(navigator.appName == "Netscape"){ if(document.getElementById("content")){ document.getElementById("content").style.width=window.innerWidth-50; document.getElementById("maincontainer").style.backgroundColor = "#FFFFCC"; } if(document.getElementById("register")){ document.getElementById("register").style.width = window.innerWidth-189; } } // Check if it is IE if(navigator.appName == "Microsoft Internet Explorer"){ if(document.all.glossyboard){ document.all.glossyboard.style.height = 550; } if(document.all.row){ document.all.row.style.height = 290; } if(document.all.mattboard){ document.all.mattboard.style.height = 550; } } } function validate_changeloginform() { var form = document.changeloginform; //--------------------------------------------------------------------------------------------------- // New login name: if (form.username.value == ""){ alert(" Please enter new login name."); form.username.focus(); return false; } //-------------------------------------------------------------------------------------------------- // Password: if (form.password.value == ""){ alert("Please enter new password."); form.password.focus(); return false; } if (form.password.value.length < 5){ alert("Invalid password!\nPlease enter new password again, at least 5 characters is required."); form.password.focus(); form.password.select(); return false; } //-------------------------------------------------------------------------------------------------- // Password Confirmation: var pssword = form.password.value; if (form.confirmpassword.value ==""){ alert("Please confirm your password."); form.confirmpassword.focus(); return false; } if (pssword != form.confirmpassword.value){ alert("Invalid password!\nEntered passwords did not match. Please try again!"); form.confirmpassword.focus(); form.confirmpassword.select(); return false; } return true; } function validate_orderform() { var form = document.orderform; //--------------------------------------------------------------------------------------------------- // Title: var choice = form.gender.selectedIndex; if (form.gender.options[choice] == ""){ alert("Please enter your title."); form.gender.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Firstname: if (form.firstname.value == ""){ alert(" Please enter your firstname."); form.firstname.focus(); return false; } if (!isNaN(form.firstname.value)){ alert("Invalid name!\nTry again."); form.firstname.focus(); form.firstname.select(); return false; } //--------------------------------------------------------------------------------------------------- // Lastname: if (form.lastname.value == ""){ alert(" Please enter your lastname."); form.lastname.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Address: if (form.address.value == ""){ alert("Please enter your address."); form.address.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Suburb: if (form.suburb.value == ""){ alert("Please enter your suburb."); form.suburb.focus(); return false; } //--------------------------------------------------------------------------------------------------- // State: var local = form.state.selectedIndex; if (form.state.options[local] == ""){ alert("Please enter your state."); form.state.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Postcode: if (form.postcode.value.length == ""){ alert("Please enter your postcode."); form.postcode.focus(); return false; } if (isNaN(form.postcode.value) || form.postcode.value.length <= 3){ alert("Invalid number!\nPlease enter at least 4 digits number."); form.postcode.focus(); form.postcode.select(); return false; } //--------------------------------------------------------------------------------------------------- // Country: if (form.country.value.length == ""){ alert("Please enter your country name."); form.country.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Delivery Address: if (form.same_address.checked){ form.ship_address.value = form.address.value ; form.ship_suburb.value = form.suburb.value ; form.ship_state.value = form.state.value ; form.ship_postcode.value = form.postcode.value ; form.ship_country.value = form.country.value ; } if (form.ship_address.value == ""){ alert("Please enter your address."); form.ship_address.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Delivery Suburb: if (form.ship_suburb.value == ""){ alert("Please enter your suburb."); form.ship_suburb.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Delivery State: var local = form.ship_state.selectedIndex; if (local == 0){ alert("You must pick one of the state."); form.ship_state.focus(); return false; } if (form.ship_state.options[local] == ""){ alert("Please enter your state."); form.ship_state.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Delivery Postcode: if (form.ship_postcode.value.length == ""){ alert("Please enter your postcode."); form.ship_postcode.focus(); return false; } if (isNaN(form.ship_postcode.value) || form.ship_postcode.value.length <= 3){ alert("Invalid number!\nPlease enter at least 4 digits number."); form.ship_postcode.focus(); form.ship_postcode.select(); return false; } //--------------------------------------------------------------------------------------------------- // Delivery Country: if (form.ship_country.value.length == ""){ alert("Please enter your country name."); form.ship_country.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Phone number: if (form.phone.value == ""){ alert("Please enter your phone number."); form.phone.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Email address: var emailength = form.email.value.length; var badat = (form.email.value.indexOf("@") == 0) || (form.email.value.indexOf("@", emailength -1) > 0); var baddot = (form.email.value.indexOf(".") == 0) || (form.email.value.indexOf(".", emailength -1) > 0); var baddash = (form.email.value.indexOf("-") == 0) || (form.email.value.indexOf("-", emailength -1) > 0); var onlyone = (form.email.value.indexOf("@")) == (form.email.value.lastIndexOf("@")); var atpos = form.email.value.indexOf("@"); var dotpos = form.email.value.indexOf("."); var dashpos = form.email.value.indexOf("-"); var forlash = form.email.value.indexOf("/"); var colon = form.email.value.indexOf(":"); var comma = form.email.value.indexOf(","); var semicolon = form.email.value.indexOf(";"); if (emailength == 0) { alert("Please enter your email address!"); form.email.focus(); return false; } if (forlash > -1 || colon > -1 || comma > -1 || semicolon > -1){ alert("Invalid email address!"); form.email.focus(); form.email.select(); return false; } if (badat || baddot || baddash){ alert("@, . and - characters can not enter at the beginning or at the end of the field"); form.email.focus(); form.email.select(); return false; } if (atpos == -1 || dotpos == -1) { alert("Email address must have @ and . character!"); form.email.focus(); form.email.select(); return false; } if (!onlyone){ alert("@ character can not have more than one!"); form.email.focus(); form.email.select(); return false; } if (Math.abs(atpos - dotpos) == 1 || Math.abs(atpos - dashpos) ==1 || Math.abs(dotpos - dashpos) ==1){ alert("The characters can not follow each other!"); form.email.focus(); form.email.select(); return false; } return true; } function validatepaymentform() { var form = document.payment; if (form.name.value == ""){ alert(" Please enter card holder name."); form.name.focus(); return false; } var card = form.type.selectedIndex; if (card == 0){ alert(" Please choose which type of credit card."); form.type.focus(); return false; } if (form.type.options[card] == ""){ alert(" Please choose which type of credit card."); form.type.focus(); return false; } if (form.number.value == ""){ alert(" Please enter 16 digits number of your card."); form.number.focus(); return false; } if (form.number.value.length < 19){ alert(" Please enter 16 digits number of your card."); form.number.focus(); form.number.select(); return false; } var month = form.month.selectedIndex; if (month == 0){ alert(" Please Enter expired month shown on your card."); form.month.focus(); return false; } if (form.month.options[month] == ""){ alert(" Please Enter expired month shown on your card."); form.month.focus(); return false; } var year = form.year.selectedIndex; if (year == 0){ alert(" Please Enter expired year shown on your card."); form.year.focus(); return false; } if (form.year.options[year] == ""){ alert(" Please Enter expired year shown on your card."); form.year.focus(); return false; } return true; } function validate_regoform() { var form = document.logform; if (form.logname.value == ""){ alert(" Please login your name."); form.logname.focus(); return false; } //-------------------------------------------------------------------------------------------------- // Password: if (form.password.value == ""){ alert("Please enter your password."); form.password.focus(); return false; } if (form.password.value.length < 5){ alert("Invalid password!\nPlease enter your password again at least 5 characters."); form.password.focus(); form.password.select(); return false; } //-------------------------------------------------------------------------------------------------- // Password Confirmation: var pssword = form.password.value; if (form.confirmation.value ==""){ alert("Please confirm your password."); form.confirmation.focus(); return false; } if (pssword != form.confirmation.value){ alert("Invalid password!\nEntered passwords did not match. Please try again!"); form.confirmation.focus(); form.confirmation.select(); return false; } //--------------------------------------------------------------------------------------------------- // Title: var choice = form.gender.selectedIndex; if (choice == 0){ alert("You must pick one of the title."); form.gender.focus(); return false; } if (form.gender.options[choice] == ""){ alert("Please enter your title."); form.gender.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Firstname: if (form.firstname.value == ""){ alert(" Please enter your firstname."); form.firstname.focus(); return false; } if (!isNaN(form.firstname.value)){ alert("Invalid name!\nTry again."); form.firstname.focus(); form.firstname.select(); return false; } //--------------------------------------------------------------------------------------------------- // Lastname: if (form.lastname.value == ""){ alert(" Please enter your lastname."); form.lastname.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Address: if (form.address.value == ""){ alert("Please enter your address."); form.address.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Suburb: if (form.suburb.value == ""){ alert("Please enter your suburb."); form.suburb.focus(); return false; } //--------------------------------------------------------------------------------------------------- // State: var local = form.state.selectedIndex; if (local == 0){ alert("You must pick one of the state."); form.state.focus(); return false; } if (form.state.options[local] == ""){ alert("Please enter your state."); form.state.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Postcode: if (form.postcode.value.length == ""){ alert("Please enter your postcode."); form.postcode.focus(); return false; } if (isNaN(form.postcode.value) || form.postcode.value.length <= 3){ alert("Invalid number!\nPlease enter at least 4 digits number."); form.postcode.focus(); form.postcode.select(); return false; } //--------------------------------------------------------------------------------------------------- // Country: if (form.country.value.length == ""){ alert("Please enter your country name."); form.country.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Phone number: if (form.phone.value == ""){ alert("Please enter your phone number."); form.phone.focus(); return false; } //--------------------------------------------------------------------------------------------------- // Email address: var emailength = form.email.value.length; var badat = (form.email.value.indexOf("@") == 0) || (form.email.value.indexOf("@", emailength -1) > 0); var baddot = (form.email.value.indexOf(".") == 0) || (form.email.value.indexOf(".", emailength -1) > 0); var baddash = (form.email.value.indexOf("-") == 0) || (form.email.value.indexOf("-", emailength -1) > 0); var onlyone = (form.email.value.indexOf("@")) == (form.email.value.lastIndexOf("@")); var atpos = form.email.value.indexOf("@"); var dotpos = form.email.value.indexOf("."); var dashpos = form.email.value.indexOf("-"); var forlash = form.email.value.indexOf("/"); var colon = form.email.value.indexOf(":"); var comma = form.email.value.indexOf(","); var semicolon = form.email.value.indexOf(";"); if (emailength == 0) { alert("Please enter your email address!"); form.email.focus(); return false; } if (forlash > -1 || colon > -1 || comma > -1 || semicolon > -1){ alert("Invalid email address!"); form.email.focus(); form.email.select(); return false; } if (badat || baddot || baddash){ alert("@, . and - characters can not enter at the beginning or at the end of the field"); form.email.focus(); form.email.select(); return false; } if (atpos == -1 || dotpos == -1) { alert("Email address must have @ and . character!"); form.email.focus(); form.email.select(); return false; } if (!onlyone){ alert("@ character can not have more than one!"); form.email.focus(); form.email.select(); return false; } if (Math.abs(atpos - dotpos) == 1 || Math.abs(atpos - dashpos) ==1 || Math.abs(dotpos - dashpos) ==1){ alert("The characters can not follow each other!"); form.email.focus(); form.email.select(); return false; } return true; } //--------------------------------------------------------------------------------------------------- // Find: var NS4 = (document.layers); var IE4 = (document.all); //var Safari = ($document.ready()); var win = this; var n = 0; function findInPage(str) { var txt, i, found; if (str == "") return false; if ((NS4) || (whichBrs() == "Safari") || (whichBrs() == "Firefox") ) { if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; if (n == 0) alert(str + " was not found on this page."); } if (IE4) { txt = win.document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart("character", 1); txt.moveEnd("textedit"); } if (found) { txt.moveStart("character", -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else alert(str + " was not found on this page."); } } return false; } //--------------------------------------------------------------------------------------------------- // Company Profile: var timeDelay = 20; // change delay time in seconds var Pix = new Array ("image/Profile/1.jpg" ,"image/Profile/2.jpg" ,"image/Profile/3.jpg" ,"image/Profile/4.jpg" ); var howMany = Pix.length; timeDelay *= 100; var PicCurrentNum = 0; var PicCurrent = new Image(); PicCurrent.src = Pix[PicCurrentNum]; function startPix() { setInterval("slideshow()", timeDelay); } function slideshow() { PicCurrentNum++; if (PicCurrentNum == howMany) { PicCurrentNum = 0; } PicCurrent.src = Pix[PicCurrentNum]; document["ChangingPix"].src = PicCurrent.src; if (PicCurrentNum == 0) document.messages.textArea.value = ""; // Test1 Message else document.messages.textArea.value = ""; // Test2 Message } //--------------------------------------------------------------------------------------------------- // Search: function setVariables() { if (whichBrs() == "Safari") { // or Safari // v=".top="; // dS="document."; // sD=""; v=".pixelTop="; dS=""; sD=".style"; y="window.pageYOffset"; // eval("document.getElementById('object1').style.pixelTop = 1550"); } else if (whichBrs() == "Firefox") { v=".top="; dS=""; sD=".style"; y="document.body.scrollTop"; // eval("document.getElementById('object1').style.top = 1550"); } else { v=".pixelTop="; dS=""; sD=".style"; y="document.body.scrollTop"; // eval("document.getElementById('object1').style.left = 650"); } } function checkLocation() { object="object1"; yy=eval(y); eval(dS+object+sD+v+yy); // setTimeout("checkLocation()",10); var t = setTimeout(function() {checkLocation()},10); } //--------------------------------------------------------------------------------------------------- // Check if image is infocus: function Check() { var NS4 = (document.layers); var IE4 = (document.all); if (IE4) var string = document.all.search.string; if (NS4) var string = document.layers.search.string; if (whichBrs() == "Firefox") var string = document.forms['search'].elements['string']; if(whichBrs() == "Safari") var string = document.search.string; if(string.hasFocus) return false; else { return findInPage(string.value); } } //--------------------------------------------------------------------------------------------------- // Add & Reset function Add(Name,Qty) { eval("document.Allform."+Name).value = Number(eval("document.Allform." + Name + ".value"))+Number(eval(Qty)); } function Zero(Name) { eval("document.Allform."+Name).value = Number(0); } function SelectYes(Name) { if (eval("document.Allform."+Name).value == "") document.searchx.Mycar.value = Number(document.searchx.Mycar.value)+1 ; eval("document.Allform."+Name).value = String("Yes"); document.cookie = "count="+document.searchx.Mycar.value; // alert(x); use only Internet Explorer to display message } //--------------------------------------------------------------------------------------------------- // Check Browser // Browser Detection Javascript // copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd // You have permission to copy and use this javascript provided that // the content of the script is not changed in any way. function whichBrs() { var agt=navigator.userAgent.toLowerCase(); if (agt.indexOf("opera") != -1) return 'Opera'; if (agt.indexOf("staroffice") != -1) return 'Star Office'; if (agt.indexOf("webtv") != -1) return 'WebTV'; if (agt.indexOf("beonex") != -1) return 'Beonex'; if (agt.indexOf("chimera") != -1) return 'Chimera'; if (agt.indexOf("netpositive") != -1) return 'NetPositive'; if (agt.indexOf("phoenix") != -1) return 'Phoenix'; if (agt.indexOf("firefox") != -1) return 'Firefox'; if (agt.indexOf("safari") != -1) return 'Safari'; if (agt.indexOf("skipstone") != -1) return 'SkipStone'; if (agt.indexOf("msie") != -1) return 'Internet Explorer'; if (agt.indexOf("netscape") != -1) return 'Netscape'; if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla'; if (agt.indexOf('\/') != -1) { if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') { return navigator.userAgent.substr(0,agt.indexOf('\/'));} else return 'Netscape';} else if (agt.indexOf(' ') != -1) return navigator.userAgent.substr(0,agt.indexOf(' ')); else return navigator.userAgent; }