
//--------------------------Constructeur d'objets de sélection navigateurs/plateformes-----------------------
function TestNavigateur() //
{
	var pltfrm=navigator.platform;
	this.pltfrm=pltfrm;
	var nav = navigator.appName;
	if (nav=="Netscape") this.nav = "ns";
	else if (nav=="Microsoft Internet Explorer") this.nav = "ie";
	else this.nav = nav;
	this.v = parseInt(navigator.appVersion);
	this.ns = (this.nav=="ns" && this.v>=4);
	this.ns4Win = (this.nav=="ns" && this.v==4 && this.pltfrm=="Win32");
	this.ns5Win = (this.nav=="ns" && this.v==5 && this.pltfrm=="Win32");
	this.ns7Win = (navigator.userAgent.indexOf('7.0b1')>0 && this.pltfrm=="Win32");
	this.ns7Mac = (navigator.userAgent.indexOf('7.0b1')>0 && this.pltfrm=="MacPPC");
	this.ns4Mac = (this.nav=="ns" && this.v==4 && this.pltfrm=="MacPPC");
	this.ns5Mac = (this.nav=="ns" && this.v==5 && this.pltfrm=="MacPPC");
	this.ie = (this.nav=="ie" && this.v>=4);
	this.ie4Win = (navigator.userAgent.indexOf('MSIE 4')>0 && this.pltfrm=="Win32");
	this.ie5Win = (navigator.userAgent.indexOf('MSIE 5')>0 && this.pltfrm=="Win32");
	this.ie6Win = (navigator.userAgent.indexOf('MSIE 6')>0 && this.pltfrm=="Win32");
    this.ie7Win = (navigator.userAgent.indexOf('MSIE 7')>0 && this.pltfrm=="Win32");
	this.ie4Mac = (navigator.userAgent.indexOf('MSIE 4')>0 && this.pltfrm=="MacPPC");
	this.ie5Mac = (navigator.userAgent.indexOf('MSIE 5')>0 && this.pltfrm=="MacPPC");
	this.ie6Mac = (navigator.userAgent.indexOf('MSIE 6')>0 && this.pltfrm=="MacPPC");
	this.ie7Mac = (navigator.userAgent.indexOf('MSIE 7')>0 && this.pltfrm=="MacPPC");
	if (this.ie5) this.v = 5;
	this.min = (this.ns||this.ie);
}

which = new TestNavigateur() //Crée l'objet "TestNavigateur"

//--------------------- RollOver sur le logo en bas à gauche ----------------
if(which.nav=="ns")
{
	var imag=new Array()
	imag[0]=new Image();
	imag[0].src="/images/img_liens_ns_off.gif";
	imag[1]=new Image();
	imag[1].src="/images/img_liens_ns_on.gif";
}
else
{
	var imag=new Array()
	imag[0]=new Image();
	imag[0].src="/images/img_liens_off.gif";
	imag[1]=new Image();
	imag[1].src="/images/img_liens_on.gif";
}
function aff(loc,etat)
{
	if(etat=="on")etat=1;
	else etat=0;
	document.images[loc].src=imag[etat].src
}

//------------------------------- Recharge Netscape sur le redimensionnement -----------------------
function regenerate(){
window.location.reload();
//document.history.go(0);
}
function regenerate2(){
setTimeout("window.onresize=regenerate",400);
}
//window.onload=regenerate2()

//-----------------------------------------Les ouvertures de popups----------------------------------------------------
function fenetre(url){
		window.open(url,'fenA','fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,width=453,height=500,top=100,left=100,true');
}

// popup simple
function popup(url,pWidth,pHeight){
	var haut=((screen.height-pHeight)/2)-100;
	var gauche=(screen.width-pWidth)/2;
	window.open(url,'fen1','fullscreen=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+pWidth+',height='+pHeight+',top='+haut+',left='+gauche+',true');
}

// tous paramètres acceptés
function open_window(url, new_params) {
	new_params = '';
	var parametre_fenetre;
	var arg_nb = open_window.arguments.length
	var arg_values = open_window.arguments
	var window_name = (arg_nb > 2) ? arg_values[2] : 'CAIF'
	if (new_params=='')  parametre_fenetre = 'scrollbars=yes,width=420,height=400,menubar=yes,resizable=no,status=no,location=no'; 
	else parametre_fenetre = new_params;
	le_fenetre = window.open(url,window_name,parametre_fenetre);
}

/*------------------------------------- Compatibilité navigateurs ---------------------------------------*/
var version=navigator.appVersion.charAt(0);
function getStyleTopObj(elt){
		var pTop;
		if (document.getElementById) 
				{pTop = document.getElementById(elt).style.top;}
		else if (document.layers) 
				{pTop = document.layers.supRub.document.layers[elt].top;}
		else if (document.all) 
				{pTop = document.all[elt].style.pixelTop;}
		return pTop;
}

function setStyleTopObj(elt,val) {
	if (document.getElementById) 
			{document.getElementById(elt).style.top = val+"px";}
	else if (document.layers) 
			{document.layers.supRub.document.layers[elt].top = val;}
	else if (document.all) 
			{document.all[elt].style.pixelTop=val;}
}

function getStyleObj(elt){
		var pStyle;
		//alert(elt);
		if (document.getElementById) 
				{pStyle = document.getElementById(elt).style;}
		else if (document.layers) 
				{pStyle = document.layers.supRub.document.layers[elt];}
		else if (document.all) 
				{pStyle = document.all[elt].style;}
		return pStyle;
}

function getDivObj(elt){
		var pDiv;
		if (document.getElementById) 
				{pDiv = document.getElementById(elt);}
		else if (document.layers) 
				{pDiv = document.layers.supRub.document.layers[elt];}
		else if (document.all) 
				{pDiv = document.all[elt];}
		return pDiv;
}

var cVisible;var chidden;setDhtmlConst();

function setDhtmlConst() {
		if ((document.getElementById)||(document.all)) 
				{cVisible = 'visible';chidden = 'hidden';}
		else if (document.layers) 
				{cVisible = 'show';chidden = 'hide';}
}

//--------------------------------- Naviguer en lien direct--------------------------
function allerA(num){
	document.location.href=chemin[num]
}

//--------------------------------- Fermer une fenêtre -------------------------
function fQuit(){
	window.opener.focus();
	window.close();
}

function FocusText(BoxName){
if (BoxName.value == BoxName.defaultValue)
	BoxName.value = '';
}

function BlurText(BoxName){
if (BoxName.value == '')
BoxName.value = BoxName.defaultValue;
}

//--------------------------------- Récupération du cookie -------------------------
function getCookie(name) {
   search = name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search)
      if (offset != -1) { // if cookie exists
         offset += search.length
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset)
         // set index of end of cookie value
         if (end == -1)
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      }
   }
}
//--------------------------------- Destruction du cookie -------------------------
function deconnexion(name) 
{
   end_time = new Date();                      // object Date with current date 
   end_time.setTime (end_time.getTime() - 1);  // set time of this object in the past!
   value = getCookie(name);                    // get cookie value
   document.cookie = name + "=" + value + "; expires=" + end_time.toGMTString();
   document.location.href="../index.asp"
}