// JavaScript Document

function ShowContent(d) {
		//alert('toto');
		if(d.length < 1) { return; }
		document.getElementById(d).style.display = "block";
		}
	
	
	function changeImage(name, url) {
		  if (document.images[name]) {
			document.images[name].src = url;
		  }
		}
	
	function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";

}

/**
 * Verifie si le parametre 'sValeur' est vide ou rempli d'espace.
 * Fonction a appeler pour vérifier si un champ obligatoire contient une valeur.
 *
 * @param 'sValeur' Represente la valeur du champ (ex: document.formName.fieldName.value)
 * @return Retourne true si le parametre 'sValeur' est vide ou rempli d'espace. 
 * @author: Komi Sodoke - komi@bamstrategy.com
 */
function isEmpty(sValeur)   
{
	var objstring = new String(sValeur);
	if(objstring == 'null') {
		return true;
	}
	else {
		for(var compteur=objstring.length-1; compteur>=0; compteur--) {
			if(objstring.charAt(compteur) != " ")	return false;
		}
		return true;
	}
}


/*
function BrowserCheck() {

	var b = navigator.appName;
	if (b == "Netscape") this.b = "NS";
	else if (b == "Microsoft Internet Explorer") this.b = "IE";
	else this.b = b;
	this.v = parseInt(navigator.appVersion);
	this.NS = (this.b == "NS" && this.v>=4);
	this.NS4 = (this.b == "NS" && this.v == 4);
	this.NS5 = (this.b == "NS" && this.v == 5);
	this.IE = (this.b == "IE" && this.v>=4);
	this.IE4 = (navigator.userAgent.indexOf('MSIE 4')>0);
	this.IE5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	if (this.IE5 || this.NS5) this.VER5 = true;
	if (this.IE4 || this.NS4) this.VER4 = true;
	this.OLD = (! this.VER5 && ! this.VER4) ? true : false;
	this.min = (this.NS||this.IE);

}
is = new BrowserCheck();
alertBox = (is.VER5) ? document.getElementById("alertLayer").style
: (is.NS) ? document.layers["alertLayer"]
: document.all["alertLayer"].style;

function hideAlert()
{
	alertBox.visibility = "hidden";
}

function makeAlert(aTitle,aMessage)
{
	//alert('toto');
	
	document.getElementById('alertLayer').innerHTML =  "<table border=0 width=100% height=100%>" + 
	"<tr height=5><td colspan=4 class=alertTitle style='padding-top:5px'>" + " " + aTitle + "</td></tr>" + 
	
	"<tr><td width=5></td><td width=20 align=left valign=top></td><td valign=top align=left class=alertMessage><br /><br />" + aMessage + "<br /></td><td width=5></td></tr>" + 
	"<tr height=5><td width=5></td></tr>" +
	"<tr><td width=5></td><td colspan=2 align='center'><br /><img src='/includes/pop_up/ok_btn.png' width='109' height='27' class='imgpng' onClick='hideAlert()' style='cursor:pointer' /></td><td width=5></td></tr>" +
	"<tr height=5><td width=5></td></tr></table>" +
	"<!--[if lte IE 6.5]><iframe></iframe><![endif]-->";

	thisText = aMessage.length;
	
	if (aTitle.length > aMessage.length){ thisText = aTitle.length; }

		aWidth = (thisText * 5) + 80;
		aHeight = 140;

		if (aWidth < 150){ aWidth = 200; }
		if (aWidth > 350){ aWidth = 350; }
		if (thisText > 60){ aHeight = 150; }
		if (thisText > 120){ aHeight = 170; }
		if (thisText > 180){ aHeight = 190; }
		if (thisText > 240){ aHeight = 220; }
		if (thisText > 300){ aHeight = 250; }
		if (thisText > 360){ aHeight = 270; }
		if (thisText > 420){ aHeight = 290; }
		if (thisText > 490){ aHeight = 350; }
		if (thisText > 550){ aHeight = 390; }
		if (thisText > 610){ aHeight = 480; }
		
		alertBox.width = aWidth;

		alertBox.height = aHeight;
		
		alertBox.visibility = "visible";
}
*/