function printcal(xssidate)
{
	var m = '';
	monthnames = new Array( "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"); 
	monthdays = new Array(31,31,28,31,30,31,30,31,31,30,31,30,31);

	var todayDate=new Date();
	var hrs = todayDate.getHours();
	var thisday=todayDate.getDay();
	var thismonth=todayDate.getMonth() + 1;
	var thisdate=todayDate.getDate();
	if ( thisdate < 10 ) { thisdate = '0' + thisdate ; }
	thisyear=todayDate.getYear();
	thisyear =  ( thisyear % 100 ) ; 
	thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear)); 
	if (thismonth < 10) { thismonth = '0' + thismonth; } else { month = thismonth; }
	if (xssidate == ''){xssidate = '' + thisyear + thismonth + thisdate + '';}

    if (xssidate.substring(0,10) == 'resultats_') { xssidate = xssidate.substring ( 10, 18 ) ; } 
	if (xssidate.substring(4,5) == '0'){
		thismonthqry = xssidate.substring(5,6);
	}
	else {
		thismonthqry = xssidate.substring(4,6);
	}
	
	thisdateqry = xssidate.substring(6,8);
	thisyearqry = xssidate.substring(0,4);

	var MYNEWDATE = new Date(thisyearqry, thismonthqry-1, thisdate);
	thisday = MYNEWDATE.getDay();
	
	thismonthOUT=thismonthqry;
	thisdateOUT=thisdateqry;
 	thisyearOUT=thisyearqry;
	month = thismonth ;

	var dateoftoday = thisyear + '' + month + '' + thisdate;
	var dateofqry = thisyearqry + '' + thismonthqry + '' + thisdateqry;
	var dateofallmonth = thisyearqry + '' + thismonthqry + '' + thisdateqry;

	if (dateoftoday > dateofqry){ flgtime = 0;}
		else if (dateoftoday < dateofqry){ flgtime = 2;}
			else if (dateoftoday == dateofqry){ flgtime = 1;}
	
	if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) ||(thisyear % 400 == 0)) 
	monthdays[2]++;
	
	startspaces=thisdate;
	//alert (thismonthOUT);
	while (startspaces > 7) startspaces-=7; 
	startspaces = thisday - startspaces + 1; 
	if (startspaces < 0) startspaces+=7; 
	document.write('<table border="0" cellspacing="3" cellpadding="0" width="100%" bgcolor="#E1E1E1">'); 
	document.write("<tr class='detailHeader'>"); 
	document.write('<td align=center class="calnomjour">D</td>'); 
	document.write('<td align=center class="calnomjour">L</td>'); 
	document.write('<td align=center class="calnomjour">M</td>'); 
	document.write('<td align=center class="calnomjour">M</td>'); 
	document.write('<td align=center class="calnomjour">J</td>'); 
	document.write('<td align=center class="calnomjour">V</td>'); 
	document.write('<td align=center class="calnomjour">S</td>'); 
	document.write('</tr>'); 
	document.write('<tr height="80">'); 
	for (s=0;s<startspaces;s++) { 
		document.write('<td class="caljourvide" align="center" valign="top"></td>'); 
	} 
	count=1; 
	
	//While count is smaller than days in month
	while (count <= monthdays[thismonthOUT-1])
	{
		// Week
		for (b = startspaces ; b < 7 ; b++)
		{ 
			linktrue=false; 

			if (count != 0 && count <= monthdays[thismonthOUT]) 
			{
				document.write('<td class="caljour" align="center" valign="top">');
				document.write('<table width="100%" height="100%" cellpadding="0" cellspacing="0"><tr style="max-height:10px;"><td width="75" style="min-width:75px;" align="center" valign="top" bgcolor="#FFFFFF"><div style="min-width:75px;"><b>');
	
				if (count <= monthdays[thismonthOUT]) 
				{ 
					if (count < 10) { countday = '0' + count; }
						else { countday = count; }
					if (thismonthqry < 10) { m = '0' + thismonthqry; }
						else { m = thismonthqry; }
					
					dateofallmonth = thisyearqry + '' + m + '' + countday;
					document.write(getData(count));	
				}
			} else {
				document.write('<td class="caljourvide" align="center">');
			}
			document.write("</table></td>"); 
			count++; 
		}  // End Week
		document.write("</tr>"); 
		if (count <= monthdays[thismonthOUT-1]){document.write("<tr height='80'>");}
		startspaces=0; 
	} // End While count is smaller than days in month
	document.write("</table>"); 
}//End function

