<!--
function resizePopUp(monImage, monTitre) {
	w = window.open('','chargement','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0');
	w.document.write( "<html><head><title>"+monTitre+"</title>\n" );
	w.document.write( "<script language='JavaScript'>\n");
	w.document.write( "IE5=NN4=NN6=false;\n");
	w.document.write( "if(document.all)IE5=true;\n");
	w.document.write( "else if(document.getElementById)NN6=true;\n");
	w.document.write( "else if(document.layers)NN4=true;\n");
	w.document.write( "function autoSize() {\n");
	w.document.write( "if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31);\n");
	w.document.write( "else if(NN6) self.sizeToContent();\n");
	w.document.write( "else window.resizeTo(document.images[0].width,document.images[0].height+20);\n");
	w.document.write( "self.focus();\n");
	w.document.write( "}\n</script>\n");
	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='javascript:autoSize();'>" );
	w.document.write( "<a href='javascript:window.close();'><img src='"+monImage+"' border=0 alt='"+monTitre+"'></a>" );
	w.document.write( "</body></html>" );
	w.document.close();
}

function PopupCentrer(page,titre) {
	var top=(screen.height)-100;
	var left=(screen.width)-100;
	window.open(page,'titre','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0');
}
function applique_img() {
	var nbimg = document.getElementById("textspip").getElementsByTagName("img").length;
	tabimg = document.getElementById("textspip").getElementsByTagName("img");
//	alert("il y a "+nbimg+" dans le text");
var tableau = new Array();
	for(var i = 0; i < nbimg; i++){
//		alert(tabimg[i].getAttribute("class"));
		var thesrc=tabimg[i].getAttribute("src");
//		alert("source=" + src);
		var ind=thesrc.lastIndexOf("/")+1;
//		alert(src.substr(ind));
		thesrc=thesrc.substr(ind);
//		src=src.replace(/(.*)-(.*)(\..*)/,"$1$3");
//		extention=src.replace(/(.*)(\.)(.*)$/,"$3");
//		alert("extention="+extention);
		thesrc=thesrc.replace(/(.*)-(.*)(\.)(.*)/,"$4\/$1$3$4");

//		alert("file reelle=" + src);
//		alert(tabimg[i].getAttribute("src"));
//		theclass=tabimg[i].getAttribute("class"); //pas compatible IE
		theclass=tabimg[i].className;

//		alert("CLASS img = "+theclass);
		if (theclass=="spip_logos"){
			var aTag = document.createElement('a');
			aTag.id="TAG_A"+i;
			aTag.setAttribute("href",'#TAG_A'+i);

// 			var txt = "javascript:function() { resizePopUp(\"IMG/"+thesrc+"\",\"European Business Management\")}"; //FF
//			alert(txt);
			tableau['TAG_A'+i] = thesrc;

//			aTag.setAttribute("onClick","PopupCentrer(\"IMG/"+src+"\",\"titre\")"); // FF only
//			aTag.onclick = function() { resizePopUp("IMG/"+thesrc,"European Business Management")};  // IE+FF
//			aTag.onclick = function() { alert(tableau[this.id]); };
			if (navigator.appName == 'Microsoft Internet Explorer') {
				// sous IE la main ne s'affiche pas
				//a.Tag.setAttribute("style","cursor: hand"); //IE only
				aTag.onclick = function() { resizePopUp("IMG/"+tableau[this.id],"EBM") }; //IE+FF
			} else {
				aTag.onclick = function() { resizePopUp("IMG/"+tableau[this.id],"EBM") }; //IE+FF
//				aTag.onclick = eval(txt);  // FF  eval pas avec IE6
			}
			img2=tabimg[i].cloneNode(true);
//			alert("file reelle=" + thesrc + " / CLASS img = " + theclass + " / PARENT = "+tabimg[i].parentNode.tagName);
			spanspiptag=tabimg[i].parentNode;
			spanspiptag.removeChild(tabimg[i]);
			spanspiptag.appendChild(aTag);
			spanspiptag.getElementsByTagName("a")[0].appendChild(img2);
// FF uniquement
//			tabimg[i].setAttribute("href","#");
//			tabimg[i].setAttribute("onClick","PopupCentrer(\"IMG/"+src+"\",\"titre\")");

		}
	}
}
// -->

