<!-- hide JS code

var today = new Date(serverYear, serverMonth-1, serverDay); //new Date()
var dayofmonth = today.getDate()
var currYear
var currMonth
var nextMonth
var prevMonth
var prevYear
var nextYear
var days = new Array('Di','Lu','Ma','Me','Je','Ve','Sa')
var href = window.location.search
var nbHaut = -1
//////////Functions pour les pop up

function openProd()
	{		
		var oForm = document.getElementById("menuParProduit");
		selectedElem	= oForm.cProduit.selectedIndex;
		aProduits		= oForm.cProduit.options[selectedElem].value;
		aLangue			= oForm.l.value;
		aScript 		= oForm.action;
		aVertige		= oForm.pVertige.value;
		
		if(aProduits!="")	{			
			if (aVertige == 1) {
				document.location = (aScript)  + "?pVertige=" + (aVertige) + "&cProduit=" + (aProduits) + "&pRequest=2&l="+ (aLangue);
			} else {
				document.location = (aScript)  +  "?cProduit=" + (aProduits) + "&pRequest=2&l="+ (aLangue);
			}
		
		}	

		// vers les sites français de pari sportif du menu de gauche.
		if (aProduits == 'Total'){
			document.location = "http://pari-sportif.loto-quebec.com/pesweb/cmd/changelangue?langue_redirect=/getresultats&param_lqlangue=fr_CA";
		} else if (aProduits == 'Mise-O-Jeu'){
			document.location = "http://pari-sportif.loto-quebec.com/pesweb/cmd/changelangue?langue_redirect=/getresultats&param_lqlangue=fr_CA";
		} else if ( aProduits == 'Pronostik'){
			document.location = "http://pari-sportif.loto-quebec.com/pesweb/cmd/changelangue?langue_redirect=/getresultatspronostik&param_lqlangue=fr_CA";
		}
	}

function openStat()
	{		
		var oForm = document.getElementById("menuStats");
		selectedElem	= oForm.cProduit.selectedIndex;
		aProduits	= oForm.cProduit.options[selectedElem].value;
		aLangue		= oForm.l.value;
		aVertige	= oForm.pVertige.value;
		aScript		= oForm.action;
		
		if(aProduits!="")	{			
			if (aVertige == 1) {
				document.location = (aScript)  + "?pVertige=" + (aVertige) + "&cProduit=" + (aProduits) + "&pRequest=3&l="+ (aLangue);
			} else {
				document.location = (aScript)  + "?cProduit=" + (aProduits) + "&pRequest=3&l="+ (aLangue);
			}
		
		}	
		
	}

function openResAnt()
	{		
		var oForm = document.getElementById("calForm");	
		selectedElem	= oForm.cProduit.selectedIndex;
		aProduits	= oForm.cProduit.options[selectedElem].value;
		aLangue		= oForm.l.value;
		aVertige	= oForm.pVertige.value;
		
		if(aProduits!="")	{		
			var codeLng = ""
			if (aLangue==1){codeLng="_AN";}	
			
			if (aVertige == 1) {
				document.location = resPath + "asp/hr_" + (aProduits) + codeLng +".asp"  + "?pVertige=" + (aVertige);
			} else {
				document.location = resPath + "asp/hr_" + (aProduits) + codeLng +".asp";
			}
		
		}	
			
	}
	
function getParameter ( queryString, parameterName ) 
{
	var parameterName = parameterName + "=";
	if ( queryString.length > 0 ) 
	{
		begin = queryString.indexOf ( parameterName );
		if ( begin != -1 ) 
		{
			begin += parameterName.length;
			end = queryString.indexOf ( "&" , begin );
			if ( end == -1 ) 
			{
				end = queryString.length
			}
			return unescape ( queryString.substring ( begin, end ) );
		}
		
	}
	return null;
} 

function RO_Search()
{
	var oForm = document.getElementById("resAVieForm");	
	selectedElem	= oForm.cProduit.selectedIndex;
	aProduits	= oForm.cProduit.options[selectedElem].value;
	if(aProduits!='0')	
	{		
		document.getElementById("Rechercher").src = "/sw3/lib/images/rechercher_fr_over.jpg";
	}
	
}

