		
//################################# HEADER SECTION ######################################################
	
	function null_values(search_val)
	{
			if(document.getElementById("search").value=='Enter keyword here')
			{
				
				document.getElementById("search").value='';
				return false;
				
			}
			else if(document.getElementById("search").value=='')
			{
				document.getElementById("search").value='Enter keyword here';
				return false;
			}
			
	}
	   
//########################## LEFT INNER SECTION ###########################################################
	   
	   function submitform()
	   {
	   document.myform.submit();
	   }
//################################### RESET FORM ###########################################################	   
	   function resetform()
	   {
		  document.myform.reset();
	   }
//#################################### BACK PAGE ############################################################	   
	   function backpage()
	   {
		  document.history.go(-1);   
	   }
	   
	   
//####################### Ajax for County & Town ###########################################################
	
		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 call for town and county ##############################################################	
	function show()
	{
		xmlHttp=GetXmlHttpObject();
		if(xmlHttp==null)
		{
			alert("Your browser does not support AJAX!");
			return;
		}
		var str="";
		var temp= new Array();
		temp=document.myform.elements['country[]'];
		var status1=document.getElementById("country_status1");
		var status2=document.getElementById("country_status2");
		if(status1.checked)
		{
			var status= status1.value;
		}
		else if(status2.checked) 
		{
			var status=status2.value;	
		}
		for (j = 0; j < temp.length; j++)
		{
			if(temp[j].selected==true)
			{
				str+=j+",";
			}
		}
		var url="ajax-php/town.php";
		url=url+"?q="+str+"&status="+status;
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	function stateChanged() 
	{ 
		var i;
		if (xmlHttp.readyState==4)
		{	
			  var str=xmlHttp.responseText;
			  //alert(str);
			  arr=str.split(",");
			  
			  document.myform.elements['town[]'].length=0;
			
			  for(i=0;i<arr.length;i++)
			  {
					addOption(document.myform.elements['town[]'],arr[i]);
			  }
		}
	}
	
	
	function addOption(selectbox,text)
	{
	 var optn = document.createElement("OPTION");
	 optn.text = text;
	 selectbox.options.add(optn);
	}

//##################################################################################################################
	function func()
	{
		document.getElementById('search_but').value="aaa";	alert(document.getElementById('search_but').value);
	}
//################################### FOR ADVANCED SEARCH PAGE #####################################################
//####################################AJAX FOR TOWN INFORMATION FIELD###############################################

	function putval(val)
	{
		document.getElementById("town1").value=val;
		document.getElementById("town2").value=val;
		 xmlHttp=GetXmlHttpObject()
		 if (xmlHttp==null)
		 {
			alert ("Your browser does not support AJAX!");
			return;
		 }
		 else
		 {
		       xmlHttp.onreadystatechange=zengo101;
			   url="ajax-php/adv_search.php?value="+val+"&u="+Math.random();
			   xmlHttp.open("GET",url,true);
			   xmlHttp.send(null);
		}
    }
	function zengo101()
	{
		if(xmlHttp.readyState==4)
		{	
			//document.getElementById("msg1").innerHTML = xmlHttp.responseText;
			var a=xmlHttp.responseText;
			
		    arr=a.split("~");
		    document.getElementById("country2").value=arr[1];
			document.getElementById("town_clerk2").value=arr[2];
			document.getElementById("clerk_hours2").value=arr[3];
			document.getElementById("ups_address2").value=arr[4];
			document.getElementById("mailing_address2").value=arr[5];
			document.getElementById("office_phone2").value=arr[6];
			document.getElementById("ext2").value=arr[7];
			document.getElementById("office_fax2").value=arr[8];
			document.getElementById("email_address2").value=arr[9];
			document.getElementById("separate_treasurer2").value=arr[10];
			document.getElementById("town_website2").value=arr[11];
			document.getElementById("town_refer").innerHTML=arr[12];

		}
	}

