function addEvents(oElem,sEvent,fn){return oElem.addEventListener?oElem.addEventListener(sEvent,fn,false):oElem.attachEvent?oElem.attachEvent('on'+sEvent,fn):oElem['on'+sEvent]=fn;}function windowPrint(oElem,sText,iPos){if(window.print&&document.getElementById(oElem)&&sText!=''){var oEl=document.getElementById(oElem);var oA=document.createElement('a');oA.setAttribute('href','#');oA.appendChild(document.createTextNode(sText));oA.onclick=function(){window.print();return false;};var bInsert=false,cpt=0;i=0;if(oEl.tagName=="UL"||oEl.tagName=="OL"){if(oEl.childNodes||oEl.childNodes.length>0){var oLi=document.createElement('li');oLi.appendChild(oA);while(i<oEl.childNodes.length&&!bInsert){if(oEl.childNodes[i].nodeName=="LI"){if(++cpt==iPos){oEl.insertBefore(oLi,oEl.childNodes[i]);bInsert=true;}}i++;}}if(!bInsert)oEl.appendChild(oLi);}else oEl.appendChild(oA);}};function langue(sMot,aRemplace){if(typeof(langueJS)!="undefined"){var s=langueJS[sMot];if(aRemplace)for(var i=0;i<aRemplace.length;i++)s=s.replace(aRemplace[i][0],aRemplace[i][1]);return s;}else return "Erreur traduction : "+sMot;};document.getElementsByClass=function(nomClass,node,tag){var i,j,classElements=new Array();if(node==null)node=document;if(tag==null)tag='*';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\\s)"+nomClass+"(\\s|$)");for(i=0,j=0;i<elsLen;i++){if(pattern.test(els[i].className))classElements[j++]=els[i];}return classElements;};


/* en cours */
addEvents(window,"load",lienPopup);

function getStandardEvent(e) { // IE fixe
	if (e == null && window.event) e = window.event;
	if (e.target == null && e.srcElement) e.target = e.srcElement;
	if (! e.preventDefault ) { e.preventDefault = function() { this.returnValue = false; } }
	
	return e;
}

function openLienPopup(e) {
	e = getStandardEvent(e);
	var liens = e.target;
	var href = ''; 

	if (liens.tagName=='IMG') {
		href = liens.parentNode;
		popup_image(href);
	}
	else {
		href = liens.getAttribute('href');
		window.open(href);
	}

	e.preventDefault();
	return false;
}

function lienPopup() {
	var oL, liens = document.getElementsByClass('lien_ext', null, 'a');
	for(var i=0; i<liens.length; i++) {
		liens[i].title = 'S\'ouvre dans une nouvelle fenêtre';
		addEvents(liens[i], 'click', openLienPopup);
	}
}
/* ---- */