function MO_Search()
{
	var oForm = document.getElementById("resAVieForm");	
	selectedElem	= oForm.cProduit.selectedIndex;
	aProduits	= oForm.cProduit.options[selectedElem].value;
	if(aProduits!='0')	
	{		
		document.getElementById("Rechercher").src = "/sw3/lib/images/rechercher_fr.jpg";
	}
	
}

function mouseover_video(id)
{
   document.getElementById(id).src = "/sw3/lib/images/bg_bt_diffusion2.jpg";
   return null;  
}

function mouseout_video(id)
{
   document.getElementById(id).src = "/sw3/lib/images/bg_bt_diffusion.jpg";
   return null;
}


function mouseover_video_par_produit(id)
{
   document.getElementById(id).src = "/sw3/lib/images/bg_bt_voir_tirage2.jpg";
   return null;  
}

function mouseout_video_par_produit(id)
{
   document.getElementById(id).src = "/sw3/lib/images/bg_bt_voir_tirage.jpg";
   return null;
}


function mouseover_savoir_plus(id)
{
   document.getElementById(id).src = "/sw3/lib/images/savoirplus2_fr.jpg";
   return null;  
}

function mouseout_savoir_plus(id)
{
   document.getElementById(id).src = "/sw3/lib/images/savoirplus_fr.jpg";
   return null;
}


function ShowOptions()
	{
		var debut;
		var fin;		
		var oForm = document.getElementById("resAVieForm");	        
		selectedElem	= oForm.cProduit.selectedIndex;
		aProduits	= oForm.cProduit.options[selectedElem].value;
		
		var queryString = window.top.location.search.substring(1);
		aAnnee = getParameter(queryString, "pAnnee");

		if (!aAnnee || aAnnee=="") {aAnnee=String(serverYear);}

		if(aProduits!='0')	
		{		
			oForm.pMois.disabled=false;
			oForm.pAnnee.disabled=false;
  	   		document.getElementById("Rechercher").disabled=false;  	   		
 		        document.getElementById('Rechercher').src = "/sw3/lib/images/rechercher_fr.jpg";
				
		}	
		else
		{
			oForm.pMois.disabled=true;
			oForm.pAnnee.disabled=true;
			document.getElementById("Rechercher").disabled=true;			
			document.getElementById("Rechercher").src = "/sw3/lib/images/rechercher_fr_disabled.jpg";	

		}
        
                fin = serverYear;
		prod = aProduits;
      
		switch(prod)
		{
		   case '1': // Mini
		     debut = 1994;
			 break;

		   case '2': // Poule
		     debut = 1994;
			 break;

		   case '3': // Super 7
		     debut = 1994;
			 break;

		   case '4': // Lotto 6/49
		     debut = 1982;
			 break;

		   case '5': // Québec 49
		     debut = 1997;
			 break;

		   case '6': // Banco
		     debut = 1989;
			 break;

		   case '10': // Quotidiennes
		     debut = 1983;
			 break;

		   case '14': // Astro
		     debut = 2006;
			 break;

		   case '18': // Triplex 
		     debut = 2007;
			 break;

		   case '30': // Jour de paye 
		     debut = 2007;
			 break;
			 
		   case '34': // Tango
		     debut = 2009;
			 break;
			 
		   case '38': // Lotto Max
		     debut = 2009;
			 break;
			 
		   default:
		     debut = 1982;

		}

		nbOptions = oForm.pAnnee.options.length

		for (i=0; i< nbOptions; i++)
		{
		   oForm.pAnnee.remove(0);
		}


		for(i = fin; i >= debut; i--)
		{
 		   var y=document.createElement('option');
		   y.text= i;
		   if(i==aAnnee)
		   {
		      y.selected="selected";
		   }
		   try
		   {
		   	  oForm.pAnnee.add(y,null); // standards compliant
		   }
		   catch(ex)
		   {
		 	  oForm.pAnnee.add(y); // IE only
		   }
 
		   
		}

	}	

function goUp(){
	nbHaut = -2;
	return true;
}	
	
function GoBack()
	{			
		history.go(nbHaut);
	}	
	
function printThis()
	{			
		window.print();
	}
function openPrintWin(url)
	{	
		var imp
		imp = window.open(url, "Impression", "toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400,left=10,top=10");
		imp.focus()
	}
	
