// JavaScript Document
function update_cal(newdate)
{ 	//alert("Test");
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Din nettlesar støttar ikkje AJAX");
	  return;
	  } 
	var url="standalone.php?m=14";


	var params = "dato="+newdate+"&body=0";
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	
	xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			teksten = xmlHttp.responseText;
			//alert(teksten);
			document.getElementById('calender').innerHTML = teksten;
		}
	}
	xmlHttp.send(params);
}

function vis_info(kal_date){
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Din nettlesar støttar ikkje AJAX");
	  return;
	  } 
	var url="standalone.php?m=14";


	var params = "infodate="+kal_date+"&info=1";
	xmlHttp.open("POST", url, true);
	
	//Send the proper header information along with the request
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	
	xmlHttp.onreadystatechange = function() {//Call a function when the state changes.
		if(xmlHttp.readyState == 4 && xmlHttp.status == 200) {
			teksten = xmlHttp.responseText;
			//alert(teksten);
			document.getElementById('kalenderinfo').innerHTML = teksten;
		}
	}
	xmlHttp.send(params);
	}