/////////////////////////////////////////////////////
//                                                 //
//  LIBRAIRIE DHTML                                //
//  ---------------------------------------------  //
/////////////////////////////////////////////////////

var exclude=1, agt=navigator.userAgent.toLowerCase(), ie=0, ns=0, op=0, mz7=0, kde=0, saf=0, fx=0, w3c=0;
var myObj, object;


if(typeof navigator.vendor!="undefined" && navigator.vendor=="KDE"){
	var thisKDE=agt;
	var splitKDE=thisKDE.split("konqueror/");
	var aKDE=splitKDE[1].split("; ");
	var KDEn=parseFloat(aKDE[0]);
	if(KDEn>=2.2){kde=1; ns=1; exclude=0;}
	}
else if(agt.indexOf('webtv')!=-1){exclude=1;}
else if(typeof window.opera!="undefined"){
	exclude=0;
	if(/opera[\/ ][5]/.test(agt)){op=1;}
	if(/opera[\/ ][6]/.test(agt)){op=1;}
	if(/opera[\/ ][7-9]/.test(agt)){op=1;}
	}
else if(typeof document.all!="undefined"&&!kde){
	exclude=0;
	if(typeof document.getElementById!="undefined"){ie=1}
	}
else if(typeof document.getElementById!="undefined"){
	exclude=0;
	if (agt.indexOf("firefox")!=-1){fx=1;}
	if(agt.indexOf("netscape")!=-1){ns=1;}
	else if(agt.indexOf("gecko")!=-1){mz7=1;}
	if(agt.indexOf("safari")!=-1 || (typeof document.childNodes!="undefined" && typeof document.all=="undefined" && typeof navigator.taintEnabled=="undefined")){mz7=0;saf=1;}
	}
else if((agt.indexOf('mozilla')!=-1)&&(parseInt(navigator.appVersion)>=4)){exclude=1}
if(agt.indexOf('escape')!=-1){exclude=1}
if(typeof navigator.__ice_version!="undefined"){exclude=1}

w3c = (ie || ns || fx || saf);


// FONCTIONS DHTML ***********************************************

function getInputValue(objId,ieObj,nsObj){
	if (w3c){
		myObj = document.getElementById(objId);
		if (myObj != null) {
			if (fx || saf){
				return myObj.value
			}else{
				return myObj.getAttribute('value')
			}
		}else{ return '' }
	}else{
		if (ie) {
			myObj = eval(ieObj);
			if (myObj != null) {
				return myObj.value
			}else{ return '' }
		}else{
			myObj = eval(nsObj);
			if (myObj != null) {
				return myObj.value
			}else{ return '' }
}}}

function getSelectValue(objId,ieObj,nsObj){
	if (w3c){
		myObj = document.getElementById(objId);
		if (myObj != null) {
			return myObj.options[myObj.selectedIndex].value
		}else{ return '' }
	}else{
		if (ie) {
			myObj = eval(ieObj);
			if (myObj != null) {
				return myObj.options[myObj.selectedIndex].value
			}else{ return '' }
		}else{
			myObj = eval(nsObj);
			if (myObj != null) {
				return myObj.options[myObj.selectedIndex].value
			}else{ return '' }
}}}

function setInputValue(cString,objId,ieObj,nsObj){
	if (w3c){
		myObj = document.getElementById(objId);
		if (myObj != null) {
			myObj.setAttribute('value',cString)
		}
	}else{
		if (ie){
			myObj = eval(ieObj);
		}else{
			myObj = eval(nsObj);
		}
		if (myObj != null) myObj.value = cString
	}
}

function focusOnObject(objId,ieObj,nsObj){
	if (w3c){
		myObj = document.getElementById(objId);
	}else{
		(ie) ? myObj = eval(ieObj) : myObj = eval(nsObj)
	}
	if (myObj != null){
		myObj.focus();
		myObj.select();
}}

function submitForm(formId,ieFormId,nsFormId){
	if (w3c){
		myObj = document.getElementById(formId);
		if (myObj != null) myObj.submit()
	}else{
		(ie) ? myObj = eval(ieFormId) : myObj = eval(nsFormId)
		if (myObj != null) myObj.submit()
}}



// FONCTIONS DIVERSES *******************************************

function openWindow(whichOne,tools,scrolling,resize,w,h){
	var t = parseInt((screen.availHeight - h)/2);
	var l = parseInt((screen.availWidth - w)/2);
	tcsopen = window.open(whichOne, domaine,'toolbar='+tools+',location=no,directories=no,status=yes,menubar=no,scrollbars='+scrolling+',resizable='+resize+',width='+w+',height='+h+',top='+t+',left='+l);
	if (ie) {
		if (tcsopen.closed==false) tcsopen.focus()
	}else{
		tcsopen.focus()
	}
}

function openWindowNoStatus(whichOne,tools,scrolling,resize,w,h){
	var t = parseInt((screen.availHeight - h)/2);
	var l = parseInt((screen.availWidth - w)/2);
	
	tcsopen = window.open(whichOne,'ebv','toolbar='+tools+',location=no,directories=no,status=no,menubar=no,scrollbars='+scrolling+',resizable='+resize+',width='+w+',height='+h+',top='+t+',left='+l);
	if (document.all) {
		if (tcsopen.closed==false) tcsopen.focus()
	}else{
		tcsopen.focus()
	}
}


