/* version du 15 novembre 2007 - cedric sam */

var arrBoxMonth = new Array(); 
var calenderLayer="";
var date = SRCDate;
var win="";
var mois1, mois2, mois3, mois4, mois5, mois6, mois7, mois8, mois9, mois10, mois11, mois12;
var spacing = "";
var cont = "";
var DateRec;
var DateAnRec;
var daysOfShow = new Array("0","1","2","3","4","5","6"); /* Dimanche = 0 ; Lundi = 1; etc. Ne pas omettre guillemets, lorsque une seule journee */
var timeShow = "2200";
var showName = "/";
var calendarNote = "";
var startDate = "20080101"; /* Date de debut des emissions */

//alert(date)
function initCalendrierTJ(NumberOfMonth, objLay) {
	win = new RastaMartWindow();
	calenderLayer = new RastaMartLay(objLay);
	cont	= "";
	for (y=1;y<=NumberOfMonth;y++) {

		if ((y == 2) && (NumberOfMonth == 3)) {y = 3}
		if ((y == 3) && (NumberOfMonth == 4)) {y = 4}
		if ((y == 4) && (NumberOfMonth == 5)) {y = 5}
		if ((y == 5) && (NumberOfMonth == 6)) {y = 6}
		if ((y == 6) && (NumberOfMonth == 7)) {y = 7}
		if ((y == 7) && (NumberOfMonth == 8)) {y = 8}
		if ((y == 8) && (NumberOfMonth == 9)) {y = 9}
		if ((y == 9) && (NumberOfMonth == 10)) {y = 10}
		if ((y == 10) && (NumberOfMonth == 11)) {y = 11}
		if ((y == 11) && (NumberOfMonth == 12)) {y = 12}
		
		//alert(y)
		if (y == 1) {
			setNewBoxMonth("mois1", date.getDate(), date.getMonth(), date.getFullYear(), date.getHours(), date.getMinutes());
			if (NumberOfMonth == 1){
				cont += getContModele(BoxMonth("mois1"),1);
				cont += spacing;
			}
		} 

	
		if (y == 2) {
			
			if (NumberOfMonth == 2){
			//alert(2)
				setNewBoxMonth("mois"+y, BoxMonth("mois"+eval(y+"-1")).date, BoxMonth("mois"+eval(y+"-1")).getPrevMonth(), BoxMonth("mois"+eval(y+"-1")).getPrevMonthYear(1), date.getHours(), date.getMinutes());
				
				cont += getContModele(BoxMonth("mois"+y),2);
				cont += spacing;
				}
		}
		
		if (y == 3) {	
			
			if (NumberOfMonth == 3){
			
				DateRec = date.getMonth() - 2;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				
				
				setNewBoxMonth("mois3", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 3){
					cont += getContModele(BoxMonth("mois3"),3);
					cont += spacing;
				}
			}
		}
		
		if (y == 4) {	
			
			if (NumberOfMonth == 4){
			
				DateRec = date.getMonth() - 3;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				
				
				setNewBoxMonth("mois4", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 4){
					cont += getContModele(BoxMonth("mois4"),4);
					cont += spacing;
				}
			}
		}
		
		if (y == 5) {	
			
			if (NumberOfMonth == 5){
			
				DateRec = date.getMonth() - 4;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				
				
				setNewBoxMonth("mois5", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 5){
					cont += getContModele(BoxMonth("mois5"),5);
					cont += spacing;
				}
			}
		}
		
		if (y == 6) {	
			
			if (NumberOfMonth == 6){
			
				DateRec = date.getMonth() - 5;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				
				setNewBoxMonth("mois6", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 6){
					cont += getContModele(BoxMonth("mois6"),6);
					cont += spacing;
				}
			}
		}
		
		if (y == 7) {	
			
			if (NumberOfMonth == 7){
			
				DateRec = date.getMonth() - 6;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois7", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 7){
					cont += getContModele(BoxMonth("mois7"),7);
					cont += spacing;
				}
			}
		}
		
		if (y == 8) {	
			
			if (NumberOfMonth == 8){
			
				DateRec = date.getMonth() - 7;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-7) {
					DateRec=5;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois8", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 8){
					cont += getContModele(BoxMonth("mois8"),8);
					cont += spacing;
				}
			}
		}
		
		
		if (y == 9) {	
			
			if (NumberOfMonth == 9){
			
				DateRec = date.getMonth() - 8;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-7) {
					DateRec=5;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-8) {
					DateRec=4;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois9", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 9){
					cont += getContModele(BoxMonth("mois9"),9);
					cont += spacing;
				}
			}
		}
		if (y == 10) {	
			
			if (NumberOfMonth == 10){
			
				DateRec = date.getMonth() - 9;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-7) {
					DateRec=5;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-8) {
					DateRec=4;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-9) {
					DateRec=3;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois10", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 10){
					cont += getContModele(BoxMonth("mois10"),10);
					cont += spacing;
				}
			}
		}
		
		if (y == 11) {	
			
			if (NumberOfMonth == 11){
			
				DateRec = date.getMonth() - 10;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-7) {
					DateRec=5;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-8) {
					DateRec=4;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-9) {
					DateRec=3;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-10) {
					DateRec=2;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois11", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 11){
					cont += getContModele(BoxMonth("mois11"),11);
					cont += spacing;
				}
			}
		}
		
		if (y == 12) {	
			
			if (NumberOfMonth == 12){
			
				DateRec = date.getMonth() - 10;
				DateAnRec = date.getFullYear();
				
				if(DateRec==-1) {
					DateRec=11;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-2) {
					DateRec=10;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-3) {
					DateRec=9;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-4) {
					DateRec=8;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-5) {
					DateRec=7;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-6) {
					DateRec=6;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-7) {
					DateRec=5;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-8) {
					DateRec=4;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-9) {
					DateRec=3;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-10) {
					DateRec=2;
					DateAnRec = DateAnRec - 1;
				}
				if(DateRec==-11) {
					DateRec=1;
					DateAnRec = DateAnRec - 1;
				}
				setNewBoxMonth("mois12", date.getDate(), DateRec, DateAnRec, date.getHours(), date.getMinutes());
				if (NumberOfMonth == 12){
					cont += getContModele(BoxMonth("mois12"),12);
					cont += spacing;
				}
			}
		}
		
	}
	var layCalCont = "";
	layCalCont+='<table width="100%" border=0 cellspacing="0" cellpadding="1">';
	layCalCont+='<tr valign=top>';
	layCalCont+='<td align="center">';	
	layCalCont+='<table width="100%" border=0 cellspacing="0" cellpadding="0" class="calCouleur">';
	layCalCont+='<tr valign=top>';
	layCalCont+='<td align="center"><img src=Img/spacer.gif border=0 width=1 height=1>';	
	layCalCont+='</td></tr><tr valign=top>';
	layCalCont+='<td align="center">';	
	layCalCont+='';
	layCalCont+=(cont);
	layCalCont+='</td>';
	layCalCont+='</tr></table> ';
	layCalCont+='</td>';
	layCalCont+='</tr></table> ';
	calenderLayer.setContVID(layCalCont);
}





