



function checkdata() {

var ferror;




params = "Name=" + document.form.Name.value;
params = params + "&Email=" + document.form.Email.value;
params = params + "&Phone=" + document.form.Phone.value;
params = params + "&Company=" + document.form.Company.value;
params = params + "&Message=" + document.form.Message.value;
params = params + "&CODE=" + document.form.CODE.value;




if (document.form.Name.value === ""){
ferror=1;
document.form.Name.style.background='#FF6600';
document.form.Name.style.color='#FFFFFF';
}

if (document.form.Email.value === ""){
ferror=1;
document.form.Email.style.background='#FF6600';
document.form.Email.style.color='#FFFFFF';
}
if (document.form.Company.value === ""){
ferror=1;
document.form.Company.style.background='#FF6600';
document.form.Company.style.color='#FFFFFF';
}
if (document.form.Phone.value === ""){
ferror=1;
document.form.Phone.style.background='#FF6600';
document.form.Phone.style.color='#FFFFFF';
}
if (document.form.Message.value === ""){
ferror=1;
document.form.Message.style.background='#FF6600';
document.form.Message.style.color='#FFFFFF';
}
if (document.form.CODE.value === ""){
ferror=1;
document.form.CODE.style.background='#FF6600';
document.form.CODE.style.color='#FFFFFF';
}

if (ferror===1){
document.getElementById('checking').innerHTML="<font color=#FF6600><b>You forget to fill in the form</b></font>";
document.form.submitbutton.disabled=false;
return false;
}




document.getElementById('checking').innerHTML="sending data..";

scriptoget="getintouch.cgi";

	try {
    http = new XMLHttpRequest();
  } catch(e) {
    try {
        http = new ActiveXObject("Msxml2.XMLHTTP");
    } catch(e) {
        http = new ActiveXObject("Microsoft.XMLHTTP");
    }
  }

toget = scriptoget + "?" + params;

http.open("GET", toget , true);



http.onreadystatechange=function()

{
	
	

	if (http.readyState===4) 

{
 

		
 
 
		if ( http.responseText === "OK" ){
 		document.getElementById('checking').innerHTML="<font color=#FF6600><b>"+document.form.Name.value+", Your message has been sent. Thank you!</b></font>";
		
		alert(document.form.Name.value+", Your message has been sent. Thank you!");
		window.location="./";
 		}
  
  
   		else if ( http.responseText === "InvalidCode" )  {
 		document.getElementById('checking').innerHTML="<font color=#FF6600><b>Invalid Security Code";
 		document.form.CODE.style.background='#FF6600';
		document.form.CODE.style.color='#FFFFFF';
 		}
  
  		else if ( http.responseText === "InvalidEmail" )  {
 		document.getElementById('checking').innerHTML="<font color=#FF6600><b>Invalid Email Address";
 		document.form.Email.style.background='#FF6600';
		document.form.Email.style.color='#FFFFFF';
 		}
  
 		else  
 
 		{
  		document.getElementById('checking').innerHTML="<font color=#FF6600><b>You forget to fill in the form</b></font>";
  		}
               


document.form.submitbutton.disabled=false;
} 

	

	

};

http.send(null);




}









