// JavaScript Document //function to pop-up a new window on the page function NewWindow(mypage, myname, w, h, scroll, resizable) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',screenX='+winl+',screenY='+wint+',scrollbars='+scroll+',resizable='+resizable+''; win = window.open(mypage, myname, winprops); if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } //function to process product form function processForm(){ if(!document.productDetails.subCategory.value){ alert("You must select a Product Group"); document.productDetails.subCategory.focus(); }else{ document.productDetails.submit(); } } //function to count the characters in the text message function textCounter(field, countfield) { countfield.value = field.value.length; var maxChars = document.getElementById('maxChars'); var textTable = document.getElementById('textTable'); //if the max chars has been exceeded highlight the table red if(field.value.length > maxChars.innerHTML){ textTable.bgColor = "#FF0000"; }else{ textTable.bgColor = "#868DA7"; } } //function to set the maximum characters allowd in a text message. dependent on unicode or otherwise function setCharacters(){ var maxChars = document.getElementById('maxChars'); //set the max characters depending on unicode or not if(document.enquire.unicode[1].checked){ maxChars.innerHTML = "70"; }else if(document.enquire.unicode[0].checked){ maxChars.innerHTML = "160"; } var chars = document.getElementById('chars'); //if the max chars has been exceeded highlight the table red if(chars.value > maxChars.innerHTML){ textTable.bgColor = "#FF0000"; }else{ textTable.bgColor = "#868DA7"; } } //function to check or uncheck all the group boxes function checkAll(){ if(document.enquire.allGroups.checked){ for(var i=0;i