/*Clair et Net. @ 2007*/
function dropDown (){
	var root=document.getElementById ("navbar");
	for (var i=0; i < root.childNodes.length; i++){
		var tab=root.childNodes[i];
		if(tab.nodeName=="LI"){

			var offset=(navigator.appName.indexOf("Microsoft Internet") != -1) ? 3 : 2;
			var li_w=tab.offsetWidth - offset;
			if(li_w < 120){
				li_w=120 - offset;
			}
			
			var ul_list=tab.getElementsByTagName ("UL");
			var ul_element=ul_list[0];
			if(ul_element){
				ul_element.style.width=li_w + "px";
				var a_list=ul_element.getElementsByTagName ("A");
				for (var j=0; j < a_list.length; j++){
					var a_element=a_list[j];
					a_element.style.width=(li_w - 5) + "px";
					if(i==root.childNodes.length - 1){
						a_element.style.textAlign="right";
					}
				}
			}
			var lastUl=document.getElementById ("lastUl");
			lastUl.style.marginLeft="-5px";
			lastUl.style.width="120px";
			var ul_a=lastUl.getElementsByTagName ("A");
			for (var k=0; k < ul_a.length; k++){
				ul_a[k].style.textAlign="left";
			}
		}
		if(document.all && document.getElementById){
			tab.onmouseover=function (){
				this.className+=" over";
			}
			tab.onmouseout=function (){
				this.className=this.className.replace (" over", "");
			}
		}
	}
}

window.onload=dropDown;

function switchImg (listHolder){
	var imgStr=new String ();
	var altStr=new String ();

	var holder=document.getElementById (listHolder);
	for (var i=0; i < holder.childNodes.length; i++){
		var e=holder.childNodes[i];
		if(e.nodeName=="LI"){
			if(e && e.firstChild.nodeName=="A"){
				var a=e.firstChild;
				var aHtml=a.innerHTML;

				var img=a.firstChild

				imgStr=aHtml.split ("src=\"")[1].split (".gif")[0];
				var ext=aHtml.substr (aHtml.indexOf(".gif"), 4);
				altStr=aHtml.substr (aHtml.indexOf("alt"), aHtml.indexOf(">"));
				var newSrc=imgStr + "_hover" + ext;

				a.oldSrc=img.src;
				a.newSrc=newSrc;

				a.onmouseover=function (){
					this.firstChild.src=this.newSrc;	
				}

				a.onmouseout=function (){
					this.firstChild.src=this.oldSrc;
				}
			}
		}
	}
}

function popIt(destUrl, width, height, windowname){
	var screen_top=screen.availTop;
	var screen_left=screen.availLeft;
	var screen_width=screen.availWidth;
	var screen_height=screen.availHeight;

	var X_pos=(screen_width - width) / 2;
	var Y_pos=(screen_height - height) / 2;

	if(windowname==''){
		var windowname='popIt';
	}

	var popWindow=window.open(destUrl, windowname, "dependent=yes,toolbar=no,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height+", left="+X_pos + ", top=" + Y_pos + ",screenX=" + X_pos + ",screenY=" + Y_pos);
//	popWindow.moveTo(X_pos, Y_pos);
	popWindow.focus();
}

function getURL(strUrl){
	if(strUrl != ''){
		window.location.href=strUrl;
	}
}

function PopUp(url, width, height){
	desktopURL=url
	var desktop=window.open( desktopURL, "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width="+width+",height="+height+"" );
}


function PopUp2(url, width, height){
	desktopURL=url
	var desktop=window.open( desktopURL, "_blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width="+width+",height="+height+"" );
}
/*TestePourVous. @ 2007*/
function ValidationConnexion(){
	var vartest;
	vartest=0;
	if(document.FormLogin.strIdentifiant.value==''){
		alert('Veuillez saisir votre identifiant');
		vartest=1;
	}
	if(document.FormLogin.strMotDePasse.value==''){
		alert('Veuillez saisir votre Mot de Passe');
		vartest=1;
	}
	/*alert (vartest);*/
	if(vartest==0){
		document.FormLogin.submit();
	}
}