function getContModele(objCurrDate, rett) {

	var strry
	var strrm
	var strrd		
	var strrdayof		
	strry = date.getFullYear()
	strrm = date.getMonth() + 1
	strrd = date.getDate()
	strrdayof = date.getDay()
		
	FirstWeek = true;
	cont = "";
	cont += "<table border='0' width='100%' cellspacing='0' cellpadding='0'><tr>";
	if (objCurrDate.mois==date.getMonth()&&objCurrDate.annee==date.getFullYear()) cont += "<td valign='bottom'></td>";	
	cont += "<tr><td colspan='7'" + paramContentOfTdTitre + " class='titre' ><div align=center ><B>"
	var rett 
	
	/*rett = 1
	
	if (Request.QueryString("r") == 2){rett = 2}
	if (Request.QueryString("r") == 3){rett = 3}
	if (Request.QueryString("r") == 4){rett = 4}
	if (Request.QueryString("r") == 5){rett = 5}
	if (Request.QueryString("r") == 6){rett = 6}
	if (Request.QueryString("r") == 7){rett = 7}
	if (Request.QueryString("r") == 8){rett = 8}
	if (Request.QueryString("r") == 9){rett = 9}
	if (Request.QueryString("r") == 10){rett = 10}
	if (Request.QueryString("r") == 11){rett = 11}
	if (Request.QueryString("r") == 12){rett = 12}
	*/

if ((objCurrDate.annee != 2007)&&(objCurrDate.mois!=0)){
	if (rett == 1){
		cont += "<a href=\"javascript:initCalendrierTJ(2,MM_findObj('layTj'))\">";	
	}
	if (rett == 2){
		cont += "<a href=\"javascript:initCalendrierTJ(3,MM_findObj('layTj'))\">";	
	}
	if (rett == 3){
		cont += "<a href=\"javascript:initCalendrierTJ(4,MM_findObj('layTj'))\">";	
	}
	if (rett == 4){
		cont += "<a href=\"javascript:initCalendrierTJ(5,MM_findObj('layTj'))\">";	
	}
	if (rett == 5){
		cont += "<a href=\"javascript:initCalendrierTJ(6,MM_findObj('layTj'))\">";	
	}
	if (rett == 6){
		cont += "<a href=\"javascript:initCalendrierTJ(7,MM_findObj('layTj'))\">";	
	}
	if (rett == 7){
		cont += "<a href=\"javascript:initCalendrierTJ(8,MM_findObj('layTj'))\">";	
	}
	if (rett == 8){
		cont += "<a href=\"javascript:initCalendrierTJ(9,MM_findObj('layTj'))\">";	
	}
	if (rett == 9){
		cont += "<a href=\"javascript:initCalendrierTJ(10,MM_findObj('layTj'))\">";	
	}
	if (rett == 10){
		cont += "<a href=\"javascript:initCalendrierTJ(11,MM_findObj('layTj'))\">";	
	}
}

	cont += "«</a> ";	
	cont += ArrMois[objCurrDate.mois];
	cont += "&nbsp;";	
	cont += objCurrDate.annee;
	cont += "&nbsp;";	
	if (rett == 12){
		cont += "<a href=\"javascript:initCalendrierTJ(11,MM_findObj('layTj'))\">";	
	}
	if (rett == 11){
		cont += "<a href=\"javascript:initCalendrierTJ(10,MM_findObj('layTj'))\">";	
	}
	if (rett == 10){
		cont += "<a href=\"javascript:initCalendrierTJ(9,MM_findObj('layTj'))\">";	
	}
	if (rett == 9){
		cont += "<a href=\"javascript:initCalendrierTJ(8,MM_findObj('layTj'))\">";	
	}
	if (rett == 8){
		cont += "<a href=\"javascript:initCalendrierTJ(7,MM_findObj('layTj'))\">";	
	}
	if (rett == 7){
		cont += "<a href=\"javascript:initCalendrierTJ(6,MM_findObj('layTj'))\">";	
	}
	if (rett == 6){
		cont += "<a href=\"javascript:initCalendrierTJ(5,MM_findObj('layTj'))\">";	
	}
	if (rett == 5){
		cont += "<a href=\"javascript:initCalendrierTJ(4,MM_findObj('layTj'))\">";	
	}
	if (rett == 4){
		cont += "<a href=\"javascript:initCalendrierTJ(3,MM_findObj('layTj'))\">";	
	}
	if (rett == 3){
		cont += "<a href=\"javascript:initCalendrierTJ(2,MM_findObj('layTj'))\">";	
	}
	if (rett == 2){
		cont += "<a href=\"javascript:initCalendrierTJ(1,MM_findObj('layTj'))\">";	
	}
	cont += "»</a></div></td></tr><table>";
	cont += "<table " + paramContentOfTable3 + "><tr>";
	for(i=0;i<7;i++) {
		if ((strrdayof == i) && (objCurrDate.mois==date.getMonth())){
			cont += "<td><div align=center class=cadreJour>" + ArrTitleColumns[i] + "</div></td>";
		}else{
			cont += "<td><div align=center class=cadreJour>" + ArrTitleColumns[i] + "</div></td>";
		}

	}
	cont += "</tr><tr><td><img src=Img/spacer.gif border=0 width=1 height=5></td></tr></table><table " + paramContentOfTable2 + ">";
	cont += paramSpacingEntreTitreEtBoite;
	cont += "<tr>";
	nbrD = 0;
	
	var AffLien = 0;
	
	for(i=1;i<=ArrlastDayOfMonth[objCurrDate.mois];i++) {
		if (i==1) {	
			for(x=1;x<=7;x++) {	
				if (x<=objCurrDate.firstDayduMois) {
					cont += paramEmptyCell;
					nbrD ++;
				}
			}
		}
		cont += "<td " + paramContentOfTdFull + " >";
		var tempStrMois = eval(objCurrDate.mois+"+"+1);
		if (tempStrMois<10) tempStrMois = "0"+tempStrMois;
		tempStrMois = tempStrMois + "";
		var tempStrDate = i;
		if (tempStrDate<10) tempStrDate = "0"+tempStrDate;
		tempStrDate = tempStrDate + "";
		
		if (AffLien == 0){
			cont += "<div align=center class=cadreCalendrier>";
		}else{
			if ((strry == objCurrDate.annee)&&(strrm == tempStrMois)&&(strrd == i)){
				cont += "<div align=center class=dateChoisi>";
			}else{
				cont += "<div align=center class=cadreCalendrier>";
			}
		}

		strLien = '';		
		strLien = myCalendar(objCurrDate.annee + tempStrMois + tempStrDate);
		AffLien = 0
		if (!checkForExeption(objCurrDate.annee, tempStrMois, tempStrDate)) 
			{
			if (objCurrDate.mois!=date.getMonth()||objCurrDate.annee!=date.getFullYear()) 
				{
				cont += strLien;
				if ((nbrD != 0) && (nbrD != 6))
					{AffLien = 1}
				}
			else 
				{ 
				if (i<objCurrDate.date) 
					{
					cont += strLien;
					if ((nbrD != 0) && (nbrD != 6))
						{AffLien = 1}
					} 
				else if (i==objCurrDate.date) 
					{
					if (objCurrDate.heure>DispoHeure) 
						{
						cont += strLien;
						if ((nbrD != 0) && (nbrD != 6))
							{AffLien = 1}
						} 
					else if (objCurrDate.heure==DispoHeure) 
						{
						if (objCurrDate.minute>DispoMinute) 
							{
							cont += strLien;
							if ((nbrD != 0) && (nbrD != 6))
								{AffLien = 1}
							}
						}
					}
				}
			} 
		else 
			{
			cont += "<a href='javascript:;' onClick='showErreur();' >";
			}
		
		cont += strLien;
		cont += i + "</a></div>";
		
		cont += "</td>";
		nbrD ++;
		if (nbrD >= 7) {
			nbrD = 0;
			cont += "</tr><tr>";
		}
	}
	for(nbrD=nbrD;nbrD<7;nbrD++) {
		cont += "<td></td>";
	}
	cont += "</tr></table><table align=center  border='0' cellpadding=1 cellspacing=0 background='img/trans.gif'><tr><td class=note><br/>" + calendarNote +"</td></tr></table></td>";

	if (objCurrDate.mois==date.getMonth()&&objCurrDate.annee==date.getFullYear()) cont += "<td valign='top'></td>";
	cont += "</tr></table> ";
	return cont;
}

