var NS4 = (document.layers) ? 1 : 0;
var IE = (document.all) ? 1 : 0;
var NS = document.getElementById&&!document.all;
var style = ((NS4 && document.test) || IE) ? 1 : 0;
var timerID = null;

//au chargement aggrandit la fenetre a la taille 478*525 (ou inferieure si resolution inferieure)
function redimPopup(x, y, w, h) {
	top.window.moveTo(x,y);
	wscreen = screen.availWidth
	hscreen = screen.availHeight
	// On maximise a w*h
	if (wscreen >= w) {wscreen = w;}
	if (hscreen >= h) {hscreen = h;}
	if (document.all) 
	{
		top.window.resizeTo(wscreen,hscreen);
	}
	else if (document.layers||document.getElementById) {
		if (top.window.outerHeight<hscreen||top.window.outerWidth<wscreen){
			top.window.outerHeight = hscreen;
			top.window.outerWidth = wscreen;
		}
	}
}

function showObject(frame, obj) {
	var obj_path;
	if (NS4) {
		obj_path = eval(frame + ".document." + obj);
		obj_path.visibility = "show";
	}
	if (IE) { 
		obj_path = eval(frame + ".document.all." + obj);
		obj_path.style.visibility = "visible";
	}
	if (NS) {
		obj_path = eval(frame + ".document.getElementById('"+obj+"')");
		obj_path.style.visibility = "visible";
	}
}

function hideObject(frame, obj) {
	var obj_path;
	if (NS4) {
		obj_path = eval(frame + ".document." + obj);
		obj_path.visibility = "hide";
	}
	if (IE) {
		obj_path = eval(frame + ".document.all." + obj);
		obj_path.style.visibility = "hidden";
	}
	if (NS) {
		obj_path = eval(frame + ".document.getElementById('"+obj+"')");
		obj_path.style.visibility = "hidden";
	}
}

function changeImg(idImg,nameImg) {
	img = eval("document." + idImg);
	img.src = nameImg;
	//fleche=findObj("FlecheMenu")
	//fleche.style.visibility='visible';
}

function resizePage(tx,ty) {
	if (navigator.appName == "Netscape") {
		self.resizeTo((tx-8),(ty-128));
	} else {
		self.resizeTo(tx,ty);
	}
}

/*
Text Link/Image Map Tooltip Script- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

if (!document.layers&&!document.all)
	event="test"
	
function showtip(current,e,text){
	if (NS4){
		document.tooltip.document.write('<layer bgColor="white" style="border:1px solid black;font-size:12px;">'+text+'</layer>');
		document.tooltip.document.close();
		document.tooltip.left=e.pageX+5;
		document.tooltip.top=e.pageY+5;
		document.tooltip.visibility="show";
	}
	if (IE){
		thetitle=text.split('<br>');
		if (thetitle.length>1){
			thetitles='';
			for (i=0;i<thetitle.length;i++)
				thetitles+=thetitle[i];
			current.title=thetitles;
		}
		else {
			current.title=text;
		}
	}
	if (NS) {
		thetitle=text.split('<br>');
		if (thetitle.length>1){
			thetitles='';
			for (i=0;i<thetitle.length;i++)
				thetitles+=thetitle[i];
			current.title=thetitles;
		}
		else {
			current.title=text;
		}
	}
}

function hidetip(){
	if (NS4)
		document.tooltip.visibility="hidden";
}

// fenetre --> contient tous les paramètres possibles
// |-> Flags
function fenetre(url, nom, x, y, largeur, hauteur, ascenseur, changeTaille, barreOutils, barreAdresse, barreEtat, barreMenu, barreLiens) {
	window.open(url, nom, 'left='+x+',top='+y+',width='+largeur+',height='+hauteur+',scrollbars='+ascenseur+',resizable='+changeTaille+',toolbar='+barreOutils+',location='+barreAdresse+',status='+barreEtat+',menubar='+barreMenu+',directories='+barreLiens);
}

// popup --> Paramètres limités
function popup(url, nom, x, y, largeur, hauteur, ascenseur) {
	window.open(url, nom, 'left='+x+',top='+y+',width='+largeur+',height='+hauteur+',scrollbars='+ascenseur+', resizable=1');
}




function f_onmouseoverlink(obj) {
	if (obj.style != null) {
		obj.style.color = '<?php echo ${"couleurRubrique".$id_rubrique_principale}; ?>';
	}
}

function f_onmouseoutlink(obj, couleur) {
	if (obj.style != null) {
		obj.style.color = couleur;
	}
}

function PopupPrivate(user,pwd) {
	window.open("private/login.php?login=" + user + "&motdepasse=" + pwd, "Private","toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width=478, height=525, left=200, top=100");
}

function fnct_remove() {
	var strm = document.login.LOGIN.value;
	strm = strm.replace("'",""); 

	document.login.LOGIN.value = strm.toLowerCase();
	
	document.login.submit();
}