/* Corrige bogue dans Netscape 4 : la page ne s'affiche pas correctement lorsque l'utilisateur redimensionne sa fen�tre


Utile uniquement que si on utilise des calques ou feuille de style*/


var size_default = 11;
var size = size_default;
var size_min = 8;
var size_max = 16;
var expression = /^.*(Texte).*$/;


/*//////  PNG pour ie ////// */


function fnLoadPngs() {
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

	for (var i = document.images.length - 1, img = null; 
(img = document.images[i]); i--) {
		if (itsAllGood && img.src.match(/\.png$/i) != null) {
			var src = img.src;
			var div = document.createElement("DIV");
			div.style.filter = 
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
 + src + "', sizing='scale')"
			div.style.width = img.width + "px";
			div.style.height = img.height + "px";
			img.replaceNode(div);
		}
		img.style.visibility = "visible";
	}
}


//reloads the window if Nav4 resized

function MM_reloadPage(init) {  
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);



/* Ouverture d'une open window*/

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function OpenW(sURL, sName){
	window.open(sURL, sName,'width=430,height=630,top=50,left=50');
}



function OpenWGallerie(sURL, sName){

	window.open(sURL, sName,'width=800,height=710,top=0,left=0,menubar=no,resizable=no,toolbar=no,scrollbars=yes');

}



function OpenWPrint(url,title){

	window.open(url, title,'width=800,height=500,menubar=no,resizable=no,toolbar=no,scrollbars=yes');

}

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_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_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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 showOrHide(id) {
	
	var displayValue = document.getElementById(id).style.display;
	if (displayValue == 'none') {
		displayValue = 'block';
	} else {
		displayValue = 'none';
	}
	document.getElementById(id).style.display = displayValue;
}	
	
function changeFontSize(modif) {
	if (modif == 0) {
		size = size_default;
	} else {
		size = size + modif;
	}
	
	if (size < size_min) {
		size = size_min;
	} else if (size > size_max) {
		size = size_max;
	}
	var div = document.getElementById("ARTICLE");
	var divList = div.childNodes;
	for (var i = 0; i < divList.length; i++) {
		var elt = divList[i];
		var classes = elt.attributes;
		if (classes != null) {
			for (var j = 0; j < classes.length; j++) {
				expression.exec(classes[j].nodeValue);
				//alert("div : " + RegExp.$1);
				if (RegExp.$1  == 'Texte') {
					elt.style.fontSize = size  +'px';
				}
			}
		}
	}
}





