/*showMessageChamp
effacerTextChamp*/

 function addEvent( obj, type, fn ) {
   if ( obj.attachEvent ) {
     obj['e'+type+fn] = fn;
     obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
     obj.attachEvent( 'on'+type, obj[type+fn] );
   } else
     obj.addEventListener( type, fn, false );
 }
 
 function removeEvent( obj, type, fn ) {
  if ( obj.detachEvent ) {
    obj.detachEvent( 'on'+type, obj[type+fn] );
    obj[type+fn] = null;
  } else
    obj.removeEventListener( type, fn, false );
}

var timer = "";

function montre(id) {
	 cachetout();

	 if (document.getElementById) {
		 document.getElementById(id).style.display="block";
	 } else if (document.all) {
		 document.all[id].style.display="block";
	 } else if (document.layers) {
		 document.layers[id].display="block";
	 }
	 
	 clearTimeout(timer);
}

function cache(id) {
	
	if (document.getElementById) {
		document.getElementById(id).style.display="none";
	} else if (document.all) {
		document.all[id].style.display="none";
	} else if (document.layers) {
		document.layers[id].display="none";
	}
	   
	timer=setTimeout("cache(id)",3000);
	
}

function cachetout() {
	cache('smenuprincipal1');
	cache('smenuprincipal2');
	cache('smenuprincipal3');
}

/* Demande d'affichage d'une fen?tre au niveau du front office */
function ouvrirFenetrePlan(url, nom) {
   window.open(url, nom, "width=520,height=500,scrollbars=yes, status=yes");
}

function ouvrirPopupAcces (url, nom) {
	window.open(url,nom, "top=100, left=100, toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no");
	return false;
}
