var peutQuitterRallye	    ="Désirez-vous réellement quitter le Rallye des Histoires oubliées ?";
var peutQuitterJeux			="Désirez-vous réellement quitter le jeu ?";
var peutQuitterMotsCroise   ="Désirez-vous réellement quitter les Mots croisés ?";
var flashMarchePas			='<p>Il y a un probl&egrave;me avec votre installation de Flash ou votre navigateur. Avez-vous pris des mesures pour d&eacute;sactiver Flash ?</p>';
var mauvaiseVersionFlash	='<p>Afin de visionner ce vid&eacute;o, vous devez avoir Flash 8. Vous pouvez le t&eacute;l&eacute;charger sur <a href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">le site de Adobe.</a></p>';
var commentaireVide			="Il est interdit d'envoyer des champs vides. Veuillez entrer votre commentaire dans le champ texte prévu "+String.fromCharCode(224)+" cet effet.";
var nomVide					="Veuillez entrer votre nom.";
var courrielVide			="Veuillez vérifier que vous avez entré votre courriel correctement.";
var ALERT_TITLE 		    ="Histoires oubliées - Visionnement";
var vitesseConnection		="Pour vous offrir une meilleure expérience de visionnement, nous devons savoir qu’elle est la vitesse de votre connexion Internet.";
var hauteVitesse 			="Haute vitesse";
var basseVitesse 			="Basse vitesse";
var afficherTableauHonneurS ="Afficher le tableau d’honneur [+]";
var masquerTableauHonneurS  ="Masquer le tableau d’honneur [-]";
var ajoutePanierMsg  		="L’item a &eacute;t&eacute; ajout&eacute; au panier";
var peutQuitterCouloirDesSouvenirs = "Désirez-vous réellement quitter Le couloir des souvenirs ?";
var peutQuitterBibli 		= 'Désirez-vous réellement quitter Péripéties '+String.fromCharCode(224)+' la bibli ?';
var ALERT_TITLE1			="Histoires oubliées";
var ALERT_BTN 				="OK";
var traductxt = new Array();
traductxt["Acheter"]="Acheter";
traductxt["Louer"]="Louer";
traductxt["BoutiqueCoffretTitre"]="Coffrets DVD th&eacute;matiques";
traductxt["DVDUniteTelecharge"]="&Eacute;missions &agrave; l&rsquo;unit&eacute;";
traductxt["coffretsaison"]="Coffrets DVD des premi&egrave;res saisons";
traductxt["Precedent"]="Pr&eacute;c&eacute;dent";
traductxt["Suivant"]="Suivant";
// a corriger encore
traductxt["pasEncoreDisponible"] = "Cette émission n'est pas disponible pour la vente présentement.";

var urlPanierAllimago = "https://www.allimago.ca/boutique/controleurpanier";
//var urlPanierAllimago = "http://localhost:8080/boutique/controleurpanier";

var shoppingCartMsg = "";

var absoluteURI;
var mediaCourant;
var mediamode;
var voirextraitbaseuri;
var asyncXmlCallBackFunc;
var referer;
var popUpcentreX=780;
var hideFlashOnPup=false;
var medbackup=null;
var urlVideo="http://medias.histoiresoubliees.ca";

function preloader() {
	 MM_preloadImages(
		absoluteURI+'/images/'+'ho5_btn_visionnement_o.gif',
		absoluteURI+'/images/'+'ho5_btn_jeux_o.gif',
		absoluteURI+'/images/'+'ho5_btn_commentaires_o.gif',
		absoluteURI+'/images/'+'ho5_btn_horaire_o.gif',
		absoluteURI+'/images/'+'ho5_btn_encyclopedie_o.gif',
		absoluteURI+'/images/'+'ho5_btn_emission_o.gif',
		absoluteURI+'/images/'+'ho5_btn_Accueil_o.gif',
		absoluteURI+'/images/'+'ho5_logoVideotron_o.jpg',
		absoluteURI+'/images/'+'ho5_logoTFO_o.jpg',
		absoluteURI+'/images/'+'ho5_logoPVP_o.jpg',
		absoluteURI+'/images/'+'ho5_logoRadioCan_o.jpg',
		absoluteURI+'/images/'+'ho5_logoTelefilm_o_beige.jpg',
		absoluteURI+'/images/'+'ho5_logoVideotron_o_beige.jpg',
		absoluteURI+'/images/'+'ho5_logoTFO_o_beige.jpg',
		absoluteURI+'/images/'+'ho5_logoPVP_o_beige.jpg',
		absoluteURI+'/images/'+'ho5_logoRadioCan_o_beige.jpg',
		absoluteURI+'/images/'+'ho5_rallyHS_btn_commence_o.jpg',
		absoluteURI+'/images/'+'ho5_mmEntrer_o.jpg',
		absoluteURI+'/images/'+'ho5_videoEntrer_o.jpg',
		absoluteURI+'/images/'+'btn_commencer_o.gif',
		absoluteURI+'/images/'+'btn_AchatAccueil_o.jpg',
		absoluteURI+'/images/'+'ico_monCompteHo5_o.jpg'
	);
}

function setAbsoluteURI(absURI) {
	absoluteURI = absURI;
}

function setReferer(ref) {
	referer = ref;
}

/**
* http://www.devx.com/webdev/Article/28938/0/page/3
* url a appeler
* param�tres POST
* function a appeler quand c'est fini si on veut que ce soit async NOTE: un seul async a la fois est support�
**/
function asyncXmlCall(url, params, callBack) {
	var request;
	var ua = navigator.userAgent.toLowerCase();
	if (!window.ActiveXObject)
    	request = new XMLHttpRequest();
	else if (ua.indexOf('msie 5') == -1)
    	request = new ActiveXObject("Msxml2.XMLHTTP");
	else
    	request = new ActiveXObject("Microsoft.XMLHTTP");
	if (request.setTimeouts) {
		request.setTimeouts(3);//on ne tol�re pas que le call prenne plus de 3 secondes
	}
	if (callBack != null) {
		asyncXmlCallBackFunc = callBack;
		request.onreadystatechange=function(){
			if (request.readyState == 4 ) {
				if ((request.status >= 200 ) && ( request.status < 300 )) { 
					asyncXmlCallBackFunc(request); 
				}
			}
		}
		request.open("POST", url+params, true);
	} else {
		request.open("POST", url+params, false);
	}
	request.send(params);
	return request;
}

