var movietimer=null;
var incount=1;
var browserName = whichBrs();
if (browserName == "Opera")
	{var oCal = new XMLHttpRequest();}
else if  (browserName == "Internet Explorer")
	{var oCal = new ActiveXObject( "Microsoft.XMLHTTP" );}
else if  (browserName == "Firefox")
	{var oCal = new XMLHttpRequest();}



function DrawCalendar(AddM,SubjectID)
{ 
var Subj="0";
var d =new Date();
try
 { Subj=SubjectID; }
catch(e)
 {}; 
var ListURL = "http://www.habama.co.il/Pages/Calendar.aspx?month="+AddM+"&r="+d.getTime()+"&Subj="+Subj;
document.getElementById("Calendar").innerHTML ="";

oCal.open( "POST", ListURL, true );
oCal.onreadystatechange = drawData;
oCal.send("<root><calendar/></root>");

}


function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}

function drawData() 
	{	
	if (oCal.readyState==4)
		{
		var s=oCal.responseText;
		document.getElementById("Calendar").innerHTML =s;	
		}
	}	
function GoEA(Subj,Area,d,m,y)
{
	if (Subj==4)
		{ document.location.href ="http://www.habama.co.il/Pages/CinemaList_Day.aspx?Subj="+Subj+"&Area="+Area+"&d="+d+"&m="+m+"&y="+y; }
	else
		{ document.location.href ="http://www.habama.co.il/Pages/EventAllforDay.aspx?Subj="+Subj+"&Area="+Area+"&d="+d+"&m="+m+"&y="+y; }
}

function GoEATlv(Subj,Area,d,m,y)
{
	if (Subj==4)
	{ 
		top.location.href ="CinemaList_Day.aspx?Subj="+Subj+"&Area="+Area+"&d="+d+"&m="+m+"&y="+y; 
	}
	else
	{ 
		top.location.href ="EventAllforDay.aspx?Subj="+Subj+"&Area="+Area+"&d="+d+"&m="+m+"&y="+y; 
	}
}

	
