﻿//variables and functions used in the calendar template
/*var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function monthchange(sel){
	mnth=sel.options[sel.selectedIndex].value;
	aform=sel.form;
	if(aform.aday != null){
		if (mnth =='2'){
			theYear=aform.ayear.options[aform.ayear.selectedIndex].value;
			Days_in_Month[1] = ((theYear % 400 == 0) || ((theYear % 4 == 0) && (theYear % 100 !=0))) ? 29 : 28;
		}
		for(i=27; i < Days_in_Month[mnth-1]; i++){
			if (!aform.aday.options[i])
				aform.aday.options[i] = new Option(i+1, i+1, false, false);
		}
		for(i=Days_in_Month[mnth-1]; i < 31; i++){
			aform.aday.options[i] = null;
		}
		checkday(aform);
	}
	changer(sel);	
}

function checkday(aform){
	if (!aform.aday.options[aform.aday.selectedIndex]){
		aform.aday.options[Days_in_Month[aform.amonth.selectedIndex]-1].selected=true;
		aform.aday.focus();
	}
}*/

function changer(sel) {
	aform=sel.form;
	dy=(aform.aday != null)?aform.aday.options[aform.aday.selectedIndex].value:1;
	mnth=aform.amonth.options[aform.amonth.selectedIndex].value;
	yer=aform.ayear.options[aform.ayear.selectedIndex].value;
	aid=aform.articleid.value;
	aURL="index.aspx?articleid="+aid+"&ayear="+yer+"&amonth="+mnth+"&aday="+dy;
	window.location.href = aURL;
}
