function initPage(){
	sbActu();
	/*
	if(window.confirm('Voulez-vous donner votre avis pour améliorer nos services ?') == true){
		popup('enquete.php','enquete','820','500');
	}
	*/
	ib_enquete = new infoBox('enquete.php');
	ib_enquete.ouvrir();
}

function enquete(etat){
	if(etat == true){
		$("enquete").show();$("confirm").hide();
		ib_enquete.calc();
	}else{
		ib_enquete.fermer();
	}
}

function sbActu(){
	var sb = new SwitchBloc('sb_actu','item',{SwiDefilAuto:true});
}

// Specifique menu Mills :
function Go(gototo) {
	var url = window.location.search;
	var pos = url.indexOf("=")+1;
	window.location.search = url.substring(0,pos)+gototo;
}

/* ------------------------- POP ---------------------------------- */
var PositionX = 100; var PositionY = 100; // Set the horizontal and vertical position for the popu
var defaultWidth  = 500; var defaultHeight = 500;// Set these value approximately 20 pixels greater than the size of the largest image to be used (needed for Netscape)
var AutoClose = true;// Set autoclose true to have the window close automatically - Set autoclose false to allow multiple popup windows
if (parseInt(navigator.appVersion.charAt(0))>=4){
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function PopImg(imageURL,imageTitle) {
	if (isNN){ var imgWin=window.open('about:blank','',optNN);}
	if (isIE){ var imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style type="text/css">body{margin:0px;overflow:hidden;}</style>');writeln('<sc'+'ript type="text/javascript">');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor="#000000" scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor="#000000" scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close();" onClick="self.close();">');
		writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}

function popup(url, name, w, h) {
	var l = (screen.availWidth-10 - w) / 2;
	var t = (screen.availHeight-20 - h) / 2;
	features = "width="+w+",height="+h+",left="+l+",top="+t+",screenX="+l+",screenY="+t+",scrollbars=1,resizable=1,location=0,menubar=0,toolbar=0,status=1";
	window.open(url, name, features);
	if (parseInt(navigator.appVersion) >= 4) { name.window.focus(); }
}

/* ------------------------- DREAM ---------------------------------- */

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];}
}

function Preload() { //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=Preload.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 Restore() { //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_findObj(n, d) { //v3.0
  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); return x;
}
function Swap() { //v3.0
  var i,j=0,x,a=Swap.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];}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/*-------------------------------- CODE ALEISTER ----------------------------------------------*/
function RollOver(img,lien){
document.images[img].src=lien;
}
// detection du navigateur
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

function cache_menu(nom) {
	//alert(nom);
	var recup = nom.split("|");
	//alert(recup.length);
	for(i=0;i<recup.length;i++){
		if(document.getElementById){
			document.getElementById(recup[i]).style.visibility = "hidden";
		}else if(document.all){
			document.all("smenu").style.visibility = "hidden";
		}
	}
}

function efface_tout(){
cache_menu('dhtml1|dhtml2|dhtml3|dhtml4|dhtml5|dhtml6|cache|cache2');
}

function efface_tout_uk(){
cache_menu('dhtml1_uk|dhtml2_uk|dhtml3_uk|dhtml4_uk|dhtml5_uk|dhtml6_uk|cache|cache2');
}

function reset_roll(img,niveau){
for(i=1;i<7;i++){
	document.images["m"+i].src = niveau+"../images/picts_fr/menu/m"+i+"off.gif";
}
	if(typeof(rub_activ)!='undefined'){
	document.images["m"+rub_activ].src = niveau+"../images/picts_fr/menu/m"+rub_activ+"on.gif";
	}

	if(img!=0)
	document.images["m"+img].src = niveau+"../images/picts_fr/menu/m"+img+"on.gif";
}
function reset_roll_uk(img,niveau){
for(i=1;i<7;i++){
	document.images["m"+i].src = niveau+"../images/picts_uk/menu/m"+i+"off.gif";
}
	if(typeof(rub_activ)!='undefined'){
	document.images["m"+rub_activ].src = niveau+"../images/picts_uk/menu/m"+rub_activ+"on.gif";
	}

	if(img!=0)
	document.images["m"+img].src = niveau+"../images/picts_uk/menu/m"+img+"on.gif";
}
function affiche_menu(nom) {
//alert(nom);
efface_tout();
var recup = nom.split("|");
//alert(recup.length);
for(i=0;i<recup.length;i++){
		if(document.getElementById){
			document.getElementById(recup[i]).style.visibility = "visible";
		}else if(document.all){
			document.all("smenu").style.visibility = "visible";
		}
	}
}
function affiche_menu_uk(nom) {
//alert(nom);
efface_tout_uk();
var recup = nom.split("|");
//alert(recup.length);
for(i=0;i<recup.length;i++){
		if(document.getElementById){
			document.getElementById(recup[i]).style.visibility = "visible";
		}else if(document.all){
			document.all("smenu").style.visibility = "visible";
		}
	}
}



