//<!--this js used for quick query forms-->

	function trim(str) {       
		return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
	}
	
	function checkEmail(inputvalue){	
    	var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
		if(pattern.test(inputvalue)){    
			return true;   
		}else{   
			//alert("Please enter a valid email");
			return false; 
		}
	}


function submitformQQ()
		{
		if(initContactUsQ()){
			//var name= document.getElementById("senderName1").value;
			var email= document.getElementById("email1").value;
			var contact= document.getElementById("phone1").value;
			var description= document.getElementById("message1").value;
			
			var data="ControllerHelper/SendMailAjax.php";
  
  			//data = data+"?name="+name;
			data = data+"?email="+email;
			data = data+"&contact="+contact;
			data = data+"&description="+description;
  			data = data+"&sid="+Math.random();
  			
			//this method is in the file  "js/ajax/ajaxCall.js" so include this file
		  	makeAjaxRequestQQ(data);
		}
		 else{
			 return;			 
		 }
		 
		}
	
	

	function initContactUsQ(){
		
		
		//var name= document.getElementById("senderName1").value;
		
		var email= document.getElementById("email1").value;
		var contact= document.getElementById("phone1").value;
		var description= document.getElementById("message1").value;
		
		//document.myform.mytextfield.focus();
		if(trim(email)=="" || !checkEmail(email)){
		alert("Please enter a valid email id. ");
			return false;
		}	
		else if(isNaN(contact)){
			alert("contact no. should be numeric");
			//contact.focus();
			return false;
		}
		else if(contact.charAt(0)!=9&&contact.length!=0){
			alert("Please enter a contact number starting with 9");
			//contact.focus();
			return false;
		}
		else if(contact.length!=10&&contact.length<10){
			alert("Please enter 10 digit contact number");
			//contact.focus();
			return false;
		}	
		
		else if(trim(description)==""){
			alert("Please, fill comment field");
			return false;
		}
		
		else {
			return true;
		
		}
	
		
	}
	
//<!--contact form files -->