/* Fonction qui genere les liens (par date de calendrier) vers la console Audio-Video */
function myCalendar(sDate) {
	var sAnnee = sDate.substr(0,4);
	var sMois = sDate.substr(4,2) - 1;
	var sJour = sDate.substr(6,2);
	var sChaine = "";
	var sHeure = "";

	var varR = "";
	varR = 0;
	var thisDate = new Date(sAnnee, sMois, sJour);
	var weekday = thisDate.getDay();
	//alert(sDate)
	if (sDate > '20080824')
		{
		return "";
		}
	else if ((sDate > '20080111') && (sDate < '20080622') && (weekday == 6))
		{
		//return "<a href='index.asp?r=" + varR + "&d=" + sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour + "' class='www'>";	
		//return "<a href='javascript:netsReload("+varR+", \""+  sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour  +"\")' class='www'>";	
		return "<a href='javascript:callMediaPlayer2(\"/medianet/2008/CBFT/400foisquebec" +sDate+ "1700.asx\")' class='www2'>";	
		}
	else if (sDate == '20080811')
		{
		//return "<a href='index.asp?r=" + varR + "&d=" + sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour + "' class='www'>";	
		return "<a href='javascript:callMediaPlayer2(\"/medianet/2008/CBVT/400foisquebec" +sDate+ "1830.asx\")' class='www2'>";	
		}
	else if (sDate == '20080822')
		{
		//return "<a href='index.asp?r=" + varR + "&d=" + sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour + "' class='www'>";	
		return "<a href='javascript:callMediaPlayer2(\"/medianet/2008/CBVT/400foisquebec" +sDate+ "1830.asx\")' class='www2'>";	
		}
	else if (sDate == '20080730')
		{
		//return "<a href='index.asp?r=" + varR + "&d=" + sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour + "' class='www'>";	
		return "<a href='javascript:callMediaPlayer2(\"/medianet/2008/CBVT/400FoisQuebec200807300000_m.asx\")' class='www2'>";	
		}
	else if ((sDate > '20080622') && (weekday != 6) && (weekday != 0) && (sDate != 20080701) &&(sDate != 20080730) &&(sDate != 20080808))
		{
		//return "<a href='index.asp?r=" + varR + "&d=" + sAnnee + "-" + (thisDate.getMonth() + 1) + "-" + sJour + "' class='www'>";	
		return "<a href='javascript:callMediaPlayer2(\"/medianet/2008/rdi2/400foisquebec" +sDate+ "1930.asx\")' class='www2'>";	
		}
	else 
		{
		return "";
		}
	}


