
if(document.getElementsByTagName){var $link_element=document.createElement('link');$link_element.setAttribute("rel","stylesheet");$link_element.setAttribute("href","./js/enquiry.css");$link_element.setAttribute("media","screen");var $head_element=document.getElementsByTagName('head')[0];$head_element.appendChild($link_element);}
function DoMagic(){if(!document.getElementsByTagName)return false;document.getElementById("phone").onkeypress=PhoneNum;document.getElementById("askphone").onkeypress=PhoneNum;var catform=document.forms['enquiryform'];var catsubmit=catform.submit;catsubmit.onclick=function(){catsubmit.value="Wait...";if(catform.name.value==""){alert('Please enter your name');catform.name.focus();catform.name.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.name.style.border=bnorm;}
if(catform.street.value==""){alert('Please enter your street');catform.street.focus();catform.street.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.street.style.border=bnorm;}
if(catform.town.value==""){alert('Please enter your town/city');catform.town.focus();catform.town.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.town.style.border=bnorm;}
if(catform.zip.value==""){alert('Please enter your zip/postal code');catform.zip.focus();catform.zip.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.zip.style.border=bnorm;}
if((catform.country.value=="")&&(catform.countrytwo.value=="")){alert('Please enter your country');catform.country.focus();catform.country.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.zip.style.border=bnorm;}
if(catform.email.value==""){alert('Please enter your email address');catform.email.focus();catform.email.style.border="1px solid red";catsubmit.value="Try again";catsubmit.disabled=false;return false;}else{catform.email.style.border=bnorm;}}
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;}}}
var links=document.getElementsByTagName("a");for(var i=0;i<links.length;i++){if(links[i].className.match("list")){links[i].onclick=function(){document.getElementById("infopack").style.display="none";document.getElementById("advice").style.display="none";var divId=this.getAttribute("href");var divvy=/(#)(.*)/;var result=divId.match(divvy);var divshow=result[2];var e=document.getElementById(divshow);if(e.style.display=='none')
e.style.display='block';window.scrollTo(0,600);var catform=document.forms['enquiryform'];var askform=document.forms['askform'];if(divshow=='infopack'){catform.salutation.focus();}
if(divshow=='advice'){askform.askname.focus();}
return false;}}}}
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 createRequestObjectShare(){var request;if(!request){try{request=new XMLHttpRequest();clink=true;}
catch(e){try{request=new ActiveXObject('MSXML2.XMLHTTP');clink=true;}
catch(e){try{request=new ActiveXObject('Microsoft.XMLHTTP');clink=true;}
catch(e)
{clink=false;return false;}}}}
return request;}
var httpshare=createRequestObjectShare();function ShareMe(){if(!document.getElementById('share')){return false;}
var share=document.getElementById('share');share.onclick=function(){var sharex=1;ShareFadeIn();function ShareFadeIn(){var content=document.getElementById('page');try{content.style.opacity=sharex;}catch(e){}
try{content.style.MozOpacity=sharex;}catch(e){}
var opacy=sharex*100;try{content.style.filter='alpha(opacity='+opacy+')';}catch(e){}
try{content.style.KhtmlOpacity=sharex;}catch(e){}
sharex-=0.05;sharex=sharex.toFixed(2);if(sharex>=0.20){setTimeout(ShareFadeIn,10);}else{share.style.display="block";}}
httpshare.open('get','http://www.picotech.com/cgi-bin/share.pl');httpshare.onreadystatechange=HandleShare;httpshare.send(null);return false;}}
function HandleShare(){if(httpshare.readyState==1){var response='<div class="c gap"><img src="http://www.picotech.com/images/loading.gif" width="32" height="32" alt="" /> &#160; Loading...</div>';document.getElementById('shareme').innerHTML=response;var lefty=(screen.availWidth-400)/2;var sharemez=document.getElementById('shareme');sharemez.style.display='block';sharemez.style.position='absolute';sharemez.style.left=lefty+'px';sharemez.style.top='120px';sharemez.style.width='300px';sharemez.style.background='#fff';}
if(httpshare.readyState==4){var response=httpshare.responseText;document.getElementById('shareme').innerHTML=response;var lefty=(screen.availWidth-400)/2;var sharemez=document.getElementById('shareme');sharemez.style.display='block';sharemez.style.position='absolute';sharemez.style.left=lefty+'px';sharemez.style.top='120px';sharemez.style.width='300px';sharemez.style.background='#fff';if(document.getElementById("sharecloseform")){var sharecloseform=document.getElementById("sharecloseform");sharecloseform.onclick=function(){var sharez=0.05;ShareFadeOut();function ShareFadeOut(){var content=document.getElementById('page');try{content.style.opacity=sharez;}catch(e){}
try{content.style.MozOpacity=sharez;}catch(e){}
var opacy=sharez*100;try{content.style.filter='alpha(opacity='+opacy+')';}catch(e){}
try{content.style.KhtmlOpacity=sharez;}catch(e){}
sharez+=0.05;if(sharez<1){setTimeout(ShareFadeOut,10);}}
document.getElementById('shareme').style.display='none';}}
if(document.forms['shareform']){var shareform=document.forms['shareform'];var submitshare=shareform.sharesubmit;submitshare.onclick=function(){submitshare.value="Wait...";}}}}
defaultStatus='Pico Technology PC oscilloscopes and data acquisition products';window.onload=StartUp;function StartUp(){DoMagic();Search();ShareMe();}