	// BROWSER DETECTION
	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.version = navigator.appVersion
		this.v = parseInt(this.version)
		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.ns6 = (this.b=="ns" && this.v==6)
		this.ie = (this.b=="ie" && this.v>=4)
		this.ie4 = (this.version.indexOf('MSIE 4')>0)
		this.ie5 = (this.version.indexOf('MSIE 5')>0)
		this.min = (this.ns||this.ie)
	}
	is = new BrowserCheck();
	
	
	// INPUT ACTIONS
	function enterInput(obj,text) {
		if (obj.value == text) {
			obj.value = "";
		}
	}
	
	function leaveInput(obj,text) {
		if (obj.value == "") {
			obj.value = text;
		}
	}
	
	// COOKIE FUNCTIONS	
	var date_cookie = new Date;
	var chargement = false;
	date_cookie.setFullYear(date_cookie.getFullYear() + 10);

	function writeCookie(nom, valeur)	{
		var argv = writeCookie.arguments;
		var argc = writeCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = nom + "=" + escape(valeur) +
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");
	}
	
	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf(";", offset);
		if (endstr == -1)
			endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr)); 
	}
	
	function readCookie(nom) {
		var arg = nom + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen)	{
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return getCookieVal(j);
			i = document.cookie.indexOf(" ",i) + 1;
			if (i == 0)
				break;
		}
		return null; 
	}
	

	// MAIN MENU ROLLOVER
	function enterInput(obj,text) {
		if (obj.value == text) {
			obj.value = "";
		}
	}
	
	function leaveInput(obj,text) {
		if (obj.value == "") {
			obj.value = text;
		}
	}
	
	var timerMenu = new Array();
	var isMenuOpen = new Array();
	var isOverMenu = false;
	
	function showMenu(idx) {
		//alert(eval("document.all.smenu" + idx + ".style.visibility"));
		if (!isMenuOpen[idx]) {
			document.getElementById('smenu' + idx).style.display = "block";
			document.getElementById('menu' + idx).className = "mainmenuover";
			if (typeof timerMenu[idx] != "undefined") clearTimeout(timerMenu[idx]);
			isOverMenu = true;
			//hideObjectWhenMainNavIsOpened(true);
		}
	}
	
	function hideMenu(idx) {
		//alert(idx);
		isOverMenu = false;
		timerMenu[idx] = setTimeout('doHideMenu(' +idx + ')', 100);
		document.getElementById('menu' + idx).className = "";		
	}
	
	function doHideMenu(idx) {
		clearTimeout(timerMenu[idx]);
		document.getElementById('smenu' + idx).style.display = "none";
		isMenuOpen[idx] = false;
		//if (!isOverMenu) hideObjectWhenMainNavIsOpened(false);
	}
	
	

		
	
	// POPUP FUNCTION
	var zoomwindow;
	
	function deplace(window,width,height)
	{
		var scr_x = screen.width;
		var scr_y = screen.height;
		if (is.v >= 4)
		{
			if (is.ns)
			{
				window.moveTo((scr_x/2)-(width/2), (scr_y/2)-(height/2));
			}
			else
			{
				window.moveTo(parent.window.screenLeft+300, parent.window.screenTop+50);
			}
		}
	}
		
	var movePopup = true;
	var scrollPopup = 1;
	
	function popup(url, width, height)
	{
		if (url != "")
		{
			var features;
			var windowName = "ZOOMWINDOW";
			
			movePopup = true;
			scrollPopup = 1;
			if (popup.arguments.length >= 4)
			{
				if (popup.arguments[3])
				{
					movePopup = true;
				}
				else
				{
					movePopup = false;
				}
			}
			if (popup.arguments.length >= 5)
			{
				if (popup.arguments[4] == 0 || popup.arguments[4] == 1)
				{
					scrollPopup = popup.arguments[4];
				}
			}
			if (popup.arguments.length >= 6)
			{
				zoomwindow = popup.arguments[5];
				windowName = zoomwindow;
			} else
			{
				if (zoomwindow != null)
				{
					if (!zoomwindow.closed)
						zoomwindow.close();
				}
			}
			
			features = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + scrollPopup + ",resizable=0,width=" + width + ",height=" + height + "'";
			zoomwindow = window.open(url,windowName,features);
			
			if (zoomwindow != null)
			{
				if (is.v >= 3)
				{
					zoomwindow.focus();
				}
				if (movePopup)
				{
					deplace(zoomwindow,width,height);
				}
			}
		}
	}
	