function validatequote(){
	if(document.getElementById('txtname').value==''){
		alert("Please enter your name");
		document.getElementById('txtname').focus();
		return false;
	}else if(!(CheckAlphabet(document.getElementById('txtname').value))){
		alert ("Please enter valid full name");
		document.getElementById('txtname').focus();
		return false;
	}
	if(document.getElementById('txtcompany').value==''){
		alert("Please enter your company name");
		document.getElementById('txtcompany').focus();
		return false;
	}
	if(document.getElementById('txtemailid').value==''){
		alert("Please enter email address");
		document.getElementById('txtemailid').focus();
		return false;
	}else if((document.getElementById('txtemailid').value.indexOf("@") < 3 )){
		alert("Please enter correct email address");
		document.getElementById('txtemailid').focus();
		return false;
	}
	var txtname=document.getElementById('txtname').value;
	var txtcompany=document.getElementById('txtcompany').value;
	var txtemailid=document.getElementById('txtemailid').value;
	var txturl=document.getElementById('txturl').value;
	var txttype=document.getElementById('txttype').value;
	var txtcomments=document.getElementById('txtcomments').value;
	var txtkey=document.getElementById('txtkey').value;
	//showLoader();
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
		}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			document.getElementById("quotehint").innerHTML=xmlhttp.responseText;
			//hideLoader();
		}
	}
	xmlhttp.open("GET","quickform.php?txtname="+txtname+"&txtcompany="+txtcompany+"&txtemailid="+txtemailid+"&txturl="+txturl+"&txttype="+txttype+"&txtcomments="+txtcomments+"&txtkey="+txtkey,true);
	xmlhttp.send();
}

function CheckAlphabet(character) {
	var valid = 1
	character=character.toUpperCase();
	var GoodChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ. "
	var GoodChars1 = " "
	var i = 0
	if (character=="") {
		// Return false if number is empty
		valid = 0
	}
	for (i =0; i <= character.length -1; i++) {
		if (GoodChars.indexOf(character.charAt(i)) == -1) {
			// Note: Remove the comments from the following line to see this
			// for loop in action.
			// alert(character.charAt(i) + " is no good.")
			valid = 0
		} // End if statement
	} // End for loop
	return valid
}
function IsValid( oField ){
	if (oField.name=='txtemailid'){
		re = /^(([a-z\._\-0-9])+\@([a-z\._\-0-9])+\.([a-z])+)?$/i;
		$sMsg = "E-Mail is invalid.\E-Mail should be in user@domain.com format."
	}
	if(!re.test(oField.value) ){
		alert( $sMsg );
		oField.value = '';
		oField.focus();
		return false;
	}
}
function CheckDigits(TheNumber) {
	var valid = 1
	var GoodChars = "0123456789-+() "
	var i = 0
	if (TheNumber=="") {
		// Return false if number is empty
		valid = 0
	}
	for (i =0; i <= TheNumber.length -1; i++) {
		if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {
			// Note: Remove the comments from the following line to see this
			// for loop in action.
			// alert(TheNumber.charAt(i) + " is no good.")
			valid = 0
		} // End if statement
	} // End for loop
	return valid
}
function showLoader(){
	document.getElementById('voteloading').style.display='block';
}
function hideLoader(varid){
	document.getElementById('voteloading').style.display='none';

}
