function submit_request() { 
 var name = document.getElementById('name').value;
 var email = document.getElementById('email').value;
 var message = document.getElementById('message').value;


if ( (name == 'Your Name:') || (message == '') ) { 
   alert('Required Value Missing. Fill up All the field and try again.');
   return;
 }
// var stremail = email;
// var emailchar = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
// if (!(emailchar.test(stremail))) {
 //  alert('Invalid E-Mail Address. Please check the E-Mail Address and try again.');
  // return;
//}
 
 
 req_res = (window.XMLHttpRequest ? new XMLHttpRequest(): ((window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : null) );
 if (req_res) { 
    document.getElementById('indicator').innerHTML = '<img src="./images/indicator.gif" border="0" />Processing...Please Wait A Moment.....';
	req_res.onreadystatechange = state_change;
    req_res.open("POST",'emailsend.php',true);
	req_res.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	req_res.send('name='+name+'&email='+email+'&message='+message);
 }

} // end function

function state_change() {
 if ( req_res.readyState == 4 ) {
    if (req_res.status == 200) {
	  if(req_res.responseText == 'done') { 
        document.getElementById('indicator').innerHTML = 'Your Enquiry is sent successfully. We will get back to you as soon as possible.';
	  }	
	  else if (req_res.responseText == 'error') {
	      document.getElementById('indicator').innerHTML = '';
		  alert('Sorry but not possible to send the email this time. Please try later.'); 
	   }
	}
 }	
}
