// JavaScript Document
var fenetrefixe=0;
function fenetre_fix(URLStr, left, top, width, height)
{ 
  if(fenetrefixe)
  {
    if(!fenetrefixe.closed) fenetrefixe.close();
  }
  fenetrefixe = open(URLStr, 'fenetre_fixe', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}
var fenetrefixe2=0;
function fenetre_fix2(URLStr, left, top, width, height)
{ 
  if(fenetrefixe2)
  {
    if(!fenetrefixe2.closed) fenetrefixe2.close();
  }
  fenetrefixe2 = open(URLStr, 'fenetre_fixe2', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

var fenetrefixe3 = 0;
function fenetre_fix3(URLStr, left, top, width, height)
{ 
  if(fenetrefixe3)
  {
    if(!fenetrefixe3.closed) fenetrefixe.close();
  }
  fenetrefixe3 = open(URLStr, 'fenetre_fixe3', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}


/* fonction pour retailler l'ecran à l'ouverture de la fenetre
Appeler cette foncton par :
<body onLoad="resizing(700,720);"> 
*/
		function resizing(newwidth,newheight) {
			self.moveTo((screen.availWidth/2)-(width/2),0);
			if (document.layers) {
					width < screen.availWidth;
					height < screen.availHeight;
			} else {
					var width = screen.availWidth;
					var height = screen.availHeight;
			}
			if (width > newwidth) {
				width = newwidth;
				}
			if (height > newheight) {
				height = newheight;
				}
 			// self.resizeTo(width, height);
 			self.resizeTo(width, screen.availHeight);
			// self.moveTo((screen.availWidth/2)-(width/2), (screen.availHeight/2)-(height/2));
			self.moveTo((screen.availWidth/2)-(width/2),0);
		}
// Vide le texte dans la balise de message :
function ChangeImage(Img, Source)
	{
	document.getElementById(Img).src = Source;
	}

		
//changer la position de l'image. Utilise par la page accueil. (pour les actualites)		
	function ImagePosition(id,Left)
		{
		var DivImg = document.getElementById(id).style;
		Img = document.getElementById("img" + id);
		DivImg.marginTop =  "-" + (20+ parseInt(Img.height)) + "px";
		if (Left =="o")
			DivImg.marginLeft =  ((parseInt(Img.width))/2)- (parseInt(Img.width)) + "px";
		}


function _show(calque){
	try{
		document.getElementById(calque).style.visibility="visible";
		document.getElementById(calque).style.display="block";
	}catch(e){}
}
function _hide(calque){
	try{
		document.getElementById(calque).style.visibility="hidden";
		document.getElementById(calque).style.display="none";
	}catch(e){}
}

function showHide(calque){
	if (document.getElementById(calque).style.visibility=="hidden" || document.getElementById(calque).style.display=="none"){
		_show(calque);
	}else{
		_hide(calque);
	}
}

function showFondSurimpression(){
	w="800";
	h="600";
	
	try{
		if (document.documentElement && (document.documentElement.clientWidth||document.documentElement.clientHeight)){
			// IE 6+
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}else if ( typeof( window.innerWidth ) == 'number' ){
			// Non IE
			w = window.innerWidth;
			h = window.innerHeight;
		}else if(document.body && (document.body.clientWidth||document.body.clientHeight )){
			// Old IE
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}		
	}catch(e){}	
	var fd = document.getElementById("surimpression");
	_show("surimpression");
	fd.style.width=w;
	fd.style.height=h;	
}
function HideSurimpression1() {
	_hide('surimpression');
	_hide('PremierPlan');
	}
function HideSurimpression2() {
	_hide('surimpression');
	_hide('PremierPlan2');
	}