if(!document.getElementById && document.all)
    document.getElementById = function(id) {
        return document.all[id];
    }
else if(!document.getElementById && !document.all)
    document.getElementById = function(id) {
        // Très vieux navigateur. Nous faisons cela pour que object.style continue
        // à fonctionner (mais sans faire n'importe quoi)
    return { style: {} };
    }
	
function GetEmail(){
	return('m.' + '' + 'mar'+'ceau' + '@g' + 'mail' + '.com');	
}

function UpdateHtml(id,html){
	if(IdExist(id)) document.getElementById(id).innerHTML = html;
}
function UpdateInput(id,value){
	if(IdExist(id)) document.getElementById(id).value = value;
}
function GetInputValue(id){
	if(IdExist(id))  return document.getElementById(id).value;
}
function dw(txt){
	return document.write(txt);
}

function IdExist(id){
	return document.getElementById(id)
}

function in_array(val,tab){
	for(var i in tab){
		if(tab[i]==val) return true;
	}
	return false;
}

function number_format(valeur,decimal,separateur) {
// formate un chiffre avec 'decimal' chiffres après la virgule et un separateur
	var deci=Math.round( Math.pow(10,decimal)*(Math.abs(valeur)-Math.floor(Math.abs(valeur)))) ; 
	var val=Math.floor(Math.abs(valeur));
	if ((decimal==0)||(deci==Math.pow(10,decimal))) {val=Math.floor(Math.abs(valeur)); deci=0;}
	var val_format=val+"";
	var nb=val_format.length;
	for (var i=1;i<4;i++) {
		if (val>=Math.pow(10,(3*i))) {
			val_format=val_format.substring(0,nb-(3*i))+separateur+val_format.substring(nb-(3*i));
		}
	}
	if (decimal>0) {
		var decim=""; 
		for (var j=0;j<(decimal-deci.toString().length);j++) {decim+="0";}
		deci=decim+deci.toString();
		val_format=val_format+"."+deci;
	}
	if (parseFloat(valeur)<0) {val_format="-"+val_format;}
	return val_format;
}

var Document =  {
	isNetscape : navigator.appName.indexOf("Netscape")!= -1,
	isFF : navigator.userAgent.indexOf("Firefox") != -1,
	isBody : document.body,
	height :  function() {
		if( typeof window.innerHeight == 'number' ) {
			var winH = window.innerHeight;
			if( window.scrollMaxX > 0 ) {
				winH -= 17;
			}
			return winH;
		} else if ( document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else if( typeof document.body.clientHeight == 'number' ) {
			return document.body.clientHeight;
		}
	}, 
	width: function() {
		if( typeof window.innerWidth == 'number' ) {
			var winW = window.innerWidth;
			if( window.scrollMaxY > 0 ) {
				winW -= 17;
			}
			return winW;
		} else if ( document.documentElement.clientWidth ) {
			return document.documentElement.clientWidth;
		} else if( document.body && document.body.clientWidth ) {
			return document.body.clientWidth;
		}
	}, 
	scroll_left: function() {
		var posLeft = false;
		if(this.isNetscape) {
			posLeft = window.pageXOffset;
		} else {
			posLeft = document.documentElement.scrollLeft;
		}
		return typeof posLeft == 'number' ? posLeft : 0;
	}, 
	scroll_top: function() {
		var posTop = false;
		if (window.innerHeight)	{
			posTop = window.pageYOffset;
		} else if( document.documentElement && document.documentElement.scrollTop )	{
			posTop = document.documentElement.scrollTop;
		} else if(this.isBody) {
			posTop = document.body.scrollTop;
		}
		return typeof posTop == 'number' ? posTop : 0;
	}
};

var _mouseX, _mouseY;
function position(e) {
	if ( $("tools-ToolTip") ) {
		//alert('ok');
		_mouseX = (Document.isNetscape) ? e.pageX : (event.x+Document.scroll_left());
		_mouseY = (Document.isNetscape) ? e.pageY : (event.y+Document.scroll_top());
	
		if(Document.isFF){
			$("tools-ToolTip").style.left = (_mouseX + 20 ) + "px";
			$("tools-ToolTip").style.top = (_mouseY) + "px";
		}else{
			$("tools-ToolTip").style.left = (_mouseX + 10 ) + "px";
			$("tools-ToolTip").style.top = (_mouseY-25) + "px";
		}
	}
}
function showToolTip(v) {
	$("tools-ToolTip").innerHTML = v;
	$("tools-ToolTip").style.display='block';
}
function hideToolTip() {
	$("tools-ToolTip").hide();
}
if(navigator.appName.substring(0,3) == "Net") {
	document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = position;