//////////Functions pour initialiser les parametres

	///Function qui retourne les parametres
	function getParams() {
		var idx = document.URL.indexOf('?');
		var params = new Array();
		if (idx != -1) {
			var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
			for (var i=0; i<pairs.length; i++) {
				nameVal = pairs[i].split('=');
				params[nameVal[0]] = nameVal[1];
				}
			}
		return params;
		}
		
		
	params = getParams();
	
	jourTxt		= unescape(params["j"]);
	moisTxt		= unescape(params["m"]);
	anneeTxt	= unescape(params["a"]);	
	submit		= unescape(params["submit"]);	
	if ((submit!="s") &&  (submit!="cal")){
		submit		= unescape(params["s"]);
	}
	moisCal		= unescape(params["moisCal"]);
	anneeCal	= unescape(params["anneeCal"]);	
	
	//today		= new Date(serverYear, serverMonth-1, serverDay);
	thismonth	= today.getMonth()+1;
	thisyear	= today.getFullYear();
	thisday		= -1 ;
	flagNoParam = false;
	
	calMois	  =	moisTxt	
	jourTxt	  = jourTxt * 01	
	moisTxt   = moisTxt * 01
	thismonth = thismonth * 01
	prevMonth = prevMonth * 01
		
	if (submit=="s"){		
		currMonth = moisTxt*1 
		currYear  = anneeTxt 
		moisCal	  = moisTxt*1 
		currYear  = anneeTxt
		}
	else if (submit=="cal"){  
		currMonth = moisCal*1 
		currYear  = anneeCal 
		if (currYear-0 < thisyear-1)
			{
			currYear  = anneeCal -0 + 2;
			currMonth = thismonth;
			}			
		if (currMonth-0 < thismonth-0 && currYear-0 < thisyear-0)
			{
			currYear  = anneeCal -0 + 1;
			currMonth = thismonth;
			}
		if ((currMonth-0 > thismonth-0 && currYear-0 == thisyear-0) || (currYear-0 > thisyear-0))
			{
			currYear  = anneeCal -0 - 1;
			if (currYear-0 == thisyear-0){currYear = currYear -0 - 1;}
			currMonth = thismonth;
			} 
		}	
	else {			
		jourTxt		= -1; 
		moisTxt		= -1; 
		anneeTxt	= -1; 
		
		currMonth   = today.getMonth() - 0 + 1
		currYear    = today.getFullYear()





		}  


////////////////////////////////////


function drawCurrMonth(form, vertige) { 

	//Determines previous month and year for Prev button on calendar
	prevMonth = currMonth - 1
	if (prevMonth == 0) {   
		prevMonth = 12
		prevYear  = currYear - 1
	  }
	else {   // set month to prev month
		prevYear = currYear  
		}
  
	//Determines next month and year for Next button on calendar
	nextMonth = currMonth - 0 + 1
	if (nextMonth == 13) {                 
		nextMonth = 1
		nextYear = currYear - 0 + 1
	  }
	else {   // set month to next month
	  nextYear = currYear    
		}
	makeMonthArray()
	drawCal(vertige)
	}
  

function returnDate(yy, mm, dd, vertige) {
	
	if (vertige == 1 ){
		window.location = resPath + "asp/index.asp?j="+dd+"&m="+mm+"&a="+yy+"&pRequest=1&pVertige="+vertige+"&submit=s"
	} else {
		window.location = resPath + "asp/index.asp?j="+dd+"&m="+mm+"&a="+yy+"&pRequest=1&submit=s"
	}
	
	return true
	}

  
function makeMonthArray() {    // create array of 12 month objects
	months = new makeArray(12)
	months[1]  = new month("Janvier", 31, 0)
	months[2]  = new month("F&eacute;vrier", 28, 1)
	months[3]  = new month("Mars", 31, 2)
	months[4]  = new month("Avril", 30, 3)
	months[5]  = new month("Mai", 31, 4)
	months[6]  = new month("Juin", 30, 5)
	months[7]  = new month("Juillet", 31, 6)
	months[8]  = new month("Ao&ucirc;t", 31, 7)
	months[9]  = new month("Septembre", 30, 8)
	months[10] = new month("Octobre", 31, 9)
	months[11] = new month("Novembre", 30, 10)
	months[12] = new month("D&eacute;cembre", 31, 11)
	}
  