/**
 * Appel interserveur avec jsonp
 */
function callAllimago(params, callback) {
	 var s = document.createElement('script'); 
     //s.src = 'https://www.allimago.ca/boutique/controleurpanier?' + params + "&callback=" + callback;
     //s.src = 'http://localhost:8080/boutique/controleurpanier?' + params + "&callback=" + callback;
     s.src = urlPanierAllimago + "?" + params + "&callback=" + callback;
     
     s.type = 'text/javascript'; 
     document.body.appendChild(s); 
}

function onbodyload() {
	preloader();
	checkRadioCan();
	updateShippingCart();
}

/**
* D�tecte la pr�sence du frameset de radio-canada
**/
function checkRadioCan() {
	var nav = top;
	if (nav.lienExterne) {
		//radio-canada détecté
		ecrireCookie("referer", "radio-canada");
	}
}

/**
* r�ception des informations de panier
**/
function shoppingCartReceived(data) {
	var total= "0,00";
	var nbitem = 0;
	var msg = "";
	var url = null;
	if (data.total){
		total = data.total;
	}
	if (data.nbitem){
		nbitem = data.nbitem;
	}
	if (data.msg){
		msg = data.msg;
	}
	if (data.url){
		url = data.url
	}
	sdiv = document.getElementById("panierzonedyna");
	if (sdiv) {
		var txt;
		if (nbitem > 0) {
			txt = '<p>Panier<br /><a href="'+url+'">'+total+" -- "+nbitem+' item(s)</a></p>'+"\r\n";
		} else {
			txt = "<p><a href=\"http://www.allimago.ca/boutique/compte/resume?SKIN=ho5&referer="+referer+"\">Mon compte</a><br />Le panier est vide.</p>";
		}
		if (url == null) {
			txt = data;
		}
		sdiv.innerHTML = txt;
	}
	sdiv = document.getElementById("centrePanier");
	if (sdiv) {
		var txt = shoppingCartMsg;
		if (nbitem > 0) {
			txt = txt + "<p>"+total+" -- "+nbitem+' item(s)&nbsp;&nbsp;<a style="color:white;" href="'+url+'">( + d&eacute;tails)</a>'+"</p>\r\n";
			txt = txt + '<p><a href="'+url+'&refrer='+referer+'"><img src="'+absoluteURI+'/images/btn_passerAlaCaisse.jpg" alt="Passer &agrave; la caisse" /></a> <img src="'+absoluteURI+'/images/ico_paypal_pvp.jpg" alt="" /></p>' + "\r\n";
		} else {
			txt = txt + "<p>Le panier est vide.</p>";
		}
		if (url == null) {
			txt = shoppingCartMsg + data;
		}
		sdiv.innerHTML = txt;
	}
}

function surAjoutPanierReussi(msg) {
	replacediv = document.getElementById("achatBtn");
	shoppingCartMsg = msg;
	if (replacediv) {
		replacediv.innerHTML='<p class="erreur">'+msg+"</p>";
	}
	updateShippingCart();
	createAlertHtml(msg);
}
function updateShippingCart() {
	//var request = asyncXmlCall(absoluteURI+"/obtenirpanier.php", "", shoppingCartReceived);
	callAllimago("ACTION=AFFICHERRESUME", "shoppingCartReceived");
}

/**
* ajout de l'achat des droits d'un m�dia au panier!
**/
function ajouterDroitsAuPanier(media, estVideo) {
	//call allimago
	//request = asyncXmlCall(absoluteURI+"/ajouteritemaupanier.php", "?media="+media, null);
	callAllimago("ACTION=ADD&PRODUIT=" + media + "&CATEGORIE=" + (estVideo ? "HV" : "HI"), "surAjoutPanierReussi");
	//surAjoutPanierReussi(request);
}

/**
* ajout d'une �mission au super panier
**/
function ajouterEmissionAuPanier(emission) {
	//call allimago
	//request = asyncXmlCall(absoluteURI+"/ajouteritemaupanier.php", "?emission="+emission, null);	
	//surAjoutPanierReussi(request);
	callAllimago("ACTION=ADD&PRODUIT=" + emission + "&CATEGORIE=HE", "surAjoutPanierReussi");
}

/**
* ajouter
**/
function ajouterProduitAuPanier(produit, location){
	//call allimago
	/*request = asyncXmlCall(absoluteURI+"/ajouteritemaupanier.php", "?produit="+produit+"&location="+location, null);	
	surAjoutPanierReussi(request);*/
	callAllimago("ACTION=ADD&PRODUIT=" + produit + "&CATEGORIE=HP&VERSION=" + (location ? "14" : "15"), "surAjoutPanierReussi");
}

/**
* ajout d'une �mission au super panier
**/
function ajouterEmissionDVDAuPanier(emission) {
	//call allimago
	/*var request = asyncXmlCall(absoluteURI+"/ajouteritemaupanier.php", "?emission="+emission+"&version=2", null);	
	surAjoutPanierReussi(request);*/
	callAllimago("ACTION=ADD&PRODUIT=" + emission + "&CATEGORIE=HE&VERSION=2", "surAjoutPanierReussi");	
}

/**
* sur modification du paragraphe, d�sactive modification de media / liens
**/
function paragrapheChange() {
	med = document.getElementById('mediaEtLiens');
	if (med) {
			med.innerHTML = "";
	}	
}
function afficherarticle(emissionurl) {
	gotourl("/article/"+emissionurl);
}
function gotovisionnement(emissionurl) {
	gotourl("/Visionnement/"+emissionurl);
}
function gotoemission(emissionurl) {
	gotourl("/histoire/"+emissionurl);
}
function gotoachat(emissionurl) {
	gotourl("/histoire/"+emissionurl+"/achatlocation");
}

