var xmlHttp

function noenter(event) {

     if (event.which==13) return false;
  return !(window.event && window.event.keyCode == 13);
  }


function showCourses(str)
{ 


//alert(window.location);

//-----------------------------------------------------------------------------------
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 

 if (str.length!=0)
 {
	/*var url="getclubs";*/
	var url="index.php?id=4";
	/*url=url+"?u="+str;*/
	url=url+"&u="+str;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged ;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	document.getElementById("resultsWrapper").style.display="block";
 }
 else {
	document.getElementById("clubList").innerHTML="";
 	//document.getElementById("resultsWrapper").style.display="none";
 }
}



function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("clubList").innerHTML=xmlHttp.responseText 
 } 
}


//-----------------------------------------------------------------------------------
function showDetail(str)
{ 

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 
 if (str>0)
 {
/*var url="getdetail";*/
var url="index.php?id=5";
/*url=url+"?u="+str;*/
url=url+"&u="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangeClub ;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

 }
}



function stateChangeClub() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("clubDetail").innerHTML=xmlHttp.responseText 
 } 
}




//-----------------------------------------------------------------------------------
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 ajaxcoordupdate(clubid,lat,lng) {

xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 
 if (clubid>0)
 {

var url="updatecoord";
url=url+"?clubid="+clubid;
url=url+"&lat="+lat;
url=url+"&lng="+lng;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangeCoord ;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

 }
	
}

function stateChangeCoord() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
alert('Updated');
 } 
}

/*
function setSearchbox(){
	win	
	


}
*/

