
/*
	Fonction qui coche toutes les radio d'une zone
*/
function check_all(node_)
{
	for(var i=0; i<node_.childNodes.length; i++) {
		if(node_.childNodes[i].nodeName=="INPUT") {
			node_.childNodes[i].checked=true;
		} else {
			//sinon, on fouille plus bas
			check_all(node_.childNodes[i]);
		}
	}
}

/*
	Fonction qui décoche toutes les radio d'une zone
*/
function uncheck_all(node_)
{
	for(var i=0; i<node_.childNodes.length; i++) {
		if(node_.childNodes[i].nodeName=="INPUT") {
			node_.childNodes[i].checked=false;
		} else {
			//sinon, on fouille plus bas
			uncheck_all(node_.childNodes[i]);
		}
	}
}

/*
Fonction qui permet d'activer un rollOver sur des éléments dont on donne la balise
Actuellement, c'est ligneOver et ligneNormal qu'il faut utiliser
*/
function makeOver(node_, nodeName_) {
	for(var i=0; i<node_.childNodes.length; i++) {
		if(node_.childNodes[i].nodeName==nodeName_) {
			//assignation des actions
			node_.childNodes[i].onmouseover = ligneOver;
			node_.childNodes[i].onmouseout = ligneOut;
		} else {
			//sinon, on fouille plus bas
			makeOver(node_.childNodes[i], nodeName_);
		}
	}
}

/*
Fonction similaire qui utilise les 2 mêmes styles, mais qui permet de faire un talbeau avec les lignes une couleur sur 2
*/
var odd=0;
//variable qui permet de compter les lignes assignées pour faire le décalage des classes

function makeOdd(node_, nodeName_) {

	for(var i=0; i<node_.childNodes.length; i++) {
		if(node_.childNodes[i].nodeName==nodeName_) {
			//assignation des classes
			if(odd%2>0) {
				node_.childNodes[i].className =  "ligneOver";
			} else {
				node_.childNodes[i].className =  "ligneNormal";
			}
			odd++;
		} else {
			//sinon, on fouille plus bas
			makeOdd(node_.childNodes[i], nodeName_);
		}
	}
}

//fonction de rollOver
function ligneOver() {
	this.className = "ligneOver";
}

function ligneOut() {
	this.className = "ligneNormal";
}
//=======================================================================


function my_confirm(text_, url_) {
	rep=confirm(text_);
	if(rep) document.location=url_;
}

function show_hide(obj_) {
	obj = document.getElementById(obj_);
	if(obj.style.display == '') obj.style.display = 'none';
	else obj.style.display = '';
}

var old_obj=null;
function show_hide2(obj_) {
	obj = document.getElementById(obj_);
	if(obj.style.display == '') obj.style.display = 'none';
	else obj.style.display = '';

	//de plus, on change l'ancien objet si on en a un
	if(old_obj && old_obj!=obj) {
		old_obj.style.display='none';
	}

	//mémorisation de l'ancien objet
	old_obj = obj;
}

/*
test de radio bouton
*/
function radiotest(node) {
	for (var i=0; i<node.length;i++) {
		if( node[i].checked )
		{
		var select = node[i].value;
		break;
		}
	}
	return select;
}

function PopupImage(img)
{
    w=open("",'image','toolbar=no,scrollbars=auto,resizable=no');
    w.document.write("<html><head><title></title></head>");
    w.document.write("<SCRIPT language=javascript>function ejs_nodroit() {return(false);}document.oncontextmenu = ejs_nodroit;function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
    w.document.write("<body onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0 scrolling=no><img src='"+img+"' border=0>");
    w.document.write("");
    w.document.write("</body></html>");
    w.document.close();
}


//---------------------------- ZOOM ----------------------
var zoomToCheck;
var zommFen=null;
function openZoom(img_) {
	//si une fenetre zoom est déjà ouverte, on la ferme
	if(zommFen!=null) {
		zommFen.close();
	}

	fen=window.open("", "", "resizable=yes, scrollbars=auto, width=500, height=500");
	if(!fen) {
		alert("Attention, votre navigateur a bloqué la fenêtre, merci d'autoriser les popups pour ce site.");
	} else {
		fen.document.write("<html><body><img src='"+img_+"' ></body></html>");

		zoomFen=fen;
		zoomToCheck = fen.document.images[0]
		checkLoadZoom();
		//fen.document.close();
	}
}

function checkLoadZoom() {
	if(zoomToCheck.complete) {
		zoomFen.resizeTo(zoomToCheck.width+40, zoomToCheck.height+80);
		zoomFen.focus();
	} else {
		setTimeout('checkLoadZoom()',250);
	}
}
//----------------------- <<< ZOOM -----------------------

function run_flash(url,width,height, wmode)
{
	/*
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="home" align="middle">\n');
	document.write('<param name="movie" value="'+url+'">\n');
	document.write('<embed src="'+url+'" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash">\n');
	document.write('</embed>\n');
	document.write('</object>\n');
*/
	document.write('<object type=\"application/x-shockwave-flash\" data=\"'+url+'" width="'+width+'" height="'+height+'">');
	document.write('<param name="movie" value="'+url+'" />');
	document.write('<param name="wmode" value="'+wmode+'" />');
	document.write('</object>');

}