function swapZindex(quiTop) {
  if (quiTop == 'corps') {
  	document.getElementById('menuflash').style.zIndex = 35;
  	document.getElementById('hom_droite').style.zIndex = 42;
  	document.getElementById('corps').style.zIndex = 40;
	}else{
  	document.getElementById('menuflash').style.zIndex = 42;
  	document.getElementById('hom_droite').style.zIndex = 40;
  	document.getElementById('corps').style.zIndex = 35;
	}
}

function cleanUrl(url) {
    var u = (!url) ? window.location.href : url;
    var pos = u.lastIndexOf('#');
	
    if(pos == -1)
        return u;
	    else
		return u.substring(0,pos);
}

function openclose(item) {
	
	//clearTimeout(verifOpenClose);
	// on enleve une eventuelle ancre de l url
	window.location.hash = '1';
	
	var tmp1 = (document.getElementById ? document.getElementById(item.parentNode.id) : document.all[item.parentNode.id]);
	if (tmp1.childNodes.length == 7)
		var num = 3; // On est ss FireFox
	else
		var num = 1;
	
	//alert(tmp1+'\n\n'+num);

	var monDiv = (document.getElementById ? document.getElementById(item.parentNode.id).childNodes[num] : document.all[item.parentNode.id].childNodes[num]);
	var disp = document.getElementById(item.parentNode.id).childNodes[num].style.display;
	
	if (disp == 'none') {
		monDiv.style.display = 'block';
		item.style.background = 'url(/fileadmin/template/fr/images/openclose_close.jpg) no-repeat top right #FFFFFF';
	}	else {
		monDiv.style.display = 'none';
		item.style.background = 'url(/fileadmin/template/fr/images/openclose_open.jpg) no-repeat top right #FFFFFF';
	}
	
	//placeLogoDklik();
	//alert('123-' + ident + '-456');
}

// cette fonction est lancee toutes les 100ms...
function verifBlocOpenClose() {
	
	anchor = window.location.hash;
	anchor = anchor.substring(1,anchor.length); // enleve le #
	
	if (anchor) {
		//alert('il y a une ancre');
		var tmp1 = (document.getElementById ? document.getElementById(anchor) : document.all[anchor]);
		if (tmp1) {
			if (tmp1.childNodes.length == 7)
				var num = 3; // On est ss FireFox
			else
				var num = 1;
			
			if (document.getElementById(anchor).childNodes[num].className == 'openclose_contenu') {
			
				var item = document.getElementById(anchor).childNodes[1];
				var disp = document.getElementById(anchor).childNodes[num].style.display;
				
				if (disp == 'none') {
					document.getElementById(anchor).childNodes[num].style.display = 'block';
					item.style.background = 'url(/fileadmin/template/fr/images/openclose_close.jpg) no-repeat top right #FFFFFF';
				}
	
			}
	
			//placeLogoDklik();
		}
	}

	/*var url = document.location.toString();
	if (myFile.match('#')) {
		var anchor = myFile.split('#')[1];
		alert(anchor);
	}*/
}

function error () { return true; }
window.onerror = error;
