function validate_quickform()
{
  if(document.frmContact.quickName.value=="" || document.frmContact.quickName.value=="Name")
  {
  alert("Please enter name");
  document.frmContact.quickName.focus();
  return false;
  }

  if(document.frmContact.quickEmail.value=="" || document.frmContact.quickEmail.value=="Email address")
  {
  alert("Please enter email address");
  document.frmContact.quickEmail.focus();
  return false;
  }
  
  if(validate_email(document.frmContact.quickEmail,"Invalid email address! Please re-enter!")==false)
  {
  document.frmContact.quickEmail.select();
  document.frmContact.quickEmail.focus();
  return false;
  }
  
  if(document.frmContact.quickPhone.value=="" || document.frmContact.quickPhone.value=="Phone number")
  {
  alert("Please enter your phone number!");
  document.frmContact.quickPhone.focus();
  return false;
  }
  
  if(IsNumeric(document.frmContact.quickPhone.value)==false)
  {
  alert("Invalid phone number! Please re-enter!");
  document.frmContact.quickPhone.select();
  document.frmContact.quickPhone.focus();
  return false;
  }
  
  if(document.frmContact.quickComments.value=="" || document.frmContact.quickComments.value=="Comments")
  {
  alert("Please enter comments");
  document.frmContact.quickComments.focus();
  return false;
  }
  if(document.frmContact.quickCode.value=="" || document.frmContact.quickCode.value=="Code" )
  {
  alert("Please enter code");
  document.frmContact.quickCode.focus();
  return false;
  }
var name	 = document.frmContact.quickName.value;
var email	 = document.frmContact.quickEmail.value;
var phone	 = document.frmContact.quickPhone.value;
var comments = document.frmContact.quickComments.value;
var code	 = document.frmContact.quickCode.value;
authenticate_contact1(name,email,phone,comments,code)
return true;
//document.frmContact.submit();
}

function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
function authenticate_contact1(nameVal1,emailVal1,phoneVal1,commentsVal1,codeVal1) {		

	//var strURL="http://localhost/works/sdk/mails/quickmail.php?quickname="+nameVal1+"&quickemail="+emailVal1+"&quickcomments="+commentsVal1+"&quickphone="+phoneVal1+"&quickcode="+codeVal1;
	var strURL="http://www.shafidawakhana.com/mails/quickmail.php?quickname="+nameVal1+"&quickemail="+emailVal1+"&quickcomments="+commentsVal1+"&quickphone="+phoneVal1+"&quickcode="+codeVal1;
		var req = getXMLHTTP();
		//alert(thisVal1)
			if (req) {
				//document.getElementById('listClientDetails').style.display='block';
				req.onreadystatechange = function() {
					if (req.readyState == 4) {
						// only if "OK"
						if (req.status == 200) {	
						 	if(req.responseText.match(/^OK/) != null) {
        					// alert('Your message has been sent!');  
							
							//window.location="http://localhost/works/sdk/thanks.php";
							window.location="http://www.shafidawakhana.com/thanks.php";
         
        					} else {
          					alert(req.responseText);
							document.frmContact.quickCode.select();
        					}
														
						} else {
							alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						}
					}				
				}			
				req.open("POST", strURL, true);
				//req.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
				req.send(null);
			}			
		
	} 