/***************************************************************************
* Internet Explorer Margin Fix
* Copyright 2002-2004 by David Schontzler | www.stilleye.com
* Free to use under GNU General Public License as long as this message
*  remains intact.
* Description:  This script will fix the horizontal margin support in IE5/6
* URI: http://www.stilleye.com/projects/dhtml/marginfix/
* Additional Credits:
* - Bibek Sahu (BS) | http://www.dodds.net/~scorpio/
***************************************************************************
* Version: 2.2.0
***************************************************************************/
if(!Array.prototype.push) {
	Array.prototype.push =  function() {
		var i, j;
		for(i=0; j=arguments[i]; i++) this[this.length] = j;
		return this.length;
	}
};

IEmarginFix = {
	list : new Array,
	
	ss : null,
	
	init : function() {
		var ua = navigator.userAgent.toLowerCase();
		if( (ua.indexOf("msie 5.") != -1 || ua.indexOf("msie 6.") != -1)
		&& ua.indexOf('mac') == -1 && document.compatMode != "CSS1Compat"
		&& window.attachEvent && document.styleSheets.length > 0 ) {
			this.ss = document.styleSheets;
			var auto, lop, list, s, i, a;
			auto = new Array;
			lop = new Array;
			list = new Array;
			s = this.getRules();
			for(i=0; i<s.length; i++) {
				if( this.checkMargin(s[i][1]) )
					auto.push(s[i][0]);
				else if( this.checkLopsided(s[i][1]) )
					lop.push(s[i][0]);
			}
			for(i=0; a = auto[i]; i++)
				this.ss[this.ss.length-1].addRule(a, "margin-left : expression( IEmarginFix.autoFix(this) );");
			for(i=0; a = lop[i]; i++)
				this.ss[this.ss.length-1].addRule(a, "margin-left : expression( IEmarginFix.lopsidedFix(this) );");
			this.list = auto.length > 0 ? lop.length > 0 ? auto.concat(lop) : auto : lop;
			window.attachEvent("onload", IEmarginFix.checkInline);
		}
	},
	
	autoFix : function(elm) {
		var rslt = "auto", w = elm.currentStyle.width;
		var id = elm.id ? "#" + elm.id : elm.className ? elm.tagName + "." + elm.className : elm.tagName; // Credit: BS
		if(w.indexOf("%") != -1) {
			rslt = ( 100 - parseInt(w) )/2 + "%";
			IEmarginFix.ss[IEmarginFix.ss.length-1].addRule(id, "margin-left : " + rslt + "; margin-right : " + rslt + "; width : 100%");
		} else
			IEmarginFix.ss[IEmarginFix.ss.length-1].addRule(id, "margin-left : expression( IEmarginFix.pxAutoFix(this) );");
		return rslt;
	},
	
	// so we don't have to go through the if...else all over again!
	pxAutoFix : function(elm) {
		var rslt, par = elm.parentNode;
		rslt = par.clientWidth > 0 ? par.clientWidth : par.scrollWidth;
		rslt = (rslt - elm.offsetWidth) / 2;
		return Math.max(rslt, 0);
	},
	
	lopsidedFix : function(elm) {
		var par = elm.parentNode, parWidth, rslt;
		parWidth = par.clientWidth > 0 ? par.clientWidth : par.scrollWidth;
		rslt = parWidth - elm.offsetWidth;
		if( elm.currentStyle.marginRight.indexOf("px") != -1 )
			rslt -= parseInt( elm.currentStyle.marginRight );
		else if( elm.currentStyle.marginRight.indexOf("%") != -1 )
			rslt -= parseInt(elm.currentStyle.marginRight) * 0.01 * parWidth;
		rslt -= ( parseInt(par.currentStyle.paddingLeft) + parseInt(par.currentStyle.paddingRight) );
		return rslt;
	},
	
	checkInline : function() {
		var i, a, elm, blk, list = new Array, auto = IEmarginFix.list;
		for(i=0; a = auto[i]; i++) {
			if( a.indexOf(".") != -1 ) // classes
				list = list.concat( IEmarginFix.getClass( a.substring(a.indexOf(".")+1) ) );
			else if( a.charAt(0) == '#' ) // ids
				list.push( document.all[a.substring(1)] );
			else { // tags
				elm = document.getElementsByTagName(a);
				if(elm.length > 0)
					for(i=0; i < elm.length; i++)
						list = list.concat( elm.item(i) );
			}
		}
		for(i=0; i<list.length; i++) {
			elm = list[i];
			if(elm && elm.style) {
				blk = IEmarginFix.getStyle(elm, "display");
				if(blk != "block" && ( IEmarginFix.ie50 ? !IEmarginFix.ie50check(elm.tagName) : blk != "list-item" ) ) {
					elm.style.margin = 0;
				}
			}
		}
	},
	
	checkMargin : function(str) {
		return ( str.search(/position\s*:\s*absolute/i) == -1 && (
			str.match(/margin\s*:\s*auto(;|$)/i) || str.match(/margin\s*:\s*\S+\s+auto(;|$)/i)
			|| ( str.match(/margin-left\s*:\s*auto/i) && str.match(/margin-right\s*:\s*auto/i) )
			|| str.match(/margin\s*:\s*\S+\s+auto\s+\S+(;|$)/i) || str.match(/margin\s*:\s*\S+\s+auto\s+\S+\s+auto/i)
			)
		);
	},
	
	checkLopsided : function(str) {
		return ( str.search(/position\s*:\s*absolute/i) == -1 && (
				str.match(/margin-left\s*:\s*auto/i) && str.match(/margin-right\s*:\s*\d+(px|%)?/i)
				|| str.match(/margin-left\s*:\s*auto/i) && !str.match(/margin-right/i)
			)
		);
	},
	
	// these next few methods are basically for IE 5.0's bad interpretation of the "display" property (always returning "inline" unless explicitly set, even for block elements!)
	ie50 : navigator.appVersion.toLowerCase().indexOf("msie 5.0") != -1,
	
	ie50check : function(tag) {
		var i, r = false;
		tag = tag.toUpperCase();
		for(i=0; i<this.blockElms.length; i++)
			if(tag == this.blockElms[i])
				r = true;
		return r;
	},
	
	blockElms : new Array("ADDRESS", "BLOCKQUOTE", "BODY", "CENTER", "COL", "COLGROUP", "DD", "DIR", "DIV", "DL", "DT", "FIELDSET", "FORM", "FRAME", "HN", "HR", "IFRAME", "LEGEND", "LI", "LISTING", "MARQUEE", "MENU", "OL", "P", "PLAINTEXT", "PRE", "TABLE", "TBODY", "TD", "TFOOT", "TH", "THEAD", "TR", "UL", "XMP"),
	// end IE5.0 detect
	
	getClass : function(cls) {
		var el, r, i;
		el = document.all ? document.all : document.getElementsByTagName('*');
		r = new Array;
		for(i=0; el[i]; i++) if(el[i].className == cls) r.push(el[i]);
		if(r.length==0) r = null;
		return r;
	},
	
	getRules : function(wh) {
		var s = null;
		if(document.styleSheets && document.styleSheets.length) {
			var i, j, k, m, x, y, is = true, screen = true;
			s = new Array;
			for(i=0; i < document.styleSheets.length; i++) {
				j = document.styleSheets.item(i);
				if(wh) is = (j.title || j.id) == wh;
				if( typeof j.media == "string" && j.media.length > 0 && !j.media.match(/^(screen)|(media)$/i) )
					screen = false;
				else
					screen = true;
				if(!j.disabled && screen && is) {
					if(j.rules) {
						if(j.imports && j.imports.length) {
							for(k=0; k < j.imports.length; k++)
								for(x=0; y = j.imports[k].rules[x]; x++)
									s.push([y.selectorText, y.style.cssText]);
						}
						for(k=0; m = j.rules[k]; k++)
								s.push([m.selectorText, m.style.cssText]);
					} else {
						return null;
					}
				}
				if(wh && is) break;
				else is = true;
			}
		}
		return s;
	},
	
	getStyle : function(obj,sty) {
		var sty2 = IEmarginFix.compactStyle(sty);
		var r = obj.style[sty2];
		if(r=='') {
			if(document.defaultView) r = document.defaultView.getComputedStyle(obj,'').getPropertyValue(sty);
			else r = obj.currentStyle[sty2];
		}
		if(!r) r = null;
		return r;
	},

	compactStyle : function(str) {
		var s = str.split('-');	var o = [s[0]];
		for(i=1;(j=s[i]);i++) { o[o.length] = j.charAt(0).toUpperCase(); o[o.length] = j.substring(1) };
		return o.join('');
	}
};
IEmarginFix.init();