function getMainFrame() {
	var nav = top;
	while (nav.lienExterne) {
		nav = nav.lienExterne;
	}
	if (nav.mainFrame){
		return nav.mainFrame;
	}else{
		return null;
	}
}
function gotoaiderally() {
	var mainFrame = getMainFrame();
	mainFrame.location.href=absoluteURI+'/AideRallye';
}
function gotoencyclopedie() {
	var mainFrame = getMainFrame();
	mainFrame.location.href=absoluteURI+'/Encyclopedie_collective';
}
function gotourl(url){
	window.location.href=absoluteURI+url;
}
function antiback(backstate){
	if (backstate==1){
		setTimeout('gotoaiderally()',1000);
	}else{
		if (confirm(peutQuitterRallye)) {
			window.top.location.href='/Jeux';
		} else {
			setTimeout('gotoaiderally()',1000);
		}
	}
}

function isSafari(){
	if ((navigator)&&(navigator.vendor)) {
		if (navigator.vendor.indexOf("Apple") >= 0) {
			return true;
		}
	}
	return false;
}

var popup;
function popupGramophone(url) {
	if (popup) {
		if (!popup.closed && popup.location) {
			popup.focus();
			return;
		}
	}
	var x=0;
	var y=0;
	if (window.screenX) {
		y=window.screenY+200;
		if(window.innerWidth){
			x=window.screenX+window.innerWidth/2-200;
		} else {
			x=window.screenX+200;
		}
	} else {
		x= -200 +window.screen.availWidth/2;
		y= 200;
	}
	if (isSafari()){
		w=403;
		h=263;
	}else{
		w=400;
		h=260;
	}
	popup = window.open(url, 'popupgramophone', 'width='+w+',height='+h+',left='+x+',top='+y);  
	if (window.focus) {popup.focus()}
}
function focusself(){
	window.focus();
}
function pagePopup(url) {
	popup = window.open(url, '');  
	if (window.focus) {popup.focus()}
	return false;
}
function popUpEditWin(url, winid) {
	popup = window.open(url, winid, 'width=330,height=300');  
	if (window.focus) {popup.focus()}
	return false;
}
function popUpMediagraphie(url) {
	popup = window.open(url, "mediagraphie", 'width=800,height=600,scrollbars=1,status=1');  
	if (window.focus) {popup.focus()}
	return false;
}
function popArticleNav(url) {
	popup = window.open(url, "articleNav", 'width=300,height=600,scrollbars=1,status=1');  
	if (window.focus) {popup.focus()}
	return false;
}

function imagePopup(url,w,h) {
	PosX = (screen.width - width) / 2;
	PosY = (screen.height - height) / 2;
	popup = window.open(url, 'ImageHistoireOubliees', "width=" + w + ",height="+h+",location=no,menubar=no,personalbar=no,resizable=yes, top="+PosY+",left="+PosX+",screenX=" + PosX +",screenY=" + PosY + ",locationbar=no,scrollbars=yes,directories=no,statusbar=no,toolbar=no");  
	if (window.focus) {popup.focus()}
	return false;
}
function ecrireCookie(nom, valeur) {
	document.cookie=nom+"="+escape(valeur);
}

function getCookieVal(offset)
{
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom) {
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen){
		var j=i+alen;
		if (document.cookie.substring(i, j)==arg) {
			return getCookieVal(j);}
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) {
			break;	}
	}
	return null;
}
function pageImprimer() {
	window.print();
	return false;
}
function changerMessage(div_id, div_msg)
{
	document.getElementById(div_id).innerHTML = div_msg;
}
function viderRecherche()
{
	if(document.getElementById("frmrecherche").q.value == 'Rechercher ici')
		document.getElementById("frmrecherche").q.value = '';
	return false;
}
function puisjeeffacer() {
	return confirm("effacer cet item?");
}
function peutQuitterRally() {
	peutQuitterRallyVers(absoluteURI+"/Rallye");
}
function peutQuitterRallyVers(dest) {
	var quitter= confirm(peutQuitterRallye);		
	if (quitter) {
		top.location.href=dest;
	}
}
function peutQuitter(section, en) {
	var mainFrame = getMainFrame();
	if (mainFrame) {
		if ((en)&&(en.parentNode.parentNode.id!="topLeft")) {
			peutQuitterRallyVers(en.href)
			return false;
		} else {
			return true;
		}
	} else if (section == 321) {
		return confirm(peutQuitterMotsCroise);
	} else if (section == 341) {
		return confirm(peutQuitterCouloirDesSouvenirs);
	} else if (section == 361) {
		return confirm(peutQuitterBibli);
	} else {
		return true;
	}
}
function puisjeregenerer() {
	return confirm("Désirez-vous réellement ecraser les fichiers xml de illico avec les donnees contenues dans la base de donnees?");
}
function runFlash(uri, width, height, silentMode, noScale) {
	var tag =
	'<div id="flash"><object type="application/x-shockwave-flash" width="' + width + 'px" height="' + height + 'px" data="' + uri + '" id="flashobject">';
	tag=tag+'<param name="wmode" value="transparent" />';
	tag=tag+'<param name="AllowScriptAccess" value="always" />';
	
	if (noScale) {
		tag=tag+'<param name="scale" value="noscale" />';
	}
	tag=tag+'<param name="movie" value="' + uri + '" />';
	if (!silentMode) {
		tag=tag+flashMarchePas;
	}
	tag=tag+'</object></div>';
	return tag;
}

/**
* script pour afficher un flash avec d�tection de version et autoinstall si necessaire
**/
function afficherFlash(uri, width, height, silentMode) {
	afficherFlashNoScale(uri, width, height, silentMode, false);
}

