
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;
}


//// LIST OF FUNCTIONS FOR PROJECT - FOR SHOWING FORM
/*
sform
uform
*/

/*
///////////////staff
///////////////////////////////////////////////////
function sform()
{
			xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 

var url="sform.php"
url=url+"?projectid="+pid+"&pgid="+pgid
//url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=sformCompleted
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function sformCompleted()
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  	document.getElementById("fstatus").innerHTML=xmlHttp.responseText 
 } 
}

*/
///////////////////////////////////////////////////////////////


function uform()
{
	var fname=encodeURIComponent(document.getElementById("fname").value)
	var email=encodeURIComponent(document.getElementById("email").value)
	var mobile=encodeURIComponent(document.getElementById("mobile").value)
	var city=encodeURIComponent(document.getElementById("city").value)
	var comment=encodeURIComponent(document.getElementById("comment").value)
	var site=encodeURIComponent(document.getElementById("site").value)

////////////////// VALIDATION //////////////////////
	/// Use this below validation
	if(fname=='' || email=='' || mobile=='' || city=='*')
	{
		document.getElementById("ErrorHelp").innerHTML="<font color='red'>ENTER A VALUE</font>";	
		return
	}
//////////////////////////////////////////////////

	xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 

var url="uform.php"		
url=url+"?fname="+fname+"&email="+email+"&mobile="+mobile+"&city="+city+"&comment="+comment+"&site="+site
//url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=uformCompleted
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function uformCompleted()
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
  	document.getElementById("fstatus").innerHTML=xmlHttp.responseText
  	document.getElementById("ErrorHelp").innerHTML="";
 } 
}


