// script pour Heure

function disp(txt) {document.write(txt);}
function don_date_maj()
	{var date_maj=new Date(document.lastModified);
	date_maj=don_date_format(date_maj);
	return date_maj;}
function don_date_jour()
	{var date_jour=new Date();
	date_jour=don_date_format(date_jour);
	return date_jour;}
function don_date_format(d1) {
	var m=new Array(13);
	m[1]="Janvier"; m[2]="Février";	m[3]="Mars"; m[4]="Avril"; m[5]="Mai"; m[6]="Juin";
 	m[7]="Juillet";	m[8]="Aout"; m[9]="Septembre"; m[10]="Octobre";	m[11]="Novembre"; m[12]="Décembre";
	var d=new Array(8);
	d[1]="Dimanche"; d[2]="Lundi"; d[3]="Mardi"; d[4]="Mercredi"; d[5]="Jeudi"; d[6]="Vendredi"; d[7]="Samedi";
	var mois=m[d1.getMonth()+1];
	var jour=d[d1.getDay()+1];
	var date=d1.getDate();
	var an=d1.getYear();
	if (an<200) an=1900+an;
	date=jour+" "+date+" "+mois+" "+an;
	return date;
	}


//script pour menu déroulant
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )) 
ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 )) 

if (ns4) { 
layerRef="document.layers"; 
styleRef=""; 
} else { 
layerRef="document.all"; 
styleRef=".style"; 
} 



//script pour scroll des nouvelles
 
function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
    this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
    this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
    this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
    this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight 
    this.up=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divNewsContainer') 
    objScroller=new ConstructObject('divNewsContent','divNewsContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function mouseOverDot(strSection) {
	if (document.images) {
		document.images[strSection].src = "images/bollet_subnav_selected.gif";
	}
}
	function mouseOutDot(strSection) {
	if (document.images) {
		document.images[strSection].src = "images/bollet_subnav.gif";
	}
}

//=========================================================

function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) &&
                 ((agent.indexOf('spoofer')   ==   -1) &&
                 (agent.indexOf('compatible') ==   -1)));
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4b  = (this.ns && (this.major      ==    4) &&
                 (this.minor                  <= 4.03));
    this.ns4   = (this.ns && (this.major      >=    4));
    this.ns6    = (this.ns && (this.major     >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      <     4));
    this.ie4   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.5")   !=   -1));
}

var is = new Is();

if(is.ie4 || is.ie5 || is.ns6){
	layerRef = "document.all";
	styleRef = ".style";

}else if(is.ns4) {
    layerRef = "document";
    styleRef = "";

} else {
	layerRef = "document.all";
	styleRef = ".style";
}

//=========================================================

function afficheCalque(DivId) 
{ 
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.visibility='visible';
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	  // document.layers[DivId].visibility='visible';
	  
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.visibility='visible';
	
	} else {
	     //If browser is none of the above 
	}

} 


function cacheCalque(DivId) 
{ 
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.visibility='hidden';
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	 //  document.layers[DivId].visibility='hidden';
	   
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.visibility='hidden';
	
	} else {
	     //If browser is none of the above 
	}
}


function Shrink(DivId) 
{ 
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.height='18';
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	   
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.height='18';
	
	} else {
	     //If browser is none of the above 
	}
}

function Expand(DivId) 
{ 
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.height='130';
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	   
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.height='130';
	
	} else {
	     //If browser is none of the above 
	}
}

function changeto(e,highlightcolor){
	var ns6=document.getElementById&&!document.all
	var ie=document.all

	source=ie? event.srcElement : e.target
	
	if (source.tagName=="TR"||source.tagName=="TABLE")
		return

	while(source.tagName!="TD"&&source.tagName!="HTML")
		source=ns6? source.parentNode : source.parentElement
	
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
		source.style.backgroundColor=highlightcolor
}

function changeTitle(DivId, bgcolor, color){
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.color=color;
	     document.all[DivId].style.backgroundColor=bgcolor;
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	   
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.color=color;
	    document.getElementById(DivId).style.backgroundColor=bgcolor;
	} else {
	     //If browser is none of the above 
	}
}

function changeTextBold(DivId, Value){
	if (document.all && !document.getElementById) {
	     //IE 4 supports doucment.all but NOT document.getElementById
	     document.all[DivId].style.fontWeight=Value;
	
	} else if (document.layers) {
	     //Netscape 4 only browser that supports document.layers
	   
	} else if (document.getElementById) {
	     //Works for Netscape 6 and IE 5
	    document.getElementById(DivId).style.fontWeight=Value;
	
	} else {
	     //If browser is none of the above 
	}

}


//-------------------------------------------------------------------------
// Ouverture d'une nouvelle page Window qui sera centré selon la résolution
//-------------------------------------------------------------------------
function MM_openBrWindow(theURL,winName,iWidth,iHeight,features) { //SS
	var iPosWidth = Math.round((screen.width-iWidth)/2);
	var iPosHeight = Math.round((screen.height-iHeight)/2);

	window.open(theURL,winName,features+",width="+iWidth+",height="+iHeight+",screenX="+iPosWidth+",screenY="+iPosHeight+",left="+iPosWidth+",top="+iPosHeight);
}


//-------------------------------------------------------------------------
//PRINT PAGE
//-------------------------------------------------------------------------
var bName = navigator.appName;
var bSysOp = navigator.platform
var bVersion = navigator.appVersion;

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage() 
{
	if (pr) // NS4, IE5
	    window.print();
	else if (da && !mac) // IE4 (Windows)
	    vbPrintPage();
	else // other browsers
	    alert("Votre navigateur ne permet pas d\'utiliser cette fonction. Veuillez utiliser la commande équivalente dans le menu de votre navigateur.");
	return false;
}

if (da && !pr && !mac) with (document) 
{
	writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
	writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
	writeln('Sub window_onunload');
	writeln('  On Error Resume Next');
	writeln('  Set WB = nothing');
	writeln('End Sub');
	writeln('Sub vbPrintPage');
	writeln('  OLECMDID_PRINT = 6');
	writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
	writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
	writeln('  On Error Resume Next');
	writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
	//writeln('window.close()');
	writeln('End Sub');
	writeln('<' + '/SCRIPT>');
}