function makeArray(arrayLength) {    // create empty array
	this.length = arrayLength
	for (var i = 1; i <= arrayLength; i++)
	  this[i] = 0
	return this
	}
  
function month(name, length, index) {   // create month object
	this.name   = name    // properties
	this.length = length
	this.index  = index
	this.getFirstMonthDay = getFirstMonthDay  // method
	}
  
function getFirstMonthDay(theYear) {    // get week-day of first day of month
	var firstDay = new Date(theYear, this.index, 1)
	return firstDay.getDay()
	}
 
function getNumFebDays(theYear) {     // calc num days in February
	if ((theYear % 4 == 0 && theYear % 100 != 0) || theYear % 400 == 0) {
		return 29
		}
	else {
		return 28
		}
	}


function drawCal(vertige) {             // draw day numbers in cal table




	var theYear    = currYear
	var month      = currMonth
	if (month == 2) { months[2].length = getNumFebDays(theYear - 1900) }
	var firstMonthDay = months[month].getFirstMonthDay(theYear)
	var numMonthDays  = months[month].length
    
	var daycounter = 1
    
	if (vertige == 1){
		document.write("<TABLE CLASS=cal_block_hautv cellspacing=2 cellpadding=1 width=80%>")	
	} else {
		document.write("<TABLE CLASS=cal_block_haut cellspacing=2 cellpadding=1 width=80%>")	
	}	
	
	document.write("<input type=hidden value=cal name=submit><input type=hidden value=" + (jourTxt) + " name=j><input type=hidden value=" + (moisTxt) + " name=m><input type=hidden value=" + (anneeTxt) + " name=a>")
	document.write("<TR CLASS=DAYS align=center >")	

	if (vertige == 1){
		document.write("<TD><nobr><A HREF=" + resPath + "asp/index.asp?j=" + (jourTxt) + "&m=" + (moisTxt) + "&a=" + (anneeTxt) + "&moisCal=" + (prevMonth) + "&anneeCal=" + (prevYear) + "&submit=cal&pRequest=1&pVertige=" + vertige + "><img src=" + imagesPath + "bt_fleche_back.gif></a>")
	} else {
		document.write("<TD><nobr><A HREF=" + resPath + "asp/index.asp?j=" + (jourTxt) + "&m=" + (moisTxt) + "&a=" + (anneeTxt) + "&moisCal=" + (prevMonth) + "&anneeCal=" + (prevYear) + "&submit=cal&pRequest=1><img src=" + imagesPath + "bt_fleche_back.gif></a>")
	}
	document.write("&nbsp;<B>" + moisAnneeSelect(vertige) + "</B>&nbsp;")
	
	if (vertige ==1){
		document.write("<A HREF=" + resPath + "asp/index.asp?j=" + (jourTxt) + "&m=" + (moisTxt) + "&a=" + (anneeTxt) + "&moisCal=" + (nextMonth) + "&anneeCal=" + (nextYear) + "&submit=cal&pRequest=1&pVertige=" + vertige + "><img src=" + imagesPath + "bt_fleche_suiv.gif></a></nobr></td>")
	} else {
		document.write("<A HREF=" + resPath + "asp/index.asp?j=" + (jourTxt) + "&m=" + (moisTxt) + "&a=" + (anneeTxt) + "&moisCal=" + (nextMonth) + "&anneeCal=" + (nextYear) + "&submit=cal&pRequest=1><img src=" + imagesPath + "bt_fleche_suiv.gif></a></nobr></td>")
	}
	
	document.write("</TR>")
	
	
	document.write("</TABLE>")
	document.write("</TD>")   
	document.write("</TR>") 

	
	document.write("<TR align=center >")
	
	document.write("<TD colspan=7>")
	document.write("<TABLE CLASS=cal_block_middle cellspacing=2 cellpadding=1 width=80% align='center'>")
	document.write("<TR align=center >")
	
	for(var d=0;d<7;d++){
		document.write("<TD  width=14% CLASS=DAYS><B>" + days[d] + "</B></TD>")
	}

	for(var i=0; i<6; i++){

		if(daycounter<=months[month].length) {
			document.write("<TR align=center>")
			
			for(var j=0;j<7;j++){
                if( (i==0 && j<firstMonthDay) || daycounter>months[month].length ) {
					document.write("<TD class=DAYS>&nbsp;</TD>")

				} else if(daycounter==today.getDate() && currMonth-0==today.getMonth()-0+1 && currYear==today.getFullYear()) {
					if (vertige == 1 ){
						document.write("<TD CLASS=TODAY><a class=\"TODAY\" href=\"" + resPath + "asp/index.asp?pVertige=" + vertige +  "\">" + daycounter + "</a></TD>")
					} else {
						document.write("<TD CLASS=TODAY><a class=\"TODAY\" href=\"" + resPath + "asp/index.asp\">" + daycounter + "</a></TD>")
					}
					daycounter++
					
				} else if((daycounter > dayofmonth && currMonth-0==today.getMonth()-0+1 && currYear-0==today.getFullYear()) || (currMonth-0 > today.getMonth()-0+1 && currYear-0==today.getFullYear()) || currYear-0 > today.getFullYear()) {
					document.write("<TD CLASS=\"AFTERTODAY\">" + daycounter + "</TD>")
					daycounter++

				} else if((daycounter < dayofmonth && currMonth-0<=today.getMonth()-0+1 && currYear-0<today.getFullYear()) ) {
					document.write("<TD CLASS=\"AFTERTODAY\">" + daycounter + "</TD>")
					daycounter++

				} else {
					document.write("<TD CLASS=\"BEFORETODAY\"><A CLASS=BEFORETODAY HREF=javascript:returnDate(" + currYear + "," + currMonth + "," + daycounter + "," + vertige +  ")>" + daycounter + "</A></TD>")
					daycounter++
				}//ifelse
			}//for
			document.write("</TR>")    
		}//if
	}//for


	document.write("</TABLE>")

	document.write("<TABLE CLASS=dernrescal cellspacing=0 cellpadding=0 align='center'>")
	document.write("<TR align=center>")
	document.write("<TD>") 
	//document.write("&nbsp&nbsp&nbsp")	
	if (vertige ==1){
		document.write("<a href=" + resPath + "asp/index.asp?l=0&amp;pVertige=" + vertige + ">")
	}
	else
	{
		document.write("<a href=" + resPath + "asp/index.asp?l=0>")
	}	
	document.write("Derniers r&eacute;sultats")
	document.write("</a>")
	document.write("</TD>")   
	document.write("</TR>") 
	document.write("</TABLE>")
	
}
  
  
////////////////Functions pour le pop list conquetane du mois et des annees

	function moisAnneeAction(vertige)
	{	
		selectedElem	= document.calForm.moisAnneCal.selectedIndex;
		moisAnne		= document.calForm.moisAnneCal.options[selectedElem].value;




		
		if(moisAnne!="")	{
			if(vertige==1){			
				document.location = resPath + "asp/index.asp?pVertige=" + vertige + "&amp;j=" + (jourTxt) + "&amp;m=" + (moisTxt) + "&amp;a=" + (anneeTxt) + "&amp;moisCal=" + (matchMois(moisAnne)) + "&amp;anneeCal=" + (matchAnne(moisAnne)) + "&amp;submit=cal&amp;pRequest=1";
			}else{
				document.location = resPath + "asp/index.asp?j=" + (jourTxt) + "&amp;m=" + (moisTxt) + "&amp;a=" + (anneeTxt) + "&amp;moisCal=" + (matchMois(moisAnne)) + "&amp;anneeCal=" + (matchAnne(moisAnne)) + "&amp;submit=cal&amp;pRequest=1";
			}

		}	
		
	}
	
	function matchAnne(str){
		return(str.charAt(2) + str.charAt(3) + str.charAt(4) + str.charAt(5));
	}

	function matchMois(str){
		return(str.charAt(0) + str.charAt(1));
	}
	
	///Function qui retourne un pop list pour les mois et des annees
	function moisAnneeSelect(vertige) {
		var flagSelectMonth = false;
		var tmpMonth = thismonth;
		var tmpYear  = thisyear;
		tmp = "<span class=MoisCal>"

		tmp = tmp + months[currMonth * 1].name + " " + currYear;
		
		tmp = tmp +"</span>"
		return tmp;
	}
		

//////////////////////////////-->