// JavaScript Document

function yearChange(thisForm,firstYear,firstMonth,lastYear,lastMonth,lang) {

	var monthText = new Array();

	if (lang == 1) {

		monthText[1] = 'January';

		monthText[2] = 'February';

		monthText[3] = 'March';

		monthText[4] = 'April';

		monthText[5] = 'May';

		monthText[6] = 'June';

		monthText[7] = 'July';

		monthText[8] = 'August';

		monthText[9] = 'September';

		monthText[10] = 'October';

		monthText[11] = 'November';

		monthText[12] = 'December';

	} else {

		monthText[1] = 'janvier';

		monthText[2] = 'f\u00E9vrier';

		monthText[3] = 'mars';

		monthText[4] = 'avril';

		monthText[5] = 'mai';

		monthText[6] = 'juin';

		monthText[7] = 'juillet';

		monthText[8] = 'ao\u00FBt';

		monthText[9] = 'septembre';

		monthText[10] = 'octobre';

		monthText[11] = 'novembre';

		monthText[12] = 'd\u00E8cembre';

	}

	

	var selectedMonth = thisForm.Month.options[thisForm.Month.selectedIndex].value;

	var hasSetSelected = false;



	if (thisForm.Year.value == firstYear) {

		thisForm.Month.length = 13 - parseInt(firstMonth);		

		for (i=0; i<thisForm.Month.length; i++) {

			thisForm.Month.options[i] = new Option(monthText[i+firstMonth],i+firstMonth);

			if (!hasSetSelected && i + firstMonth == selectedMonth) {

				thisForm.Month.selectedIndex = i;

				hasSetSelected = true;

			}

			if (!hasSetSelected)

				thisForm.Month.selectedIndex = 0;

		}

	} else if (thisForm.Year.value == lastYear) {

		thisForm.Month.length = parseInt(lastMonth);

		for (i=0; i<thisForm.Month.length; i++) {

			thisForm.Month.options[i] = new Option(monthText[i+1],i+1);

			if (!hasSetSelected && (i + 1 == selectedMonth || i == thisForm.Month.length - 1)) {

				thisForm.Month.selectedIndex = i;

				hasSetSelected = true;

			}

		}		

	} else {

		thisForm.Month.length = 12;

		for (i=0; i<thisForm.Month.length; i++) {

			thisForm.Month.options[i] = new Option(monthText[i+1],i+1);

			if (i + 1 == selectedMonth) {

				thisForm.Month.selectedIndex = i;

			}

		}

	}

}


