$(document).ready(function() {
	path = getpath();
	
	
	var spectacles = new Array(21);
	for ( var i=0; i < spectacles.length; i++ )
  		spectacles[i] = new Array(3);
		
	spectacles[0][1] = "alain_francois"; //Nom de l'image
	spectacles[0][2] = "/programmation/pages_prog/alain_francois.htm"; //Lien a la page personnel
	spectacles[0][3] = "Alain François"; //Titre de Limage
	
	spectacles[1][1] = "bruno_labrie";
	spectacles[1][2] = "/programmation/pages_prog/bruno_labriey.htm";
	spectacles[1][3] = "Bruno Labrie";
	
	spectacles[2][1] = "bruno_pelletier";
	spectacles[2][2] = "/programmation/pages_prog/bruno_pelletier.htm";
	spectacles[2][3] = "Bruno Pelletier";
	
	spectacles[3][1] = "daniel_lavoie";
	spectacles[3][2] = "/programmation/pages_prog/daniel_lavoie.htm";
	spectacles[3][3] = "Daniel Lavoie";
	
	spectacles[4][1] = "dumas";
	spectacles[4][2] = "/programmation/pages_prog/dumas.htm";
	spectacles[4][3] = "Dumas";
	
	spectacles[5][1] = "guy_corneau";
	spectacles[5][2] = "/programmation/pages_prog/guy_corneau.htm";
	spectacles[5][3] = "Guy Corneau";
	
	spectacles[6][1] = "harvee";
	spectacles[6][2] = "/programmation/pages_prog/harvee.htm";
	spectacles[6][3] = "Harvee";
	
	spectacles[7][1] = "hugo_lapointe";
	spectacles[7][2] = "/programmation/pages_prog/hugo_lapointe.htm";
	spectacles[7][3] = "Hugo Lapointe";
	
	spectacles[8][1] = "katie_moore";
	spectacles[8][2] = "/programmation/pages_prog/katie_moore.htm";
	spectacles[8][3] = "Katie Moore";
	
	spectacles[9][1] = "les_boppers";
	spectacles[9][2] = "/programmation/pages_prog/les_boppers.htm";
	spectacles[9][3] = "Les Boppers";
		
	spectacles[10][1] = "mara_tremblay";
	spectacles[10][2] = "/programmation/pages_prog/mara_tremblay.htm";
	spectacles[10][3] = "Mara Tremblay";
		
	spectacles[11][1] = "michel_dulac";
	spectacles[11][2] = "/programmation/pages_prog/michel_dulac.htm";
	spectacles[11][3] = "Rock'n Roll Mania avec Michel Dulac";
	
	spectacles[12][1] = "mme_moustache";
	spectacles[12][2] = "/programmation/pages_prog/mme_moustache.htm";
	spectacles[12][3] = "Spectacle d'halloween avec Mme Moustache";
	
	spectacles[13][1] = "mojitos_quatros";
	spectacles[13][2] = "/programmation/pages_prog/mojitos_quatros.htm";
	spectacles[13][3] = "Mojitos Quatros";
	
	spectacles[14][1] = "pat_maccarthy";
	spectacles[14][2] = "/programmation/pages_prog/pat_maccarthy.htm";
	spectacles[14][3] = "Pat Maccarthy";
	
	spectacles[15][1] = "patrice_michaud";
	spectacles[15][2] = "/programmation/pages_prog/patrice_michaud.htm";
	spectacles[15][3] = "Patrice Michaud - Le triangle des Bermudes";
	
	spectacles[16][1] = "peine_humour";
	spectacles[16][2] = "/programmation/pages_prog/peine_humour.htm";
	spectacles[16][3] = "Peine d'humour";
	
	spectacles[17][1] = "philippe_laprise";
	spectacles[17][2] = "/programmation/pages_prog/philippe_laprise.htm";
	spectacles[17][3] = "Philippe Laprise";
	
	spectacles[18][1] = "pierre_hebert";
	spectacles[18][2] = "/programmation/pages_prog/pierre_hebert.htm";
	spectacles[18][3] = "Pierre Hébert";
	
	spectacles[19][1] = "soirees_theatrales";
	spectacles[19][2] = "/programmation/pages_prog/soirees_theatrales.htm";
	spectacles[19][3] = "Les soirées théâtrales improvisées";
	
	spectacles[20][1] = "wonder_trois_quatre";
	spectacles[20][2] = "/programmation/pages_prog/wonder_trois_quatre.htm";
	spectacles[20][3] = "Les Wonder-trois-quatre";
	
	var x;
	for (x in spectacles)
	{
		document.getElementById('slideshow1').innerHTML += '<a href="'+spectacles[x][2]+'" alt="'+spectacles[x][3]+'" rel="gb_page_center[700, 450]"><img src="'+path+'images/'+spectacles[x][1]+'-03.png" width="129" height="152" border="0" title="'+spectacles[x][3]+'" /></a>'+ '\n';
		document.getElementById('slideshow2').innerHTML += '<a href="'+spectacles[x][2]+'" alt="'+spectacles[x][3]+'" rel="gb_page_center[700, 450]"><img src="'+path+'images/'+spectacles[x][1]+'-02.png" width="144" height="152" border="0" title="'+spectacles[x][3]+'" /></a>'+ '\n';
		document.getElementById('slideshow3').innerHTML += '<a href="'+spectacles[x][2]+'" alt="'+spectacles[x][3]+'" rel="gb_page_center[700, 450]"> <img src="'+path+'images/'+spectacles[x][1]+'-01.png" width="131" height="152" border="0" title="'+spectacles[x][3]+'" /></a>'+ '\n';
		
	}

    $('#slideshow1').cycle({
		fx: 'fade',
		speed: 2000,
		timeout: 10000,
		delay:  -2000,
		startingSlide: randomXToY(15,21)
    });
 
    $('#slideshow2').cycle({
		fx: 'fade',
		speed: 2000,
		timeout: 10000,
		delay:  -6000,
		startingSlide: randomXToY(1,7)
    });
	$('#slideshow3').cycle({
		fx: 'fade',
		random: 0,
		speed: 2000,
		timeout: 10000,
		delay:  1000,
		startingSlide: randomXToY(8,14)
    });
	//$('div#slideshow1, div#slideshow2, div#slideshow3').ifixpng(); 
	$(document).pngFix(); 
	
});

function randomXToY(minVal,maxVal,floatVal)
{
  var randVal = minVal+(Math.random()*(maxVal-minVal));
  return typeof floatVal=='undefined'?Math.round(randVal):randVal.toFixed(floatVal);
}