function afficherFlashNoScale(uri, width, height, silentMode, noScale) {
	var requiredMajorVersion = 8;
	var requiredMinorVersion = 0;
	var requiredRevision     = 0;
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	var hasProductInstall = DetectFlashVer(6, 0, 65);
	if ( hasProductInstall && !hasReqestedVersion && !silentMode ) {
		// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
	
		AC_FL_RunContent(
			"src", absoluteURI + "/swf/playerProductInstall",
			"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
			"width", width,
			"height", height,
			"align", "middle",
			"id", "detectionExample",
			"quality", "high",
			"bgcolor", "#3A6EA5",
			"name", "detectionExample",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
	}
	if (hasReqestedVersion) {
		document.write(runFlash(uri, width, height, silentMode, noScale));
	} else if (!silentMode) {		
		var tag = mauvaiseVersionFlash;
		document.write(tag);
	}
}


function afficherFlashNoScaleTransparent(uri, width, height, silentMode, noScale) {
	var requiredMajorVersion = 8;
	var requiredMinorVersion = 0;
	var requiredRevision     = 0;
	var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	var hasProductInstall = DetectFlashVer(6, 0, 65);
	if ( hasProductInstall && !hasReqestedVersion && !silentMode ) {
		// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
	
		AC_FL_RunContent(
			"src", absoluteURI + "/swf/playerProductInstall",
			"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
			"width", width,
			"height", height,
			"align", "middle",
			"id", "detectionExample",
			"quality", "high",
			"wmode", "transparent",
			"name", "detectionExample",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
	}
	if (hasReqestedVersion) {
		document.write(runFlash(uri, width, height, silentMode, noScale));
	} else if (!silentMode) {		
		var tag = mauvaiseVersionFlash;
		document.write(tag);
	}
}

function afficherFilm(absoluteURI, vod, urlswf, width, height, fond, psup) {
	var uri = absoluteURI + "/swf/loader" + vod + ".swf";
	if ((urlswf==null) || (urlswf=='')) {
		uri = uri + "?urlxml=" + absoluteURI + "/xml/filmsdeemission.php&urlvideo="+urlVideo+"/";
	} else {
		uri = uri + "?urlvideo=" + urlVideo + "/" + urlswf;
	}
	uri=uri + "&skin=" + absoluteURI + "/swf/skin/MojaveExternalNoVol.swf" + "&fond=" + fond + "&urlvod=" + absoluteURI + "/swf/" + vod;
	if (psup != null) {
		uri=uri+psup;
	}
	afficherFlashNoScale(uri, width, height, false, width==320);
}
/**
* cr�ation d'une boite modale
* d'apr�s le code t�l�charger sur: http://www.slayeroffice.com/code/custom_alert/
* 0 = �chec complet
* 1 = r�ussit compl�te
* 2 = r�ussite mais �chec positionnement
**/
function createModalBox(title) {
	var erreur=1;
	// shortcut reference to the document object
	var d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return 0;

	// create the modalContainer div as a child of the BODY element
	var mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	if ((document.documentElement)&&(document.documentElement.scrollHeight)){
		mObj.style.height = document.documentElement.scrollHeight + "px";
	} else {
		mObj.style.height = 2048 + "px";
	}

	// create the DIV that will be the alert 
	var alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera && (!window.XMLHttpRequest)) {
		//ex�cuter ce code si pas op�ra, si internet exploreur si pas version 7 de ie
		if ((document.documentElement) && (document.documentElement.scrollTop) &&
			(alertObj.style) ) {
			alertObj.style.top = document.documentElement.scrollTop + "px";
//			alertObj.style.position = "relative";
		} else {
			//non support�, on est probablement avec IE pour MAC...
			erreur=2;
		}
	}
	if (popUpcentreX>0) {
		//centrage manuel
		alertObj.style.left = (popUpcentreX - alertObj.offsetWidth)/2 + "px";
	} else {
		//centrage auto
		// center the alert box
		if ((document.documentElement) && (document.documentElement.scrollWidth) && 
			(alertObj.style) ) {
			alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";
		} else {
				erreur=2;
		}
	}

	// create an H1 element as the title bar
	var h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(title));

	if (hideFlashOnPup) {
		var fm = document.getElementById("flashMedia");
		if (fm.scrollHeight) {
			medbackup = fm.innerHTML;
			fm.innerHTML='<div style="height:'+fm.scrollHeight+'px"></div>';
		}
	}
	return erreur;
}

/**
* cr�ation d'une boite avec un bouton OK
**/
function createAlert(txt) {
	var erreur=createModalBox(ALERT_TITLE1);
	if (erreur>0) {
		// shortcut reference to the document object
		d = document;
		var alertObj = d.getElementById("alertBox");

		// create a paragraph element to contain the txt argument
		var msg = alertObj.appendChild(d.createElement("p"));
		msg.appendChild(d.createTextNode(txt));
	
		// create an anchor element to use as the confirmation button.
		var btn = alertObj.appendChild(d.createElement("a"));
		btn.className = "closeBtn";
		btn.appendChild(d.createTextNode(ALERT_BTN));
		btn.href = "#";
		// set up the onclick event to remove the alert when the anchor is clicked
		btn.onclick = function() { removeCustomAlert(); return false; }
		
		return false;
	}
	return true;
}

