// JavaScript Document
var xmlHttp;
function getXmlHttpObject(){
	var objXMLHttp=null;
	if(window.XMLHttpRequest){
 		objXMLHttp=new XMLHttpRequest();
 	}else if(window.ActiveXObject){
 		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
 	}
 	return objXMLHttp;
}
//-----------Start Get Schedule-----------------------------------------------------------------
function getSchedule(date){
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null){
		alert("You are using a too old browser. Please update the browser.");
		return;
	}else{
		var url="addons/day_info_"+date+".php";
		xmlHttp.onreadystatechange=setSchedule;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);		
	}
}
function setSchedule(){
	if(xmlHttp.readyState!=4){
		document.getElementById("day_info").innerHTML='Getting schedule...';	
	}
	if(xmlHttp.readyState==4){		
	document.getElementById("day_info").innerHTML=xmlHttp.responseText;		
	}
}
//-----------End Get Schedule------------------------------------------------------------------
//-----------Start Get videos-----------------------------------------------------------------
function getVideos(id){
	xmlHttp=getXmlHttpObject();
	if(xmlHttp==null){
		alert("You are using a too old browser. Please update the browser.");
		return;
	}else{
		var url="addons/day_info_"+date+".php";
		xmlHttp.onreadystatechange=setVideos;
		xmlHttp.open("POST",url,true);
		xmlHttp.send(null);		
	}
}
function setVideos(){
	if(xmlHttp.readyState!=4){
		document.getElementById("day_info").innerHTML='Loading list of videos...';	
	}
	if(xmlHttp.readyState==4){		
	document.getElementById("day_info").innerHTML=xmlHttp.responseText;		
	}
}
//-----------End Get videos------------------------------------------------------------------