// JavaScript Document
<!-- The below script is for making sure that users enter in the required
		// information on the reviews.php page form. - 9/21/2006 Sean Meyer -->
function checkEmail(str){
				var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
				if (filter.test(str)){ return true; }else{ return false; }
			}

			function checkForm(f){
				if (f.name.value==""){
					alert("Please enter your name.");
					f.name.select();
					return false;
				}

				if (f.email.value==""){
					alert("Please enter your email address so that we may contact you back.");
					f.email.select();
					return false;
				}

				if (f.message.value==""){
					alert("Please enter your message.");
					f.message.select();
					return false;
				}

				if (checkEmail(f.email.value)==false){
					alert("Please make sure that your Email Address is a valid email.");
					f.email.select();
					return false;
				}

				return true;
			}
			
//
function checkRevForm(f) {
				 var missing = "";

				if (f.name.value == "") missing += " - Name\n";
				if (f.testimonial.value == "") missing += " - Comment\n";
 
				if (missing != "") {
					alert("Please specify the following:\n" + missing);
					return false;
				}

				return true;
			}
			
			
			
			
			
			
			
			var url = 'captcheck.php?code='; 
			var captchaOK = 2; // 2 - not yet checked, 1 - correct, 0 - failed 
			function getHTTPObject() { 
				try { 
					req = new XMLHttpRequest(); 
				} 
				catch (err1) { 
					try { req = new ActiveXObject("Msxml12.XMLHTTP"); } 
					catch (err2) { 
						try { req = new ActiveXObject("Microsoft.XMLHTTP"); } 
						catch (err3) { req = false; } 
					} 
				} 
				return req; 
			} 
			var http = getHTTPObject(); // We create the HTTP Object 
			function handleHttpResponse() { 
				if (http.readyState == 4) { 
					captchaOK = http.responseText; 
					x=document.getElementsByName("code");
					if(captchaOK != 1) { 
						alert('The entered code was not correct. Please try again');
						if(x[0].value != ''){
							x[0].value='';
							x[0].focus();
						}else{
							x[1].value='';
							x[1].focus();
						}
						//document.contactform.code.value=''; 
						//document.contactform.code.focus(); 
						return false; 
					} 
					/*if(x[0].value != '')
						document.contactus.submit();
					else
						document.contactform.submit();*/
					if(document.forms[0].code.value != '')
						document.forms[0].submit();
					else
						document.forms[1].submit(); 
				} 
			} 
			function checkcode(thecode) { 
				http.open("GET", url + escape(thecode), true); 
				http.onreadystatechange = handleHttpResponse; 
				http.send(null); 
			} 
			function checkcaptcha() { // First the normal form validation
				x=document.getElementsByName("code");
				y=document.getElementsByName("name"); 
				if(y[0].value != ''){
					if(x[0].value == '') { 
						alert('Please enter the string from the displayed image'); 
						x[0].value=''; 
						x[0].focus(); 
						return false;
					}
				}else{
					if(y[1].value != '' && x[1].value == ''){
						alert('Please enter the string from the displayed image');
						x[1].value='';
						x[1].focus();
						return false;
					}
				} // Now the Ajax CAPTCHA validation 
				if(x[0].value != '')
					checkcode(x[0].value);
				else
					checkcode(x[1].value); 
				return false; 
			} 