/**
* cr�ation d'une boite avec un bouton OK
**/
function createAlertHtml(html) {
	var erreur=createModalBox(ALERT_TITLE1);
	if (erreur>0) {
		// shortcut reference to the document object
		d = document;
		var alertObj = d.getElementById("alertBox");

		// create a paragraph element to contain the txt argument
		//msg = alertObj.appendChild(d.createElement("p"));
		//msg.appendChild(d.createTextNode(txt));
		alertObj.innerHTML = "<p>" + html + "</p>";
	
		// create an anchor element to use as the confirmation button.
		var btn = alertObj.appendChild(d.createElement("a"));
		btn.className = "closeBtn";
		btn.appendChild(d.createTextNode(ALERT_BTN));
		btn.href = "#";
		// set up the onclick event to remove the alert when the anchor is clicked
		btn.onclick = function() { removeCustomAlert(); return false; }
		
		//if (erreur==1) {
			return false;
		//};
	}
	return true;
}
/*
function createCustomAlert(txt) {
  // shortcut reference to the document object
  d = document;

  // if the modalContainer object already exists in the DOM, bail out.
  if(d.getElementById("modalContainer")) return;

  // create the modalContainer div as a child of the BODY element
  mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
  mObj.id = "modalContainer";
   // make sure its as tall as it needs to be to overlay all the content on the page
  mObj.style.height = document.documentElement.scrollHeight + "px";

  // create the DIV that will be the alert 
  alertObj = mObj.appendChild(d.createElement("div"));
  alertObj.id = "alertBox";
  // MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
  if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
  // center the alert box
  alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

  // create an H1 element as the title bar
  h1 = alertObj.appendChild(d.createElement("h1"));
  h1.appendChild(d.createTextNode(ALERT_TITLE));

  // create a paragraph element to contain the txt argument
  msg = alertObj.appendChild(d.createElement("p"));
  msg.innerHTML = txt;
  
  // create an anchor element to use as the confirmation button.
  btn = alertObj.appendChild(d.createElement("a"));
  btn.id = "closeBtn";
  btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
  btn.href = "#";
  // set up the onclick event to remove the alert when the anchor is clicked
  btn.onclick = function() { removeCustomAlert();return false; }
}

// removes the custom alert from the DOM
function removeCustomAlert() {
  document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}

*/

//steve@slayeroffice.com
//custom alert
//modifi� par Tommy Bri�re
//retourne vrai si le navigateur ne permet pas un positionnement correct de la boite...
function createCustomAlert(txt, btn1, btn2, callBackFunction) {
	var erreur=createModalBox(ALERT_TITLE);
	if (erreur>0) {

		// shortcut reference to the document object
		d = document;
		var alertObj = d.getElementById("alertBox");
		alertObj.style.left = "75px";

		// create a paragraph element to contain the txt argument
		msg = alertObj.appendChild(d.createElement("p"));
		msg.appendChild(d.createTextNode(txt));
	
		// create an anchor element to use as the confirmation button.
		btn = alertObj.appendChild(d.createElement("a"));
		btn.className = "closeBtn";
		btn.appendChild(d.createTextNode(btn1));
		btn.href = "#";
		// set up the onclick event to remove the alert when the anchor is clicked
		btn.onclick = function() { removeCustomAlert(); callBackFunction(1); return false; }
	
		// create an anchor element to use as the confirmation button.
		btn = alertObj.appendChild(d.createElement("a"));
		btn.className = "closeBtn";
		btn.appendChild(d.createTextNode(btn2));
		btn.href = "#";
		// set up the onclick event to remove the alert when the anchor is clicked
		btn.onclick = function() { removeCustomAlert(); callBackFunction(2); return false; }
	
		//if (erreur==1) {
			return false;
		//};
	}
	return true;
}

// removes the custom alert from the DOM
function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
	/*if (medbackup!=null) {
		document.getElementById("flashMedia").innerHTML = medbackup;
		medbackup=null;
	}*/
}
function reponseConnection(reponse) {
	if (reponse==1){
		connectionBasse();
	}else{
		connectionHaute();
	}
}
function demanderConnection() {
	return createCustomAlert(vitesseConnection, basseVitesse, hauteVitesse, reponseConnection);
}
function pasEncoreDisponible() {
	createAlert(traductxt["pasEncoreDisponible"]);
}
function connectionHaute() {
	ecrireCookie("vitesseConnection", "haute");
	afficherHauteQualite(mediaCourant);
}
function connectionBasse() {
	ecrireCookie("vitesseConnection", "basse");
	afficherBasseQualite(mediaCourant)
}
function afficherHauteQualite(media) {
	if (mediamode=="bande") {
		window.location.href=absoluteURI+"/histoire/"+media+"/extraithautequalite";
	} else {
		window.location.href=voirextraitbaseuri+"/filmhautequalite";
	}
}
function afficherBasseQualite(media) {
	if (mediamode=="bande") {
		window.location.href=absoluteURI+"/histoire/"+media;
	} else {
		window.location.href=voirextraitbaseuri+"/filmbassequalite";
	}
}
function voirmedia(media) {
	mediaCourant=media;
	var vconnection=LireCookie("vitesseConnection");
	if (vconnection=="haute"){
		afficherHauteQualite(media);
	}else if (vconnection=="basse") {
		afficherBasseQualite(media);
	}else{
		afficherBasseQualite(media);
	}
	return false;
}
function voirbandeannonce(media) {
	mediamode = "bande";
	return voirmedia(media);
}
function voirextrait(articleUrl, media) {
	mediamode = "encyclo";
	voirextraitbaseuri = articleUrl.href;//"articleUrl";
	return voirmedia(media);
}
//Commentaires validation avant submit
	function emailvalidation(entered, alertbox)
	{
		with (entered)
		{
			apos=value.indexOf("@"); 
			dotpos=value.lastIndexOf(".");
			lastpos=value.length-1;
			if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
				if (alertbox) {
					createAlert(alertbox); } 
				return false;
			} else {
				return true; }
		}
	} 

	function emptyvalidation(entered, alertbox){
		with (entered){
		if (value==null || value==""){
			if (alertbox!="") {createAlert(alertbox);} return false;}
			else {return true;}
		}
	} 
	
	function formvalidation(thisform){
		with (thisform)	{
			if (emptyvalidation(commentaires,commentaireVide)==false) {commentaires.focus(); return false;};
			if (emptyvalidation(nom,nomVide)==false) {nom.focus(); return false;};
		}
		var antispam = document.getElementById("antispam");
		antispam.value="javascript_aprouve";
		return true;
	}
