  var xmlHttp
	var divID
 

  	
	function ajx(url,id,val)
	{   
		tscat=id;
		//var prentObj=document.getElementById('city_show');
		//var oldSelect=document.getElementById('city');
		
		//prentObj.removeChild(oldSelect);
		
		//var newobj = document.createElement('select');
		//newobj.name = 'city';
		//newobj.setAttribute('id', 'city');
		//newobj.setAttribute('name', 'city');
		//newobj.style.width=273+'px';
		//newobj.style.height=25+'px';
		//newobj.style.margin=5+'px';
		//prentObj.appendChild(newobj);
		document.getElementById('city1').value='';
		
		 
		if(val=='') return false;
		
		document.getElementById(tscat).innerHTML="<img src='images/loading_transparent.gif' >";
 	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		xmlHttp.onreadystatechange=ajxshow
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function ajxshow() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
 		 document.getElementById(tscat).innerHTML=xmlHttp.responseText;
		 document.getElementById('state1').value=document.getElementById('state').value;
		 document.getElementById('city1').value=document.getElementById('city').value;
		
		} 
	}
	
		function ajx_search(url,id,val)
	{   
		 
		tscat=id;
		
		//var prentObj=document.getElementById('city_show');
		//var oldSelect=document.getElementById('city');
		
		//prentObj.removeChild(oldSelect);
		
		//var newobj = document.createElement('select');
		//newobj.name = 'city';
		//newobj.setAttribute('id', 'city');
		//newobj.setAttribute('name', 'city');
		//newobj.style.width=211+'px';
		//newobj.style.height=20+'px';
		//newobj.style.margin=5+'px';
		//prentObj.appendChild(newobj);
		document.getElementById('city1').value='';
		
		 
		if(val=='') return false;
		
		document.getElementById(tscat).innerHTML="<img src='images/loading_transparent.gif' >";
 	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		xmlHttp.onreadystatechange=ajxshow_search
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function ajxshow_search() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
 		 document.getElementById(tscat).innerHTML=xmlHttp.responseText;
		 document.getElementById('state1').value=document.getElementById('state').value;
		 document.getElementById('city1').value=document.getElementById('city').value;
		} 
	}
	
	
	
 //#####################################suresh#########################################
 	
	function showMrina(stateid,mailto)
	{   
		alert(mailto);  
		document.getElementById('marina_list').innerHTML="<img src='images/loading_transparent.gif' >";
		
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}
		
		var url='showMrina.php?stateId='+stateid;
		xmlHttp.onreadystatechange=showMrinaStatechange
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function showMrinaStatechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		
		 document.getElementById('marina_list').innerHTML=xmlHttp.responseText;
 		 		 
		} 
	}
	
		function showdiv_complete(url,divid)
	{   
		
		divID=divid
		
		 		document.getElementById(divID).innerHTML="<img src='images/ajax_loader_transparent.gif'>";
		
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return false;
		}
		
		//var url='showMrina.php?stateId='+stateid;
		xmlHttp.onreadystatechange=showdiv_completeStatechange
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function showdiv_completeStatechange() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 document.getElementById(divID).innerHTML=xmlHttp.responseText;
 		 		 
		} 
	}
		
		
		
		
		function showdiv_complete_list(url,divid)
	{   
		
		divID=divid
		document.getElementById(divID).innerHTML="<img src='images/ajax_loader_transparent.gif'>";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return false;
		}
		
		//var url='showMrina.php?stateId='+stateid;
		xmlHttp.onreadystatechange=showdiv_completeStatechange_country
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function showdiv_completeStatechange_country() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 document.getElementById(divID).innerHTML=xmlHttp.responseText;
 		 		 
		} 
	}
		
		
		
		
			
		function showdiv_complete_state_list(url,divid)
	{   
		
		divID=divid
		document.getElementById(divID).innerHTML="<img src='images/ajax_loader_transparent.gif'>";
	   	xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return false;
		}
		
		//var url='showMrina.php?stateId='+stateid;
	
		xmlHttp.onreadystatechange=showdiv_completeStatechange_state
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}	
	
	
	function showdiv_completeStatechange_state() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 document.getElementById(divID).innerHTML=xmlHttp.responseText;
 		 		 
		} 
	}
		
		
		function GetXmlHttpObject()
	{ 
	var objXMLHttp=null
	 if (window.ActiveXObject)
	{
	objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	
	else if (window.XMLHttpRequest)
	{
	objXMLHttp=new XMLHttpRequest()
	}else
	{
		objXMLHttp=new ActiveXObject("Msxml2.XMLHTTP")
	}
	return objXMLHttp
	}
	
	function add_favourite(s_id,m_id){
		
		if(s_id==''){
         alert("please Login!!");
         return ;
         }
		
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request")
			return
		}

        
		var url='add_favourite.php?m_id='+m_id+'&s_id='+s_id;
		xmlHttp.onreadystatechange=showFavoriteState
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		
		}
		
	function showFavoriteState() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		 alert(xmlHttp.responseText)
 		} 
	}
function check_login(basepath,s_id,m_id){
location.href  = basepath+'review/'+m_id+'/write/';
}
function show_other(show,remove)
	{
		
		document.getElementById("city").value="";
		document.getElementById(show).style.display='';
		document.getElementById(remove).style.display='none';
	}