/* DISLAY INFOS */




function displayInfos(optionValue) {
	
	if (optionValue != "null") {
		nullSelect();
		var mySpan = document.getElementById('infosText'+optionValue);
		mySpan.style.display = "block";
	}
	else {
		nullSelect();
	}
}


function nullSelect() {
	var hideSpans = document.getElementsByTagName('span');
	for(var i = 0 ; i < hideSpans.length ; ++i){
		if (hideSpans[i].className == 'displayNone') {
			hideSpans[i].style.display = "none";
		}
	}
}
 
/* POPUPS REELLES */

var newWin = null;
function closeWin(){
	if (newWin != null){
		if(!newWin.closed)
		newWin.close();
	}
}

function popUp(strURL,strType,strHeight,strWidth) {
	closeWin();
	var strOptions="";
	if (strType=="console") strOptions="resizable,scrollbars,height="+strHeight+",width="+strWidth;
	if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
	if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
	newWin = window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}

/* LIENS EXTERNES */

function open_ext_link()
{
	var liens = document.getElementsByTagName('a');
	// On récupère tous les liens (<a>) du document dans une variable (un array), ici liens.
	// Une boucle qui parcourt le tableau (array) liens du début à la fin.
	for (var i = 0 ; i < liens.length ; ++i)  {
		// Si les liens ont un nom de class égal à blank, alors on agit.
		if ((liens[i].className == 'blank') | (liens[i].className == 'blankimg'))  {
			// liens[i].title = 'S\'ouvre dans une nouvelle fenêtre';
			// Au clique de la souris.
			liens[i].onclick = function()  {
				window.open(this.href);
				return false; // On ouvre une nouvelle page ayant pour URL le href du lien cliqué et on inhibe le lien réel.
			};
		}
	}
}

window.onload = open_ext_link;