// 09 December 2010 ver 2.3
function check_review_data(myform){if(myform.name.value==""){alert("Please enter your name.");}else if(myform.email.value==""){alert("Please enter your email.");}else if(myform.review.value==""){alert("You don't seem to have entered a review.");}else if(myform.captcha.value==""){alert("Please enter security code.");}else{var url="./captcha/verify_captcha.cgi";verifycaptcha(myform,url);return false;}return false;}function check_search_data(myform){var sel=myform.SI.options[myform.SI.selectedIndex].value;if(sel==""){alert("Please select a search category.");}else if(myform.KW.value==""){alert("Please enter search words.");}else{return true;}return false;}function popup(mylink,windowname){if(!window.focus){return true;}var href;if(typeof(mylink)=='string'){href=mylink;}else{href=mylink.href;window.open(href,windowname,'width=550,height=150,scrollbars=no');return false;}}function getXmlHttpRequestObject(){var ajaxh;try{ajaxh=new XMLHttpRequest();}catch(e){try{ajaxh=new ActiveXObject('Msxml2.XMLHTTP');}catch(e2){try{ajaxh=new ActiveXObject('Microsoft.XMLHTTP');}catch(e3){alert("Sorry your browser doesn't seem to support Ajax.");ajaxh=null;}}}return ajaxh;}function postquery(theForm,url){var name="name"+"="+encodeURIComponent(theForm.name.value);var review="review"+"="+encodeURIComponent(theForm.review.value);var email="email"+"="+encodeURIComponent(theForm.email.value);var details="details"+"="+encodeURIComponent(theForm.details.value);var captcha="captcha"+"="+encodeURIComponent(theForm.captcha.value);var location="location"+"="+encodeURIComponent(theForm.location.value);var form="form"+"="+theForm.form.value;var stars="";for(i=0;i<5;i++){if(theForm.stars[i].checked){stars="stars"+"="+theForm.stars[i].value;}}var querystring=name+"&"+review+"&"+email+"&"+details+"&"+stars+"&"+captcha+"&"+location+"&"+form+"&"+"ajax=1";var ajaxRequest=getXmlHttpRequestObject();if(!ajaxRequest){return "false";}ajaxRequest.onreadystatechange=function(){UpdateForm(ajaxRequest);};ajaxRequest.open("POST",url,true);ajaxRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");ajaxRequest.setRequestHeader("Content-length",querystring.length);ajaxRequest.setRequestHeader("Connection","close");ajaxRequest.send(querystring);}function UpdateForm(ajaxRequest){if(ajaxRequest.readyState==4){var CaptchaResponce=ajaxRequest.responseText;if(CaptchaResponce=="fail"){document.getElementById('result').innerHTML="<p style='font-size:12px;'>The code is incorrect</p>";img=document.getElementById('Picture1');img.src='./captcha/captcha.cgi?'+Math.random();}else{document.getElementById('result').innerHTML="<p style='font-size:12px;'>Posting Review</p>";window.location.href=CaptchaResponce;}}return false;}function verifycaptcha(theForm,url){var querystring="captcha"+"="+encodeURIComponent(theForm.captcha.value);var ajaxRequest=getXmlHttpRequestObject();if(!ajaxRequest){return "false";}ajaxRequest.onreadystatechange=function(){Captcha(ajaxRequest);};ajaxRequest.open("POST",url,true);ajaxRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");ajaxRequest.setRequestHeader("Content-length",querystring.length);ajaxRequest.setRequestHeader("Connection","close");ajaxRequest.send(querystring);}function Captcha(ajaxRequest){if(ajaxRequest.readyState==4){var CaptchaResponce=ajaxRequest.responseText;if(CaptchaResponce=="fail"){document.getElementById('result').innerHTML="<p style='font-size:12px;'>The code is incorrect</p>";var img=document.getElementById('Picture1');img.src='./captcha/captcha.cgi?'+Math.random();}else{document.getElementById('result').innerHTML="<p style='font-size:12px;'>Posting Review</p>";document.COMMENTSFORM.hsh.value=CaptchaResponce;document.COMMENTSFORM.action="./postreview.pl";document.COMMENTSFORM.submit();}}return false;}function dyndiv(url,targetDiv){var ajaxRequest=getXmlHttpRequestObject();if(!ajaxRequest){return "false";}document.getElementById(targetDiv).innerHTML='please wait...';ajaxRequest.onreadystatechange=function(){LoadDiv(ajaxRequest,targetDiv);};ajaxRequest.open("GET",url,true);ajaxRequest.send(null);}function LoadDiv(ajaxRequest,targetDiv){if(ajaxRequest.readyState==4){if(ajaxRequest.status==200){var PageResponce=ajaxRequest.responseText;document.getElementById(targetDiv).innerHTML=PageResponce;}else{document.getElementById(targetDiv).innerHTML="Sorry we have a javascript error:\n";}}return false;}
