	initmonth = 0;
	inityear = 0;
	currentmonth = 0;
	currentyear = 0;
	upshown = 0;
	downshown = 1;
	currenttime = new Date();
	initmonth = currenttime.getMonth() + 1;
	inityear = currenttime.getYear();
	if ((inityear - 1900) < 0) inityear += 1900;
	currentmonth = initmonth;
	currentyear = inityear;
	
	if (document.images)
   	{
    	upon= new Image(50,20);
     	upon.src="Images/subtitles/Calendar/prev_over.gif";  

		upoff= new Image(50,20);
		upoff.src="Images/new/subtitles/Calendar/prev.gif";
		
		downon= new Image(50,20);
     	downon.src="Images/subtitles/Calendar/next_over.gif";  

		downoff= new Image(50,20);
		downoff.src="Images/subtitles/Calendar/next.gif";
		
		blankon= new Image(50,20);
		blankon="Images/subtitles/Calendar/blank.gif";
				
    }

	function initDate(m, y) {
	
		//initmonth = parseInt(m);
		//currentmonth = parseInt(m);
		//inityear = parseInt(y);
		//currentyear = parseInt(y);
		//document.getElementById("datediv").innerHTML=currentmonth;
		//alert("June 2008");
	}
	
	function changeMonth(delta) {	
	
		if (currentmonth < initmonth) tempmonth = currentmonth + 12
		else tempmonth = currentmonth
		tempmonth += delta;
		if (Math.abs(tempmonth - initmonth) > 1) return false;
		if (tempmonth < initmonth) return false;
		
		currentmonth += delta;
		haschanged = true;

		if (currentmonth > 12) {
			currentmonth -= 12;
			currentyear += 1;
		}
		
		if (currentmonth <= 0 && currentyear > inityear) {
			currentmonth += 12;
			currentyear -= 1;
		}
		
		else if (currentmonth <= 0 && currentyear == inityear) {
			currentmonth = 1;
			haschanged = false;
		}
		
		//document.getElementById("datediv").innerHTML=currentmonth;
		
		changeMonthImage(currentmonth);
		changeYearImage(currentyear);
		return haschanged;
	}
	
	function checkBlank() {
		if (currentmonth < initmonth) tempmonth = currentmonth + 12;
		else tempmonth = currentmonth;
		if  ((tempmonth - initmonth) >= 1) {
			makeBlank("down");
			}
		else turnoff("down");
		if (currentmonth == initmonth) {
			makeBlank("up");
		}
		else turnoff("up");
	}
	
	function makeBlank(arrow) {
		if (arrow == "up") {
			document.images['up'].src = "Images/new/subtitles/Calendar/prev.gif";
		}
		if (arrow == "down") {
			document.images['down'].src = "Images/subtitles/Calendar/next.gif";
		}
	}
		
	
	function changeMonthImage(intmonth) {
		stringmonth = get_month(intmonth);
		if (document.images)
		{
		  monthimage = 'Images/new/subtitles/Calendar/' + stringmonth + ".gif";
		  document.images['monthname'].src = monthimage;
		}
	 }
	 
	function changeYearImage(intyear) {
		if (document.images)
		{
		  yearimage = 'Images/new/subtitles/Calendar/' + intyear + ".gif";
		  document.images['yearname'].src = yearimage;
		}
	 }
	 

	function lightup(imgName)
	 {
	   if (document.images)
		{
		  imgOn=eval(imgName + "on.src");
		  document.images[imgName].src= imgOn;
		}
	 }
	
	function turnoff(imgName)
	 {
	   if (document.images)
		{
		  imgOff=eval(imgName + "off.src");
		  document.images[imgName].src= imgOff;
		}
	 }

	function mouseImage(imgName) {
		//if (imgName == "upin" && upshown) lightup('up');
		//if (imgName == "upout" && upshown) turnoff('up');
		//if (imgName == "downin" && downshown) lightup('down');
		//if (imgName == "downout" && downshown) turnoff('down');
	}
	
	function scrollDownMonth()
	{
		 haschanged = changeMonth(1);
		 if (haschanged) document.getElementById("scrollDiv").scrollTop += 380;
		 show('up')
		 hide('down');
	}
	
	function scrollUpMonth()
	{
		haschanged = changeMonth(-1);
		if (haschanged) document.getElementById("scrollDiv").scrollTop -= 380;
		hide('up');
		show('down');
	}
	
	function show(img) {
		if (img == 'up') {
			document.images[img].src= "Images/new/subtitles/Calendar/prev.gif";
			upshown = 1;
		}
		if (img == 'down') {
			document.images[img].src= "Images/subtitles/Calendar/next.gif";
			downshown = 1;
		}
	}
	
	function hide(img) {
		document.images[img].src= "Images/new/subtitles/Calendar/blank.gif";
		if (img == 'up') {
			upshown = 0;
		}
		if (img == 'down') {
			downshown = 0;
		}
	}
	

	function get_month(intmonth) {
		switch(intmonth) {
			case 1:
				textmonth = "january";
				break;
			case 2:
				textmonth = "february";
				break;
			case 3:
				textmonth = "march";
				break;
			case 4:
				textmonth = "april";
				break;
			case 5:
				textmonth = "may";
				break;
			case 6:
				textmonth = "june";
				break;
			case 7:
				textmonth = "july";
				break;
			case 8:
				textmonth = "august";
				break;
			case 9:
				textmonth = "september";
				break;
			case 10:
				textmonth = "october";
				break;
			case 11:
				textmonth = "november";
				break;
			case 12:
				textmonth = "december";
				break;
		} 
		
		return textmonth;
	}
	