	onload = function() {
		fShowCalendar();
	}

	function fChange(q) {
		switch(q) {
			case "forward":
				if(nMonth==11) {
					nMonth=0;
					nYear++;
				} else {
					nMonth++;
				}
			break;
			
			case "backward":
				if(nMonth==0) {
					nMonth=11;
					nYear=nYear-1;
				} else {
					nMonth--;
				}
			break;
		}
		fShowCalendar();
	}
	
	function fGoTo(n) {
		location.href = "http://www.magentov.com/course/info.asp?nId=" + n;
	}
	
	function fShowCalendar() {
    	var self = this;
    
		if (window.XMLHttpRequest) {
        	self.xmlHttpReq = new XMLHttpRequest();
    	} else if (window.ActiveXObject) {
        	self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    	}
		
    	self.xmlHttpReq.open('POST', "http://www.magentov.com/@includes/calendar.asp?rnd=" + new Date(), true);
    	self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    		self.xmlHttpReq.onreadystatechange = function() {
        		if (self.xmlHttpReq.readyState == 4) {
            		document.getElementById("dvCalendar").innerHTML = self.xmlHttpReq.responseText;
        		} else {
					document.getElementById("dvCalendar").innerHTML = "<span style=\"color:#ffffff;font-size:12px;\">טוען ...</span>";
				}
    		}
    	self.xmlHttpReq.send(getquerystring());
	}
	
	function getquerystring() {
		qstr = 'nMonth=' + nMonth + '&nYear=' + nYear; 
		return qstr;
	}