// detection du navigateur
var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

/* ------------------------- GOTO ---------------------------------- */
function Go(gototo) { // ex : <td  onClick="Go('actualite');"> --> index2.php?goto=actualite
	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(); }
}
/* ------------------------- ROLLOVER ---------------------------------- */
function RollOver(img,lien){
document.images[img].src=lien;
}
// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004
function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {
		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
   
var nav = navigator.appName;
//alert(nav);   
if(nav.indexOf("Microsoft")!=-1){// déclenche la fonction si c'est IE
window.attachEvent("onload", correctPNG);
}