var url = "contact-submit.php"; // The server-side script
/*function handleHttpResponse() {
  if (http.readyState == 4) {
    results = http.responseText;
	if(results=="success")
	{
	document.contactForm.reset();
	document.getElementById('thank.html').style.display = 'block';
	document.getElementById('thank.html').innerHTML = "block";
	setTimeout("timedCount()", 10000);
	}
	else
		{
		document.getElementById('thankyou').style.display = 'block';
		document.getElementById('thankyou').innerHTML = "<p>The Form Not able to Successfully Send due to server Problem, Please Try Later.</p>";
		setTimeout("timedCount()", 10000);
		}
  }
}
var http; // We create the HTTP Object

function SendEmailData(email_form) {
	http = getHTTPObject();
	var form_var="fo=1" ;
	for(i=0; i<email_form.elements.length; i++)
	{
		form_var = form_var + "&" + email_form.elements[i].name + "=" + email_form.elements[i].value ;
	}
	http.onreadystatechange = handleHttpResponse;
	http.open("POST", url, true);
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send(form_var);
	document.getElementById('thankyou').style.display = 'block';
	document.getElementById('thankyou').innerHTML="<p>Sending The Data... Wait Please!</p>" ;
 }
function getHTTPObject() {
  var xmlhttp;
 @cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}


// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}
function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
function checkInternationalPhone(strPhone){
var bracket=3
strPhone=trim(strPhone)
if(strPhone.indexOf("+")>1) return false
if(strPhone.indexOf("(")!=-1 && strPhone.indexOf(")")==-1)return false
if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}


function timedCount(){
	document.getElementById('thankyou').innerHTML = '';
	document.getElementById('thankyou').style.display='none';
}*/


function checkForm(enquiry_form)

{		
	//var form = enquiry_form;

	if(enquiry_form.name.value=="")
	{
		alert("Please Enter Your First Name") ;
		enquiry_form.name.focus() ;
		return false;
	}	
	/*if(enquiry_form.organi.value=="")
	{
		alert("Please Enter Your Organization") ;
		enquiry_form.organi.focus() ;
		return false;
	}*/
	
	if(enquiry_form.email=="")
	{
		alert("Please Enter Your Email ID!") ;
		enquiry_form.email.focus() ;
		return false;
	}
		if (!enquiry_form.email.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/))
		{
			alert("Please enter a valid E-mail ID!");
			enquiry_form.email.focus();
			enquiry_form.email.value = '';
			return false;
		}
	/*if ((enquiry_form.phone.value==null)||(enquiry_form.phone.value=="")){
		alert("Please Enter a Valid Phone Number");
		enquiry_form.phone.focus();
		return false
	}
	if (isNaN(enquiry_form.phone.value)==true){
		alert("Please Enter a Valid Phone Number");
		enquiry_form.phone.focus();
		enquiry_form.phone.value = '';
		return false
	}
	if(enquiry_form.address1.value=="")
	{
		alert("Please Enter Your First Address") ;
		enquiry_form.address1.focus() ;
		return false;
	}
	if(enquiry_form.address2.value=="")
	{
		alert("Please Enter Your Second Address") ;
		enquiry_form.address2.focus() ;
		return false;
	}
	if(enquiry_form.city.value=="")
	{
		alert("Please Enter Your City Name") ;
		enquiry_form.city.focus() ;
		return false;
	}
	if(enquiry_form.postcode.value=="")
	{
		alert("Please Enter Your Postal code") ;
		enquiry_form.postcode.focus() ;
		return false;
	}
   if(enquiry_form.massege.value=="")
	{
		alert("Please Enter Your Massege") ;
		enquiry_form.massege.focus() ;
		return false;
	}	*/
	
	SendEmailData(enquiry_form); 
	return false;

}




