// JavaScript Document
var xmlHttp;

function submitForm(name,email,phone,msg)
{
	if(name=="")
	{
		alert("The name should not be empty");
		document.contact.txtName.focus();
	}
	else if(email=="")
	{
		alert("The e-Mail should not be empty");
		document.contact.txtEmail.focus();
	}
	else if(phone=="")
	{
		alert("The phone no should not be empty");
		document.contact.txtPhone.focus();
	}
	else if(msg=="")
	{
		alert("Information should not be empty","TechnoHeitz");
		document.contact.txtMessage.focus();
	}
	else
	{
		xmlHttp=GetXmlHttpObject()
		if(xmlHttp!=null)
		{
			var url="codebehind/contactus.php";
			url=url+"?name="+name;
			url=url+"&email="+email;
			url=url+"&phone="+phone;
			url=url+"&msg="+msg;
			url=url+"&sid="+Math.random();
			xmlHttp.onreadystatechange=stateChanged;
			xmlHttp.open("GET",url,true);
			xmlHttp.send(null);
		}
	}
}

function stateChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		alert(xmlHttp.responseText,"TechnoHeitz");
	} 
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}