
			var xmlHttpHeader
			function fn_send_fields()
			{ 
				if (document.getElementById("txtname").value=="")
				{
					document.getElementById("txtname").style.backgroundColor="#FF0000";
					alert("Please fill your Name");
					return(false);
				}
				
				if (document.getElementById("txtemail").value=="")
				{         
						 msg="Please fill in your Email Address";
						 document.getElementById("txtemail").style.backgroundColor="#FF0000";
						 alert(msg);
						 return(false);
				}   
				else
				{
					/* Email Validation Start*/
					var str
					str=document.getElementById("txtemail").value;
					var at="@"
					var dot="."
					var lat=str.indexOf(at)
					var lstr=str.length
					var ldot=str.indexOf(dot)
					if (str.indexOf(at)==-1)
					{
					   alert("Please fill in your Valid Email Address")
					   return(false);
					}
			
					if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
					{
					   alert("Please fill in your Valid Email Address")
					   return(false);
					}
			
					if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
					{
						alert("Please fill in your Valid Email Address")
					   return(false);
					}
			
					 if (str.indexOf(at,(lat+1))!=-1)
					 {
						alert("Please fill in your Valid Email Address")
						return(false);
					 }
			
					 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
					 {
						alert("Please fill in your Valid Email Address")
						return(false);
					 }
			
					 if (str.indexOf(dot,(lat+2))==-1)
					 {
						alert("Please fill in your Valid Email Address")
						return(false);
					 }
					
					 if (str.indexOf(" ")!=-1)
					 {
						alert("Please fill in your Valid Email Address")
						return(false);
					 }
					 /* Email Validation End*/
					}
	
				if (document.getElementById("txtphone").value=="" )
				{
					document.getElementById("txtphone").style.backgroundColor="#FF0000";
					alert("Please fill your Phone Number");
					return(false);
				}
				
				if (document.getElementById("txtcity").value=="")
				{
					document.getElementById("txtcity").style.backgroundColor="#FF0000";
					alert("Please fill your City");
					return(false);
				}
				if (document.getElementById("cboservices").value=="")
				{
					document.getElementById("cboservices").style.backgroundColor="#FF0000";
					alert("Please select the Services");
					return(false);
				}
				
				
				//Sending
				document.getElementById("divmessage").innerHTML="<font class='txtredmessage'>Sending ...</font>";
				//
				str=document.getElementById("txtname").value;
				var url="ajax-quickcontact.php"
				url=url+"?name="+document.getElementById("txtname").value+"&email="+document.getElementById("txtemail").value;
				url+="&phone="+document.getElementById("txtphone").value+"&mobile="+document.getElementById("txtmobile").value;
				url+="&city="+document.getElementById("txtcity").value+"&services="+document.getElementById("cboservices").value;
				url+="&others="+document.getElementById("txtothers").value;				
				//xmlHttp.onreadystatechange=stateChanged;
				xmlHttpHeader=GetXmlHttpObjectHeader(stateChangedheader)
				xmlHttpHeader.open("GET", url , true)
				xmlHttpHeader.send(null)
				document.getElementById("Submit").disabled=true;
				document.getElementById("txtname").value="";
				document.getElementById("txtemail").value="";
				document.getElementById("txtphone").value="";
				document.getElementById("txtmobile").value="";
				document.getElementById("txtcity").value="";
				document.getElementById("txtothers").value="";
			
			} 

			function stateChangedheader() 
			{ 
				if (xmlHttpHeader.readyState==4 || xmlHttpHeader.readyState=="complete")
				{ 
					document.getElementById("divmessage").innerHTML=xmlHttpHeader.responseText 
				} 
			} 
			


function fn_ajax_changecolor()
{
	document.getElementById("txtname").style.backgroundColor="#FFFFFF";
	document.getElementById("txtemail").style.backgroundColor="#FFFFFF";
	document.getElementById("txtphone").style.backgroundColor="#FFFFFF";
	document.getElementById("txtcity").style.backgroundColor="#FFFFFF";
	document.getElementById("cboservices").style.backgroundColor="#FFFFFF";
	
}


function GetXmlHttpObjectHeader(handler)

{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
}


