// JavaScript Document
var rand_divalert;
function alertdiv(sIcone,sMessage,onclick){		
	
		var rand=Math.round(Math.random()*100000);	
	   rand_divalert=rand;
		var sBouton="<br /><img id=\"boutonalert"+rand+"\" src=\"img/bt-Ok-Off.gif\" 	style='cursor:pointer;' onmouseover=\"this.src='img/bt-Ok-On.gif';\" onmouseout=\"this.src='img/bt-Ok-Off.gif';\"onclick=\"document.getElementById('alert"+rand+"').style.display='none';document.getElementById('divalert_noclick"+rand+"').style.display='none';document.onmousemove =null;"+onclick+"\">";	
		
		
	 var sPopup="<table><tr><td width=\"1\"><img src=\""+sIcone+"\"></td><td nowrap=\"nowrap\" style=\"text-align:center;padding-left:10px;\">"+sMessage+"</td></tr><tr><td colspan=\"2\">"+sBouton+"</td></tr></table>";
	 
	
	
	
	
	
	popup = document.createElement("div");
	grise = document.createElement("div");		
	
	grise.id="divalert_noclick"+rand;
	popup.id= "alert"+rand;	
	
	grise.style.position='absolute';
grise.style.backgroundImage="url('modules/popup/blank.gif')";
//grise.style.backgroundColor='#000000';

	popup.className="popupAlert";	
	popup.innerHTML=sPopup;	
	popup.style.position='absolute';
	grise.style.zIndex=10000;
	popup.style.zIndex=10001;
	popup.style.top='50%';

	popup.style.textAlign="center";
	popup.style.left='50%';	

	
	grise.style.height = '100px';	
	grise.style.width = '100px';
	
	nBody=document.getElementsByTagName('body')[0];
	nBody.appendChild(grise);
	nBody.appendChild(popup);
	
	popup.style.display="block";
	
	document.getElementById("boutonalert"+rand).focus();	
	popup.style.marginTop="-"+Math.round(alertdiv_getDivHeight(popup)/2)+"px";
	popup.style.marginLeft="-"+Math.round(alertdiv_getDivWidth(popup)/2)+"px";
	
	if (document.layers) document.captureEvents(Event.MOUSEMOVE); 
	if (document.layers || document.all) document.onmousemove = divalert_mousemove; 
	if (document.addEventListener) document.addEventListener('mousemove', divalert_mousemove, true); 

}
function divalert_mousemove(evt){
var element=document.getElementById("divalert_noclick"+rand_divalert);
	if (document.layers) { 
		x=evt.x; 
		y=evt.y; 
	} 
	if (document.all) { 
	x=event.clientX; 
	y=event.clientY; 
	} else { 
		if (document.getElementById) { 
			x=evt.clientX;
			y=evt.clientY; 
		}
	}
	element.style.left = (x-50)+"px" ; 
	element.style.top  =(y-25)+"px" ;
	
	
}

function alertdiv_getWindowHeight() { 
	var windowHeight=0; 
	if (typeof(window.innerHeight)=='number') { 
		windowHeight=window.innerHeight; 
	} else { 
		if (document.documentElement && document.documentElement.clientHeight) { 
			windowHeight = document.documentElement.clientHeight; 
		} else { 
			if (document.body&&document.body.clientHeight) { 
				windowHeight=document.body.clientHeight; 
			} 
		} 
	} 
	return windowHeight;
} 
function alertdiv_getDivHeight(element) { 
	var elementHeight=0; 
	elementHeight=element.clientHeight;	
	return elementHeight;
} 

function alertdiv_getDivWidth(element) { 
	var elementHeight=0; 
	elementHeight=element.clientWidth;	
	return elementHeight;
} 



function confirmdiv(sIcone,sMessage,onclickOk,onclickAnnuler){	
		var rand=Math.round(Math.random()*100000);	
	   rand_divalert=rand;
		var sBoutonOk="<br /><input id=\"boutonconfirmok"+rand+"\" type=\"button\" value=\"Ok\" class=\"bouton_off\" 	style=\"width:70px;\"	onmouseover=\"this.className='bouton_on';\" onmouseout=\"this.className='bouton_off';\"onclick=\"document.getElementById('alert"+rand+"').style.display='none';document.getElementById('divalert_noclick"+rand+"').style.display='none';document.onmousemove =null;"+onclickOk+"\">";	
		
		var sBoutonAnnuler="<input id=\"boutonconfirmannuler"+rand+"\" type=\"button\" value=\"Annuler\" class=\"bouton_off\" 	style=\"width:70px;\"	onmouseover=\"this.className='bouton_on';\" onmouseout=\"this.className='bouton_off';\"onclick=\"document.getElementById('alert"+rand+"').style.display='none';document.getElementById('divalert_noclick"+rand+"').style.display='none';document.onmousemove =null;"+onclickAnnuler+"\">";	
		
		
	 var sPopup="<table ><tr><td width=\"1\"><img src=\""+sIcone+"\"></td><td nowrap=\"nowrap\" style=\"text-align:center;padding-left:10px;\">"+sMessage+"</td></tr><tr><td colspan=\"2\" nowrap=\"nowrap\">"+sBoutonOk+"&nbsp;&nbsp;&nbsp;"+sBoutonAnnuler+"</td></tr></table>";
	 
	
	
	
	
	
	popup = document.createElement("div");
	grise = document.createElement("div");		
	
	grise.id="divalert_noclick"+rand;
	popup.id= "alert"+rand;	
	
	grise.style.position='absolute';
	grise.style.left='0px';
	grise.style.top='0px';

	grise.style.width="100%";	

	

	
	

	popup.className="popupAlert";	
	popup.innerHTML=sPopup;	
	popup.style.position='absolute';
	grise.style.backgroundImage="url('modules/popup/blank.gif')";
	popup.style.top='50%';

	popup.style.textAlign="center";
	popup.style.left='50%';		
	
	
	grise.style.height = '100px';	
	grise.style.width = '100px';
	
	grise.style.zIndex=10000;
	popup.style.zIndex=10001;
	
	nBody=document.getElementsByTagName('body')[0];
	nBody.appendChild(grise);
	nBody.appendChild(popup);
	
	popup.style.display="block";
	
	document.getElementById("boutonconfirmannuler"+rand).focus();	
	popup.style.marginTop="-"+Math.round(alertdiv_getDivHeight(popup)/2)+"px";
	popup.style.marginLeft="-"+Math.round(alertdiv_getDivWidth(popup)/2)+"px";
	
	if (document.layers) document.captureEvents(Event.MOUSEMOVE); 
	if (document.layers || document.all) document.onmousemove = divalert_mousemove; 
	if (document.addEventListener) document.addEventListener('mousemove', divalert_mousemove, true); 

}
function divalert_mousemove(evt){
var element=document.getElementById("divalert_noclick"+rand_divalert);
	if (document.layers) { 
		x=evt.x; 
		y=evt.y; 
	} 
	if (document.all) { 
	x=event.clientX; 
	y=event.clientY; 
	} else { 
		if (document.getElementById) { 
			x=evt.clientX;
			y=evt.clientY; 
		}
	}
	element.style.left = (x-50)+"px" ; 
	element.style.top  =(y-25)+"px" ;
	
	
}