String.prototype.trim1 = 
 function trimblanks() { return this.split(/\s/).join(''); };
var xmlHttp
function callme(a)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="display.php?id="+a;
//alert(url);
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState== 200)
 { 
	 //alert(xmlHttp.responseText);
 document.getElementById("one").innerHTML=xmlHttp.responseText 
 } 
 else{
	   
 }
}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;
}

function validate(){
	//alert(document.getElementsByName("zip")[0].value);
		if(document.getElementsByName("project1")[0].value.trim1() == '' )
{
	alert("Please Select Your Project?");
	document.getElementsByName("project1")[0].focus();
	return false;
	}
//alert(document.getElementsByName("type_of_work")[0].value.trim1());
if(document.getElementsByName("type_of_work")[0].value.trim1() == '' )
{
	alert("Please Select Type Of Work");
	document.getElementsByName("type_of_work")[0].focus();
	return false;
	}

		if(document.getElementsByName("zip")[0].value == 'Zip' || document.getElementsByName("zip")[0].value.trim1()=="" ||document.getElementsByName("zip")[0].value == 'Zip Code')
{
	alert("Please Enter Zip Code");
    document.getElementsByName("zip")[0].select();
	document.getElementsByName("zip")[0].focus();
	return false;
	}
if(!(document.getElementsByName("zip")[0].value==""))
	{
	zipval=document.getElementsByName("zip")[0].value
var zipPat=/^\d{5}$/;
var matchArray = zipval.match(zipPat);
if(!zipPat.test(zipval))
{
	   alert("Please Enter a Valid Zip Number ");
	 document.getElementsByName("zip")[0].focus();
	  document.getElementsByName("zip")[0].select();
     return false;

}	}document.frm1.action="magic_insert.php?project="+document.getElementsByName("type_of_work")[0].value.replace("&","12and00");
document.frm1.method="post";
document.frm1.submit();
}