function book_test(formulaire) 
{
	var message='';
	var todaydate=new Date();
	var today=new Date(todaydate.getFullYear(),todaydate.getMonth(), todaydate.getDate());
	choixdate=new Date(formulaire.FirstSelectMonth.options[formulaire.FirstSelectMonth.selectedIndex].value.substring(0,4), eval(formulaire.FirstSelectMonth.options[formulaire.FirstSelectMonth.selectedIndex].value.substring(4,6))-1, formulaire.FirstSelectDay.options[formulaire.FirstSelectDay.selectedIndex].value);
	if (today<=choixdate) 
	{ } 
	else 
	{
		message='Invalid date - Date invalide.'
	};
	if (message!='') 
		alert(message);
	else
	{
		formulaire.target="_blank";
		formulaire.submit();
	}
}

function setCurrentDate() 
{
	var currentDate = new Date();
	setDays();
	document.PW.FirstSelectDay.selectedIndex = currentDate.getDate() - 1;
	var mois = currentDate.getMonth()+1;
	var annee = currentDate.getFullYear();
	if( mois < 10)
		mois ="0"+ mois;
	var i;
	var anneemois = annee + "" +  mois;
	for( i = 0; i < document.PW.FirstSelectMonth.length; i++)
	{
		if(document.PW.FirstSelectMonth.options[i].value == anneemois)
		{
			document.PW.FirstSelectMonth.options[i].selected = true;
			break;
		}
	}
}

function setDays() 
{
	var Monthlong = document.PW.FirstSelectMonth.options[document.PW.FirstSelectMonth.selectedIndex].value;
	var m=Monthlong.substring(4,6);
	var y=eval(Monthlong.substring(0,4));
	
	days = 31;
	if ( (m == "04") || (m == "06") || (m == "09") || (m == "11") ) 
	{
		days = 30;
	}
	else if (m == "02") 
	{
		// check for leapyear - Any year divisible by 4, except those divisible by 100 (but NOT 400)
		if ( (Math.floor(y/4) == (y/4)) && ((Math.floor(y/100) != (y/100)) || (Math.floor(y/400) == (y/400))) )
			days = 29;
		else
			days = 28;
	}
	// if (days in new month > current days) then we must add the extra days
	if (days > document.PW.FirstSelectDay.length) 
	{
		for (i = document.PW.FirstSelectDay.length; i < days; i++) 
		{
			document.PW.FirstSelectDay.length = days;
			document.PW.FirstSelectDay.options[i].text = i + 1;
			document.PW.FirstSelectDay.options[i].value = i + 1;
		}
	}
	// if (days in new month < current days) then we must delete the extra days
	if (days < document.PW.FirstSelectDay.length) 
	{
		document.PW.FirstSelectDay.length = days;
		if (document.PW.FirstSelectDay.selectedIndex == -1) 
			document.PW.FirstSelectDay.selectedIndex = days - 1;
	}
}

function MM_preloadImages() 
{ 
	//v3.0
	var d=document; 
	if(d.images)
	{ 
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
		for(i=0; i<a.length; i++)
			if (a[i].indexOf("#")!=0)
			{ 
				d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
			}
	}
}

function MM_findObj(n, d) 
{ 
	//v4.01
	var p,i,x;  
	if(!d) 
		d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) 
		x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}

function MM_swapImage() 
{ 
	//v3.0
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x; 
			if(!x.oSrc) 
				x.oSrc=x.src; x.src=a[i+2];
		}
}