function googlemap() { 
window.open("http://maps.google.com/maps?f=q&hl=en&geocode=&q=http:%2F%2Fwww.walthour-moss.org%2Ffoundationmap9b.kml&ie=UTF8&ll=35.201446,-79.33691&spn=0.062841,0.1157&z=13","WMFMAP","fullscreen=yes, resizable=yes"); 
} 

function checklogin(){
 if(document.getElementById('uid').value.length==0){
  alert("UserId can not be blank");
  return false;
 }
 else if(document.getElementById('pwd').value.length==0){
	alert("Password can not be blank");
 	return false;
      }
return true;
}//END checklogin

//--AJAX code--//
function login(){
$uid = document.getElementById('uid').value;
$pwd = document.getElementById('pwd').value;
$url = "login.php?username=" + $uid + "&password=" + $pwd;
//	document.getElementById("content").innerHTML="Logging in....";
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XMLHTTP!");
	  return;
	  }
	xmlhttp.onreadystatechange=checkLoginResponse;
	xmlhttp.open("GET",$url,true);
//        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
//        xmlhttp.setRequestHeader("Content-length", poststr.length);
//        xmlhttp.setRequestHeader("Connection", "close");
        xmlhttp.send(null);
}

function checkLoginResponse(){
if (xmlhttp.readyState==4)
  {
   response = xmlhttp.responseText;
   if (response == 'verified')
    window.location = "http://localhost/index.php";
   else
    alert ("Invalid userid / password. Please try again!");
  //document.getElementById("content").innerHTML=response;

  }
}


function menuClick(item){
	switch (item)
	{
	case "loginform":
		$url= "loginform.html";
	  break;
	case "hours":
		$url= "hours.html";
	  break;
	case "release":
		$url = "release.php";
	  break;
	case "calendar":
		$url = "calendar.php";
	  break;
	case "notices":
		$url = "notices.php";
	  break;
	default:
	  document.write("I'm looking forward to this weekend!");
	} //switch

	document.getElementById("content").innerHTML="Loading....";
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support XMLHTTP!");
	  return;
	  }
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",$url,true);
	xmlhttp.send(null);
} //menuClick

//--Begin XMLHttpRequest--//
function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("content").innerHTML=xmlhttp.responseText;
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
//--End XMLHttpRequest--//
//--End AJAX code     --//

