var isWaiting = false;
var isActivated = true;
var x;
var y;
if (document.getElementById("popbox")){
	var box = document.getElementById("popbox");
	box.style.visibility = "hidden";
	if(navigator.appName.substring(0,3) == "Net")
		document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = pointer;
}


function elementsVisiblity(value){
	frame = document.getElementsByTagName('iframe');
	for(i=0;i<frame.length;i++) {
		frame[i].style.visibility = value;
	}
}

function myAlert(message,action){
	if(action) {
		if(confirm(message)) {
			sendMe();
		}
	}
	else {
		alert(message);
	}
	return;
	if (document.compatMode && document.compatMode != "BackCompat") {
		theWidth = document.documentElement.clientWidth;
		theHeight = document.documentElement.clientHeight;
		theTop = document.documentElement.scrollTop;
	}
	else {
		theWidth = document.body.clientWidth;
		theHeight = document.body.clientHeight;
		theTop = document.body.scrollTop;
	}
	if(layer) {
		layer.style.left = ((theWidth-300)/2)+'px';
		layer.style.top = (((theHeight-300)/2)+theTop)+'px';
		if(action) {
			message += '<p><a href="javascript:closeAlert();">Annuler</a>&nbsp;<a href="javascript:'+action+'">ok</a></p>';
		}
		else {
			message += '<p><a href="javascript:closeAlert();">ok</a></p>';
		}
		elementsVisiblity('hidden');
		$("alert").style.visibility = 'visible';
		$("alert").innerHTML = message;
	}
}

function closeAlert() {
	$("alert").style.visibility = 'hidden';
	elementsVisiblity('visible');
}

function setActivated(state) {
	if(!state) state=false;
	isActivated=state;
}

function poplink(contenu){
		contenu=contenu.replace(/§/g, "\"");
		contenu=contenu.replace(/µ/g, "'");
		var content ="<TABLE height=20 BORDER=0 CELLPADDING=0 CELLSPACING=1 BGCOLOR=#2D7D36><TR><TD><table width=100%  border=0 cellspacing=0 cellpadding=0><tr><td bgcolor=#C6D27B><TABLE height=20 CELLPADDING=3 CELLSPACING=0><TR><TD background=images/bulle_fond.gif class=popup2>"+contenu+"</TD></TR></TABLE></td></tr></table></TD></TR></TABLE>";
		if (box) {
			box.innerHTML = content;	
			box.style.visibility = "visible";
		}
}

function poplink2(contenu){
		contenu=contenu.replace(/§/g, "\"");
		contenu=contenu.replace(/µ/g, "'");
		var content ="<TABLE height=20 BORDER=0 CELLPADDING=0 CELLSPACING=1 BGCOLOR=#DF5D16><TR><TD><table width=100%  border=0 cellspacing=0 cellpadding=0><tr><td bgcolor=#FADFCE><TABLE height=20 CELLPADDING=3 CELLSPACING=0><TR><TD background=images/bulle_fond2.gif class=popup3>"+contenu+"</TD></TR></TABLE></td></tr></table></TD></TR></TABLE>";
		if (box) {
			box.innerHTML = content;
			box.style.visibility = "visible";
		}
}

function pointer(e){
	if(box.style.visibility == "visible") {
		x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x + document.body.scrollLeft;
		y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y + document.body.scrollTop;
		box.style.left = x+20;
		box.style.top = y-10;
	}
}

function closepopup(){
	if(box) {
		box.style.visibility = "hidden";
		box.style.left = 0;
		box.style.top = 0;
	}
}