/* ---- scripts LEXPRESS.fr --- */
/* Affichage de la date */
function display_date()
{
var tj= new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
var tm= new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","ao&ucirc;t","septembre","octobre","novembre","d&eacute;cembre");
var truedate;
d= new Date() ;
truedate= d.getYear();
if (truedate < 1900) truedate+= 1900;
document.write( tj[d.getDay()] + " " + d.getDate() + " " + tm[d.getMonth()]  + " " + truedate) ;
}

function imprime()
{
var url;
if (typeof idcontenu == 'undefined')
 alert('Désolé, cette page ne peut pas être imprimée');
else {
  url= '/formatimp/default.asp?idcontenu='+idcontenu+'&typecontenu='+typecontenu+'&url='+escape(window.location);
  OpenWindow(url, 1, 0, 1, 1, 1, 1,700, 700, 0, 0);}
}
function envoiami()
{
document.location='/envoiami/default.asp?url='+escape(window.location);
}
function OpenWindow(a_url, a_tb, a_loc, a_dir, a_mb, a_sb, a_res, a_width, a_height, a_left, a_top)
   {
   var mafen;
   winStats='toolbar=' + a_tb + ',location=' + a_loc + ',directories=' + a_dir + ',menubar=' + a_mb + ',';
   winStats+='scrollbars=' + a_sb + ',width=' + a_width + ',height=' + a_height;
   winStats+=',resizable=' + a_res;
   if (navigator.appName.indexOf('Microsoft')>=0) {
      winStats+=',left=' + a_left + ',top=' + a_top;
    }else{
      winStats+=',screenX=' + a_left + ',screenY=' + a_top;
    }
   mafen = window.open(a_url, 'fenetre', winStats, false);
}
function ftvlaunch(video,quality,pid) {
var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
 var popwin = window.open('http://www.zoomin.tv/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid,'MTV6_window','toolbar=no,width=665,height=430,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
popwin.focus();
}

var urltogo= '';

function gotourl() {
if (urltogo != '') document.location.href= urltogo;
return false;
}
/* ---- fin scripts LEXPRESS.fr --- */

function DisplayOnglet(kelOnglet)
{
	for (var i=1; i <= 4; i++) {
		document.getElementById('onglet'+i).style.display = 'none';
		document.getElementById('connexe'+i).style.display = 'none';
	}
	document.getElementById('onglet'+kelOnglet).style.display = 'block';
	document.getElementById('connexe'+kelOnglet).style.display = 'block';
}
function DisplayOngletTitre (kelOnglet,autre1,autre2,autre3)
{
	for (var i=1; i <= 4; i++) {
		document.getElementById('ongletbgon'+i).style.display = 'none';
		document.getElementById('ongletbgoff'+i).style.display = 'none';
	}
	document.getElementById('ongletbgon'+kelOnglet).style.display = 'block';
	document.getElementById('ongletbgoff'+autre1).style.display = 'block';
	document.getElementById('ongletbgoff'+autre2).style.display = 'block';
	document.getElementById('ongletbgoff'+autre3).style.display = 'block';
}

/* -------------------------------------- */
/* ROOLOVER */

// base
function rollOverOrg(ImgNme)
{
        obj=document.images[ImgNme];
        obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
}
// layers
function rollOver(ImgNme)
{
        obj=(document.images)? document.images[ImgNme]:0; ClicNme=(document.clicImg)? document.clicImg.name:""; 
        if (!obj && document.layers) {
                for (i=0; i<document.layers.length; i++) { ObjLyr=document.layers[i].document;
                        if (ObjLyr.images && ObjLyr.images[ImgNme]) obj=ObjLyr.images[ImgNme];}}                
        if (ClicNme!=ImgNme) obj.src=(obj.src.lastIndexOf('_on')!=-1)? obj.src.replace(/_on/gi,"_off"):obj.src.replace(/_off/gi,"_on");
        document.OnImg=obj;
}



/* ------------------------------*/
// Script pour les modules
var el = new Array();

	function getElementbyClass(nombre){ 
		var inc=0; 
		var alltags=document.all? document.all : document.getElementsByTagName("*");
		for (i=0; i<alltags.length; i++){
			if (alltags[i].className==nombre){
				el[inc++]=alltags[i];
			}
		}
	} 

	function changeOption(option){
		el = new Array();
		getElementbyClass(option)
		for(i=0;i<el.length;i++){
			if (el[i].style.display == "none"){
				el[i].style.display = "block"
			}else{
				el[i].style.display = "none"
			}
		}
		
	}
	
	function changeOptionID(ant, newObject){
		document.getElementById(ant).style.display = "none";
		document.getElementById(newObject).style.display = "block"
	}
	
	
	/* fonction de loupe pour texte */
	
function plus(cls,def,min,max){

	dw_fontSizerDX.set(def, min, max, [cls] );
	dw_fontSizerDX.init();
	dw_fontSizerDX.adjust(2)
}
function minus(cls,def,min,max){

	dw_fontSizerDX.set(def, min, max, [cls] );
	dw_fontSizerDX.init();
	dw_fontSizerDX.adjust(-2)
}
	
	
/* fonction pour changer onglets sur blocs à onglets */
	
function SwitchOnglets(id, id2, id3, id4, id5, id6) {
var nargs= arguments.length;

if (document.getElementById) {
	aouvrir = document.getElementById(id);
	afermer2 = document.getElementById(id2);
	if (nargs>= 3) afermer3 = document.getElementById(id3);
	if (nargs>= 4) afermer4 = document.getElementById(id4);
	if (nargs>= 5) afermer5 = document.getElementById(id5); 
	if (nargs>= 6) afermer6 = document.getElementById(id6);} 
else if(document.all) {
	aouvrir = document.all[id];
	afermer2 = document.all[id2];
	if (nargs>= 3) afermer3 = document.all[id3];
	if (nargs>= 4) afermer4 = document.all[id4];
	if (nargs>= 5) afermer5 = document.all[id5]; 
	if (nargs>= 6) afermer6 = document.all[id6];} 
else return;
		
if (aouvrir.style) {
	aouvrir.style.display = "block";
	afermer2.style.display = "none";
	if (nargs>= 3) afermer3.style.display = "none";
	if (nargs>= 4) afermer4.style.display = "none";
	if (nargs>= 5) afermer5.style.display = "none";
	if (nargs>= 6) afermer6.style.display = "none";}
}
	
	/* fonction pour afficher les indiscrets */
	
	function ShowIndiscrets() {
	
		if(document.getElementById) {
			elem = document.getElementById("lesindiscrets");
		} else if(document.all) {
			elem = document.all["lesindiscrets"];
		} else return;
	
		if(elem.style) {
			
			if (elem.style.display == "none") {
				elem.style.display = "block";
			}
		}
	}
	
	function HideIndiscrets() {
	
		if(document.getElementById) {
			elem = document.getElementById("lesindiscrets");
		} else if(document.all) {
			elem = document.all["lesindiscrets"];
		} else return;
	
		if(elem.style) {
			
			if (elem.style.display == "block") {
				elem.style.display = "none";
			}
		}		
	}
	
	/* fonction pour montrer/cacher le détail des résultats de la recherche */
	
	function ShowHideExtracts(show, hide) {
	
		var arr = new Array(); 
		var elems = document.getElementsByTagName("*");
		for ( var cls, i = 0; ( elem = elems[i] ); i++ )
		{
			if ( elem.className == "det" )
			{
				if (elem.style.display == "block")
					elem.style.display = "none";
				else if (elem.style.display == "none")
					elem.style.display = "block";
			}
		}
		
		if(document.getElementById) {
			show = document.getElementById(show);
		} else if(document.all) {
			show = document.all[show];
		} else return;
		
		if(document.getElementById) {
			hide = document.getElementById(hide);
		} else if(document.all) {
			hide = document.all[hide];
		} else return;
		
		
		if(show.style) {
			
			show.style.display = "block";
			hide.style.display = "none";
		
		}
			
		
	}


/*JAVASCRIPT AUTO-PROMO */	
	
/*TEMPORAIRE DUPLICATION DU FICHIER theCookies.js 
 * pour eviter le plantage lors de l'inclusion de deux fois le meme fichier
 * 
 */

/*********************************************************************************
  dw_cookies.js - cookie functions for www.dyn-web.com
  Recycled from various sources 
**********************************************************************************/

// Modified from Bill Dortch's Cookie Functions (hidaho.com) 
// (found in JavaScript Bible)
function setCookie2(name,value,days,path,domain,secure) {
  var expires, date;
  if (typeof days == "number") {
    date = new Date();
    date.setTime( date.getTime() + (days*24*60*60*1000) );
		expires = date.toGMTString();
  }else{expires='';}
  document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

// Modified from Jesse Chisholm or Scott Andrew Lepera ?
// (found at both www.dansteinman.com/dynapi/ and www.scottandrew.com/junkyard/js/)
function getCookie2(name) {
  var nameq = name + "=";
  var c_ar = document.cookie.split(';');
  for (var i=0; i<c_ar.length; i++) {
    var c = c_ar[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameq) == 0) return unescape( c.substring(nameq.length, c.length) );
  }
  return null;
}

// from Bill Dortch's Cookie Functions (hidaho.com) 
function deleteCookie2(name,path,domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function getNouvelleVisite()
{
var visite;
	
	visite=getCookie2('deja_venu');
	if(visite==null)
	{
		setCookie2('deja_venu',1,'','','','');
		return 0;
	}
	else
	{
		return 1;
	}
}

//FONCTION FLASH

function loadFlash()
{
var myFlash;
	myFlash = window.document.offre_exceptionnelle;
	myFlash.Play();
}

function displayFlash(swf, hauteur, largeur)
{
document.write('<object style="border:0;position: absolute; top: 0px; left: 0px; z-index: 1; margin-top: 25px; margin-left: 501px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="offre_exceptionnelle" align="" height="'+hauteur+'" width="'+largeur+'">');
document.write('<param name="allowScriptAccess" value="sameDomain">');
document.write('<param name="movie" value="'+swf+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="'+swf+'" quality="high" wmode="transparent" name="offre_exceptionnelle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  align="" height="'+hauteur+'" width="'+largeur+'">');
document.write('</object>');
}

function showFlash(){
	document.getElementById('offre_exceptionnelle').style.zIndex=1;
}

function hideFlash(){
	document.getElementById('offre_exceptionnelle').style.zIndex=-1;
}

//FONCTION FLASH MARIE
// JavaScript Document
var IS_IE = (document.all) ? true : false;
var CLASS_NAME = (IS_IE) ? "className" : "class";

function creerFlash(swf, largeur, hauteur, couleur, nom) {
	document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\""+largeur+"\" height=\""+hauteur+"\" id=\""+nom+"\" align=\"middle\">\n");
	document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n");
	document.write("<param name=\"movie\" value=\""+swf+"\" /><param name=\"quality\" value=\"high\" />");
	if(couleur !="transparent"){
		document.write("<param name=\"bgcolor\" value=\""+couleur+"\" />");
	}else{
		document.write("<param name=\"wmode\" value=\"transparent\">");
	}
	document.write("<embed src=\""+swf+"\" quality=\"high\" width=\""+largeur+"\" height=\""+hauteur+"\" name=\""+nom+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ");
	if(couleur !="transparent"){
		document.write("bgcolor=\""+couleur+"\"");
	}else{
		document.write("wmode=\"transparent\"");
	}
	document.write("/>\n");
	document.write("</object>\n");
}

//afficher true appelé par le lien abonnement, affichage false appelé par le flash
function afficherPopAbonnement(afficher){
	var pop_abonnement = document.getElementById("pop-abonnement");
	if(afficher){
		pop_abonnement.removeAttribute(CLASS_NAME);
	}else{
		pop_abonnement.setAttribute(CLASS_NAME,'cache');
	}
}

function lireCookie(nom){
	var mon_cookie = document.cookie;
	var debut = mon_cookie.indexOf(nom+"=");
	var taille = debut + nom.length + 1;
	if ((!debut) && (nom != mon_cookie.substring(0,nom.length))) return null;
	if (debut == -1) return null;
	var fin = mon_cookie.indexOf(";",taille);
	if (fin == -1) fin = mon_cookie.length;
	return unescape(mon_cookie.substring(taille, fin));
}
function detruireCookie(nom){
	var expire = new Date();
	expire.setTime( expire.getTime() - 1000);
	document.cookie = nom + "=false;expires=" + expire.toGMTString()+"; path=/";
}
function ecrireCookie(nom,valeur,temps){
	var strExpire='';
	if(temps>0)
	{
		var expire = new Date();
		expire.setTime( expire.getTime() + temps);
		strExpire=expire.toGMTString();
	}
	document.cookie = nom + "="+ valeur +";expires=" + strExpire +"; path=/";
}

