
function DoMagic(){if(!document.getElementsByTagName)return false;document.getElementById("askphone").onkeypress=PhoneNum;var askform=document.forms['askform'];var asksubmit=askform.asksubmit;asksubmit.onclick=function(){asksubmit.value="Wait...";if(askform.askname.value==""){alert('Please enter your name');askform.askname.focus();askform.askname.style.border="1px solid red";asksubmit.value="Try again";asksubmit.disabled=false;return false;}else{askform.askname.style.border=bnorm;}
if((askform.askemail.value=="")&&(askform.askphone.value=="")){alert('Please enter either your email address or phone number');askform.askemail.focus();askform.askemail.style.border="1px solid red";asksubmit.value="Try again";asksubmit.disabled=false;return false;}else{askform.askemail.style.border=bnorm;}
if(askform.question.value==""){alert('Please enter your question');askform.question.focus();askform.question.style.border="1px solid red";asksubmit.value="Try again";asksubmit.disabled=false;return false;}else{askform.question.style.border=bnorm;}}
var bnorm='1px solid #CCC';var bhigh='1px solid blue';if(!document.getElementsByTagName)return false;var forminput=document.getElementsByTagName("input");for(var i=0;i<forminput.length;i++){if(forminput[i].className.match("input")){forminput[i].onfocus=function(){this.style.border=bhigh;}
forminput[i].onblur=function(){this.style.border=bnorm;}}}
var formselect=document.getElementsByTagName("select");for(var i=0;i<formselect.length;i++){if(formselect[i].className.match("input")){formselect[i].onfocus=function(){this.style.border=bhigh;}
formselect[i].onblur=function(){this.style.border=bnorm;}}}
var formtext=document.getElementsByTagName("textarea");for(var i=0;i<formtext.length;i++){if(formtext[i].className.match("input")){formtext[i].onfocus=function(){this.style.border=bhigh;}
formtext[i].onblur=function(){this.style.border=bnorm;}}}}
function PhoneNum(evt){evt=(evt)?evt:window.event;var charCode=(evt.which)?evt.which:evt.keyCode
return(charCode<=31||(charCode>=48&&charCode<=57)||(charCode==43)||(charCode==32)||(charCode==45)||(charCode==120))}
function Search(){var searchform=document.forms['search'];var submitform=searchform.ssubmit;submitform.onclick=function(){submitform.value="Wait...";if(searchform.q.value==""){alert('Please enter one or more words to search for');searchform.q.focus();searchform.q.style.border="1px solid red";submitform.value="Try again";return false;}
return true;}}
function LogoLink(){var logo=document.getElementById("logo");logo.onclick=function(){document.location.href="http://www.picotech.com/";}}
defaultStatus='Pico Technology - automotive lab scopes and diagnostic equipment';window.onload=StartUp;function StartUp(){DoMagic();Search();LogoLink();}