var clickatable=new Array();
var indexContenuSectionId;
function setSection(sectionId) {
	indexContenuSectionId = sectionId;
}
function lienonclick(e) {
	var targ;
	if (!e) {
		e = window.event;
	}
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
	if (targ.nodeType == 1) // defeat Safari bug
		targ = targ.parentNode;
	if (targ.id == 'lienEncyclopedie'){
		return peutQuitter(indexContenuSectionId, false)
	}else{
		return peutQuitter(indexContenuSectionId, targ)
	}
}
function overAccueil(e) {
	var image = 'ho5_btn_Accueil';
	var idImage = 'imageAccueil';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overEmission(e) {
	var image = 'ho5_btn_emission';
	var idImage = 'imageEmission';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overJeux(e) {
	var image = 'ho5_btn_jeux';
	var idImage = 'imageJeux';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overEncyclopedie(e) {
	var image = 'ho5_btn_encyclopedie';
	var idImage = 'imageEncyclopedie';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overHoraire(e) {
	var image = 'ho5_btn_horaire';
	var idImage = 'imageHoraire';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overCommentaire(e) {
	var image = 'ho5_btn_commentaires';
	var idImage = 'imageCommentaire';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
/*function overVisionnement(e) {
	var image = 'ho5_btn_visionnement';
	var idImage = 'imageVisionnement';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}*/
function overBoutique(e) {
	var image = 'ho5_btn_boutique';
	var idImage = 'imageBoutique';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function overMonCompte(e) {
	var image = 'ho5_btn_visionnement';
	var idImage = 'imageMonCompte';
	MM_swapImage(idImage, '', absoluteURI + "/images/" + image + "_o.gif");
}
function ajouterEvenements(idLien, idImage, func, secid) {
	var lien, image;
	lien = MM_findObj(idLien, null);
	image = MM_findObj(idImage, null);
	if ((indexContenuSectionId >= secid) && (indexContenuSectionId < secid+100)) {
			var l;
			var src = image.src;
			l = src.length;
			src = src.substr(0, l-4)+"_s.gif";
			image.src=src;
	} else {
		lien.onmouseover=func;
		lien.onmouseout=MM_swapImgRestore;
	}
	lien.onclick=lienonclick;
}

function masquerTableauHonneur(tab) {
	var el= document.getElementById('tableauHighScore'+tab);
	var txt = document.getElementById('lienActionMasquer'+tab);
	if (el.style.display == 'none') {
		el.style.display = '';
		txt.innerHTML =masquerTableauHonneurS;
	} else {
		el.style.display = 'none';
		txt.innerHTML =afficherTableauHonneurS;
	}
	return false;
}

function positionnerCurseur() {
	var input = document.getElementById("firstField");
	if (input) {
		input.focus();
	}
}
/**
* formatte l'affichage du temps
**/
function formatterTemps(secondes) {
	if (secondes < 60) {
		return secondes + " s";
	} else {
		var minutes = Math.floor(secondes / 60);
		if (minutes >= 60) {
			var heures = Math.floor(minutes / 60);
			return heures + " h " + minutes % 60 + " m " + secondes % 60 + " s";
		} else {
			return minutes + " m " + secondes % 60 + " s";
		}
	}
}

/**
* G�n�ration du code html pour afficher les d�tails sur un DVD
* retourne le html
**/
function afficheDVDUnite(emission) {
/*	var html = "";
	var infourl = absoluteURI+'/histoire/'+emission[1];
	var duree = formatterTemps(emission[8]);
	var s = emission[7];
	var img = 0;
	if (s=="I") {
		img=1;
	} else if (s=="II"){
		img=2;
	} else if (s=="III"){
		img=3;
	} else if (s=="IV") {
		img=4;
	} else if (s=="V") {
		img=5;
	}	
	img += 1922;
	html += '<a href="'+infourl+'" class="imgDvd"><img src="'+absoluteURI+'/images/boutique/'+img+'" alt="" /></a>'+"\r\n";
//	html += '<a href="'+infourl+'" class="imgDvd"><img src="'+absoluteURI+'/images/encyclopedie/'+emission[4]+'.jpg" alt="" /></a>'+"\r\n";
	html += '<div><p><b>'+emission[0]+'</b><br />'+duree+'&nbsp;...<a href="'+infourl+'">[+]</a></p></div>'+"\r\n";
	if (emission[3]==1) {
		html += '<a class="boutonEmissionDvd gauche" href="#" onclick="ajouterEmissionDVDAuPanier('+emission[2]+'); return false;"><b>'+emission[5]+' $</b><br /><span>'+traductxt["Acheter"]+'</span></a>'+"\r\n";
		html += '<a class="boutonEmissionDvd droite" href="#" onclick="ajouterEmissionAuPanier('+emission[2]+'); return false;"><b>'+emission[6]+' $</b><br /><span>'+traductxt["Louer"]+'</span></a>'+"\r\n";	
	}
	
	
	*/

	html = runFlash("/swf/demo_custom_caption.swf", 665, 325, true, false);
	
	return html;
}

function afficheDVDHeader(htmlnav) {
	var html = "";
	html += '<div class="boutiqueDvdsTop">' + "\r\n";
	html += '<p class="btnRetourHaut"><a href="#">Haut</a></p>' + "\r\n";
	html += '<div class="iconeDvd"></div>' + "\r\n";
	html += '<h2>'+traductxt["DVDUniteTelecharge"]+'</h2>' + "\r\n";
	html += ''+ htmlnav + "\r\n";
	html += '</div>' + "\r\n";
	html += '<div class="boutiqueDvdsCentre">'+"\r\n";
	html += '<ul class="dvdBleu">'+"\r\n";
	return html;
}
function afficheDVDFooter(htmlnav) {
	var html = "";
	html += '</ul>'+"\r\n";
	html += '</div>'+"\r\n";
	return html;
}
function afficheCoffretHeader(htmlnav) {
	var html = "";
	html += '<div class="boutiqueDvdsTop">' + "\r\n";
	html += '<p class="btnRetourHaut"><a href="#">Haut</a></p>' + "\r\n";
	html += '<div class="iconeDvd"></div>' + "\r\n";
	html += '<h2>'+traductxt["BoutiqueCoffretTitre"]+'</h2>' + "\r\n";
	html += ''+ htmlnav + "\r\n";
	html += '</div>' + "\r\n";
	html += '<div class="boutiqueDvdsCentre">'+"\r\n";
	html += '<ul class="dvdVert">'+"\r\n";
	return html;
}
function afficheCoffretUnite(emission) {
	var html = "";
	var infourl = absoluteURI+'/Boutique/'+emission[2];
	var duree = formatterTemps(emission[1]);
	html += '<a href="'+infourl+'" class="imgDvd"><img src="images/boutique/'+emission[6]+'" alt="" /></a>'+"\r\n";
	html += '<div><p><b>'+emission[0]+'</b><br />'+duree+'&nbsp;...<a href="'+infourl+'">[+]</a></p></div>'+"\r\n";
	html += '<a class="boutonEmissionDvd gauche" href="#" onclick="ajouterProduitAuPanier('+emission[4]+', false); return false;"><b>'+emission[3]+' $</b><br /><span>'+traductxt["Acheter"]+'</span></a>'+"\r\n";
	html += '<a class="boutonEmissionDvd droite" href="#" onclick="ajouterProduitAuPanier('+emission[4]+', true); return false;"><b>'+emission[5]+' $</b><br /><span>'+traductxt["Louer"]+'</span></a>'+"\r\n";	
	return html;
}

function afficheSaisonHeader(htmlnav) {
	var html = "";
	html += '<div class="boutiqueDvdsTop">' + "\r\n";
	html += '<p class="btnRetourHaut"><a href="#">Haut</a></p>' + "\r\n";
	html += '<div class="iconeDvd"></div>' + "\r\n";
	html += '<h2>'+traductxt["coffretsaison"]+'</h2>' + "\r\n";
	html += ''+ htmlnav + "\r\n";
	html += '</div>' + "\r\n";
	html += '<div class="boutiqueDvdsCentre">'+"\r\n";
	html += '<ul class="dvdBrun">'+"\r\n";
	return html;
}

function afficheSaisonUnite(emission) {
	var html = "";
	var infourl = absoluteURI+'/Boutique/'+emission[2];
	var duree = formatterTemps(emission[1]);
	html += '<a href="'+infourl+'" class="imgDvd"><img src="'+absoluteURI+'/images/boutique/'+emission[6]+'" alt="" /></a>'+"\r\n";
	html += '<div><p><b>'+emission[0]+'</b><br />'+duree+'&nbsp;...<a href="'+infourl+'">[+]</a></p></div>'+"\r\n";
	html += '<a class="boutonEmissionDvd gauche" href="#" onclick="ajouterProduitAuPanier('+emission[4]+', false); return false;"><b>'+emission[3]+' $</b><br /><span>'+traductxt["Acheter"]+'</span></a>'+"\r\n";
	html += '<a class="boutonEmissionDvd droite" href="#" onclick="ajouterProduitAuPanier('+emission[4]+', true); return false;"><b>'+emission[5]+' $</b><br /><span>'+traductxt["Louer"]+'</span></a>'+"\r\n";	

	return html;
}

/**
* Affichage des commentaires
**/
function afficheComHeader(htmlnav) {
	var html = "";
	html += '<div id="accueilCommentairesCommentaire">' + "\r\n";
	return html;
}

function afficheComUnite(comm) {
	var html = "";
	html += '<div class="accueilCommentaireSeparateur"></div>' + "\r\n";
	html += '<p><b>' + comm[0] + '</b></p>' + "\r\n";
	html += '<p>'+comm[1]+'</p>' + "\r\n";
	html += '<p><i>'+comm[2]+'</i></p>	' + "\r\n";
	return html;
}

function afficheComFooter(htmlnav) {
	var html = "";
	html += '<div class="accueilCommentaireSeparateur"></div>' + "\r\n";
	html += '<p class="commentairesTotal">' + htmlnav + '</p>' + "\r\n";
	html += '</div>' + "\r\n";
	return html;
}

/**
* Affichage des fiches
**/
function afficheFicheHeader(htmlnav) {
	var html = "";
	html += '<ul>' + "\r\n";
	return html;
}

function afficheFicheUnite(fiche) {
	var html = "";
	html += '<a href="'+absoluteURI+'/article/'+fiche[0]+'/'+fiche[1]+'" class="img"><img alt="" src="'+absoluteURI+'/images/apercu/'+fiche[2]+'.jpg" /></a><a href="'+absoluteURI+"/article/"+fiche[0]+'/'+fiche[1]+'">' + fiche[3] + '</a>'+ "\r\n";
	return html;
}

function afficheFicheFooter(htmlnav) {
	var html = "";
	html += '</ul>' + "\r\n";
	html += '<p class="resultat">'+htmlnav+'</p>'+"\r\n";
	return html;
}

/**
* Affichage des fiches
**/
function afficheFicheThemeHeader(htmlnav) {
	var html = "";
	html += '<ul>' + "\r\n";
	return html;
}

function afficheFicheThemeUnite(fiche) {
	var html = "";
	html += '<a href="'+fiche[0]+'" class="img"><img alt="'+fiche[1]+'" src="'+absoluteURI+'/images/apercu/'+fiche[2]+'.jpg" /></a><a href="'+fiche[0]+'">'+fiche[3]+'</a>' + "\r\n";
	return html;
}

function afficheFicheThemeFooter(htmlnav) {
	var html = "";
	html += '</ul>' + "\r\n";
	html += '<p class="resultat">'+htmlnav+'</p>'+"\r\n";
	return html;
}
/**
* Affichage des �missions
**/
function afficheEmissionHeader(htmlnav) {
	var html = "";
	html += '<ul>' + "\r\n";
	return html;
}

function afficheEmissionUnite(fiche) {
	var html = "";
	html += '<a href="'+absoluteURI+'/histoire/'+fiche[3]+'" class="img"><img alt="" src="'+absoluteURI+'/images/apercu/'+fiche[2]+'.jpg" /></a><a href="'+absoluteURI+'/histoire/'+fiche[3]+'">'+fiche[1]+'</a>' + "\r\n";
	return html;
}

function afficheEmissionFooter(htmlnav) {
	var html = "";
	html += '</ul>' + "\r\n";
	html += '<p class="resultat">'+htmlnav+'</p>'+"\r\n";
	return html;
}

var navEmissionId=-1;
function setEmissionCourante(emissionId) {
	if (navEmissionId<0){
		return;
	}
	var navinfo = navigateurs[navEmissionId];
	var produits = navinfo[0];

	for (var i=0; i < produits.length; i++) {
		var produit=produits[i];
		if (produit[0]==emissionId) {
			break;
		}
	}
	changePage(navEmissionId, Math.floor(i / 5));
	var produit=produits[i];
	var btnAcheter = document.getElementById("btnEmAcheterDVD");
	var btnLouer = document.getElementById("btnEmLouerDVD");
	var lienAgrandir = document.getElementById("lienAgrandir");
	lienAgrandir.href=absoluteURI+'/histoire/'+produit[3]+'/extraithautequalite';
	if (produit[4]==1){
		btnAcheter.onclick= function () {
			ajouterEmissionDVDAuPanier(produit[0]); 
			return false;
		};
		btnAcheter.className="boutonEmissionDvd";
		btnLouer.onclick= function() {
			ajouterEmissionAuPanier(produit[0]); 
			return false;
		}
		btnLouer.className="boutonEmissionLouer";
	} else {
		btnAcheter.onclick= function () {
			pasEncoreDisponible(); 
			return false;
		}
		btnAcheter.className="boutonEmissionDvd off";
		btnLouer.onclick= function() {
			pasEncoreDisponible(); 
			return false;
		}
		btnLouer.className="boutonEmissionLouer off";
	}
}

/**
* affiche le navigateur de produit
**/
var navigateurs = new Array();
function afficherNavigateur(produits, nbparligne, headerfunc, footerfunc, afficheitem, autoli, navigateur) {
	var nid = navigateurs.length;
	if ((navigateur)&&(navigateur.length>0)) {
	} else {
		navigateur = "navigateur"+nid;
		document.write("<div id=\"navigateur"+nid+"\">"+"\r\n");
		document.write("</div>"+"\r\n");
	}
	var navinfo = new Array(produits, nbparligne, headerfunc, footerfunc, afficheitem, autoli, navigateur);
	navigateurs.push(navinfo);
	changePage(nid, 0);
	return nid;
}

/**
* changement de la page dans le navigateur de page
**/
function changePage(nid, page) {
	var navinfo = navigateurs[nid];
	var navigateur = document.getElementById(navinfo[6]);
	var nbparligne = navinfo[1];
	var debut = nbparligne*page;
	var fin = debut+nbparligne;
	var produits = navinfo[0];
	if (fin>produits.length){
		fin=produits.length;
	}

	var html = "";
	var nbpage = Math.ceil(produits.length / nbparligne);
	var nbpageaffiche = 25;
	if (nbpage > 1) {
		var pmin = Math.floor(page-nbpageaffiche/2+1);
		if (pmin<1) {
			pmin = 1;
		}
		if (nbpage<=nbpageaffiche) {
			pmin = 1;
		}
		var pmax = pmin + nbpageaffiche-1;
		if (pmax>nbpage) {
			pmax=nbpage;
		}
		html += "Pages:&nbsp;&nbsp;&nbsp;&nbsp;";
		if (page > 0) {
			html += "<a class=\"accueilBtnPrecedent\" href=\"javascript: changePage("+nid+", "+(page-1)+");\">" + traductxt["Precedent"] + "</a>";
		}else{
			html += "<a class=\"accueilBtnPrecedent\" >" + traductxt["Precedent"] + "</a>";
		}
		html += "&nbsp;&nbsp;";
		for (var i = pmin; i <= pmax; i++) {
			if (page+1==i) {
				html += " "+i+" ";
			} else {
				html += " <a href=\"javascript: changePage("+nid+", "+(i-1)+");\">" + i + "</a> ";
			}
		}
		html += "&nbsp;&nbsp;";
		if (page+1 < nbpage) {
			html += "<a class=\"accueilBtnSuivant\" href=\"javascript: changePage("+nid+", "+(page+1)+");\">" + traductxt["Suivant"] + "</a> ";
		}else{
			html += "<a class=\"accueilBtnSuivant\" >" + traductxt["Suivant"] + "</a> ";
		}
		html += "\r\n";
	}
	var navbar = html;
	html = navinfo[2](navbar);//en-t�te
	for (var i = debut; i < fin; i++) {
		if (navinfo[5]) {
			html += "<li>"+"\r\n";
		}
		html += navinfo[4](produits[i]) 
		if (navinfo[5]) {
			html += "</li>"+"\r\n";
		}
	}
	html += navinfo[3](navbar);//footer
	navigateur.innerHTML = html;
}

/**
* gestion d'un click sur la liste de photos et vid�oes
**/
function photoVideoFicheClick(mediaid, mediaIsVideo, url, copyright) {
	var div = document.getElementById("mediabt");
	var html = "";
	if (mediaIsVideo) {
		html += '<div id="flashMedia">' + "\r\n";
		var uri = absoluteURI + "/swf/loadervod320.swf";
		uri = uri + "?urlvideo=" + urlVideo + "/320x240/" + mediaid + ".flv";
		uri = uri + "&skin=" + absoluteURI + "/swf/skin/MojaveExternalNoVol.swf&fond=boutique&urlvod=" + absoluteURI + "/swf/vod320";
		html += runFlash(uri, 297, 380, false, true);
		html += '</div>' + "\r\n";
	} else {
		html += '<a href="'+url+'"><img width="297" height="223" alt="" src="'+absoluteURI+'/images/illicopleinecran/'+mediaid+'.jpg" /></a>' + "\r\n";
		html += '<p class="descriptionVideo">'+copyright+"</p>";
	}
	div.innerHTML = html;
}

/**
* sur changement de s�lection dans le navigateur rapide
**/
function emission_sel_rapide_change() {
	var sel = document.getElementById('emission_sel_rapide');
	var index = sel.selectedIndex;
	if (index>0) {
		var i = sel.options[index];
		document.location.href=absoluteURI+"/histoire/"+i.value;
	}
}
//Function Macromedia DreamWeaver
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_changeProp(objName,x,theProp,theValue) 
{ //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style))
  {
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_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];}
}