function showErreur() {
	alert(strLienErreur);
}


function checkForExeption(pAnnee, pMois, pJour) {
	for (var i=0; i < jourException.length; i++) {
		var tempDate = jourException[i].split("/");
		var tempAnnee = tempDate[0];
		var tempMois = tempDate[1];
		var tempJour = tempDate[2];
		if (tempAnnee == String(pAnnee) && tempMois == String(pMois) && tempJour == String(pJour)) {
			return true;
		}
	}
	return false;
}



function BoxMonth(ID) {
	var i;
	if ( typeof(ID) == "number")
		return arrBoxMonth[ID].content;
	for ( i = 0; i < arrBoxMonth.length; i++)
	{
		if(arrBoxMonth[i].idName == ID)
			return arrBoxMonth[i].content;
	}
}


function setNewBoxMonth(boxName,boxDate, boxMonth, boxYear, nowHours, nowMinutes) {
	arrBoxMonth[arrBoxMonth.length] = new ClassObjMois(boxDate, boxMonth, boxYear, nowHours, nowMinutes);
	arrBoxMonth[arrBoxMonth.length-1].idName = boxName;
	return BoxMonth(boxName);
}
function ClassObjMois(boxDate, boxMonth, boxYear, nowHours, nowMinutes) {
	this.content = new objMois(boxDate, boxMonth, boxYear, nowHours, nowMinutes);
	this.idName = "";
}
function objMois(date, month, year, hours, minutes) {
	this.date = date
	this.mois = month;
	this.annee = year;
	this.heure = hours;
	this.minute = minutes;
	
	firstDayOfMonth = new Date();
	firstDayOfMonth.setYear(year);
	firstDayOfMonth.setMonth(month);
	firstDayOfMonth.setDate(1);
	this.firstDayduMois = firstDayOfMonth.getDay();
	
	return this;
}

objMois.prototype.getPrevMonth = function() {
	prevMonth = this.mois-1; 
	if(prevMonth==-1) prevMonth=11; 
	return prevMonth;
}
objMois.prototype.getPrevMonthYear = function() {
	prevMonth = this.mois-1;
	prevMonthYear = this.annee;
	if(prevMonth==-1) prevMonthYear-=1;
	return prevMonthYear;
}

