function roll2(ImageName, gf)
{  var path;
	path='../images/';
	document.images[gf].src = path + ImageName;
}

function roll3(ImageName, gf)
{  var path;
	path='../../images/';
	document.images[gf].src = path + ImageName;
}

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_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 ouvrefenetren(url,name,w,h) {
popup=window.open(url, name, 'width='+w+', height='+h+', location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no, left=10, top=10');
popup.focus();
}

function ouvrelabo(url) {
popup=window.open(url, 'labo', 'width=704, height=528, location=no, menubar=no, status=no, toolbar=yes, scrollbars=yes, resizable=yes, left=10, top=10');
popup.focus();
}

function ouvrefaq(url) {
popup=window.open(url, 'labo', 'width=704, height=528, location=no, menubar=no, status=no, toolbar=yes, scrollbars=yes, resizable=yes, left=10, top=10');
popup.focus();
}

function ouvrelp(url) {
popup=window.open(url, 'lp', 'width=786, height=400, location=no, menubar=no, status=no, toolbar=yes, scrollbars=yes, resizable=yes, left=10, top=10');
popup.focus();
}

function fermer() {
window.close();
}

function ami() {
var url=document.location.href;
var title=document.title;
window.open("../ami.html?art="+url+"&titre="+title,'','toolbar=no, location=no, menubar=no, directories=no, status=no, scrollbars=no, resizable=yes, copyhistory=no, height=345, width=530, left=10, top=10');
}

function ecrire() {
window.open("../ecrire.html",'','toolbar=no, location=no, menubar=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, height=300, width=530, left=10, top=10');
}

function imprime(){
	var machine = navigator.platform;
	var navigateur = navigator.appName;
	if (machine == 'MacPPC') {
		if (navigateur == 'Microsoft Internet Explorer') {
			alert ("Cette fonction n'est pas disponible sur Macintosh.\n Veuillez utiliser la fonction imprimer d'Internet Explorer");
		} else if (navigateur == 'Netscape') {
			alert ("Cette fonction n'est pas disponible sur Macintosh.\n Veuillez utiliser la fonction imprimer de Netscape");
		} else {
			alert ("Cette fonction n'est pas disponible sur Macintosh.\n Veuillez utiliser la fonction imprimer de votre navigateur");
		}
	} else {
		window.print() ;
	}
}

function ferme_popup() {
  if (popup) popup.close();
  popup = null;
}

function gocitefenetre() {
if (window.opener && !window.opener.closed && window.focus) {
	adresse = window.opener.location.href;
	//alert(adresse);
	re = new RegExp("cite-sciences","i");
	if (re.test(adresse)) {
		//window.opener.location="http://www.cite-sciences.fr";
		//window.parent.location.href="http://www.cite-sciences.fr";
		window.open("http://www.cite-sciences.fr");
		self.close();	
	}
} else {
	window.open("http://www.cite-sciences.fr");
	self.close();
}
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function getLyrRef(lyr,doc) {
	if (document.layers) {
		var theLyr;
		for (var i=0; i<doc.layers.length; i++) {
	  	theLyr = doc.layers[i];
			if (theLyr.name == lyr) return theLyr;
			else if (theLyr.document.layers.length > 0) 
	    	if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
					return theLyr;
	  }
		return null;
  }
}

function toggleVisibility(id, NNtype, IEtype, WC3type) {
	var lyr = getElemRefs(id);
 	 if (lyr && lyr.css) lyr.css.visibility = IEtype;
    
}