/* Fonctions pour fixer la page*/
var fixFirstLoad = true;
function fixColumns(onresize){
	if (!onresize && !fixFirstLoad) window.onresize = function() {};
	var scrollTop = document.getElementsByTagName("html")[0].scrollTop;
	var minh=0,maxh=0,x;
		var blocks = new Array("nav_left","ctn_ctt","nav_right","nav_resa");
	var ctn_ft = document.getElementById("ctn_ft");

	var ctn_page = document.getElementById("ctn_page");
	for (var i=0;i<4; i++) {  //on rcupere le block du  milieu afin de connaitre la position TOP
		var ctn_mdl = document.getElementById("ctn_mdl_"+i+"cols");
		if (ctn_mdl) break;
	}
	if (!ctn_mdl) return;

	//recuperation de la hauteur max
	for (var i=0; i<blocks.length; i++) {
		x = document.getElementById(blocks[i]);
		if (x) {
			if (document.all && window.print && !window.opera) { x.style.height="1%";} //on rinitialise la hauteur des blocs, pour IE on met  1%, pour les autres navigateurs on utilise remove property
			else x.style.removeProperty("height");
			var myx = 0;
            if (document.all && window.print && !window.opera) {
                myx = x.scrollHeight; // for IE7/IE8
            } else {
                myx = x.offsetHeight; // for all others navigators
            }
			if (parseInt(myx)>parseInt(maxh) && (getStyle(x,"display")!="none" && getStyle(x,"visibility")!="hidden") ) {
			    var removeHeight = (document.getElementById("nav_right") && document.getElementById("nav_resa")) ? parseInt(getStyle(document.getElementById("nav_resa"),"top")) : 0 ;
				maxh=parseInt(myx+removeHeight);
			}
		}
	}
	//calcul de la hauteur minimum
	minh = ctn_page.offsetHeight-ctn_mdl.offsetTop-ctn_ft.offsetHeight-getVPadding(ctn_mdl); //on retire le padding du block ctn_mdl
	if (minh>maxh) maxh = minh;

	for (var i=0; i<blocks.length; i++) {
		x = document.getElementById(blocks[i]);
		if (x && (getStyle(x,"display")!="none" && getStyle(x,"visibility")!="hidden")) {
			x.style.height = (maxh-getVPadding(x))+"px";
		}
	}
	document.getElementsByTagName("html")[0].scrollTop = scrollTop;
	if (!onresize && !fixFirstLoad) setTimeout("window.onresize =function() {fixColumns(true)};",3000);
	fixFirstLoad = false;

	// Ugly: init script for template_t1 in recherche_par_critere
}

/* getVPadding : retourne la valeur des paddings verticaux d'un bloc*/
function getVPadding(obj) {
	if (!obj) return 0;
	var pad = parseInt(getStyle(obj,"padding-top"))+parseInt(getStyle(obj,"padding-bottom"));
	if (isNaN(pad)) pad = 0;
	return pad;
}

/* fonction qui permet de rcuprer le style prcis d'un lment (mme si le style est appliqu en CSS) */
function getStyle(oElm, strCssRule){
    var strValue = "";
    if(document.defaultView && document.defaultView.getComputedStyle){
		try{
			strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
		} catch(e) {
			return "";
		}
    }
    else if(oElm.currentStyle){
        try{
			strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
	            return p1.toUpperCase();
	        });
	        strValue = oElm.currentStyle[strCssRule];
		} catch(e) {
			return "";
		}
    }
    return strValue;
}
/*fin des fonctions*/


function showhide(bloc){
	with (document.getElementById(bloc).style) {
		if (display == 'none'){
			try {
				display = 'table';
			} catch(e) {
				display = 'block';
			}
		}
		else{
			  display = 'none';
		}
	}
	fixColumns();
}

function faq(obj) {
	if (!obj) return;
	var img = obj.getElementsByTagName("img")[0];
	img.src = (img.src.indexOf("_on.")!=-1) ? img.src.replace("_on","_off") : img.src.replace("_off","_on");
	while (obj.className.indexOf("type_tetiere")==-1) obj = obj.parentNode; //on remonte
	var tr = obj.getElementsByTagName("tr");
	for (var i=0; i<tr.length; i++) {
		var x = tr[i].className;
		x = (x.indexOf("_off")!=-1) ? x.replace("_off","_on") : x.replace("_on","_off");
		tr[i].className = x;
	}
	obj.blur();
	fixColumns();
}
function initFaq() {
	var table = document.getElementsByTagName("table");
	for (var i=0; i<table.length; i++) {
		if(table[i].className.indexOf("type_tetiere")!=-1) faq(table[i]);
	}
	fixColumns();
}

var ifrlayer = {
	make:function(obj) {
		if(!obj) return; obj = (typeof(obj)=="string") ? document.getElementById(obj) : obj; if(!obj) return;
		if((document.getElementsByTagName("select").length>0 || document.getElementsByTagName("embed").length>0 || document.getElementsByTagName("object").length>0) && document.all && document.getElementById && !window.opera) {
			if(obj.parentNode && !obj.iframelayer) var ifr = obj.parentNode.insertBefore(document.createElement("iframe"), obj);
			else return;
			if(obj.currentStyle.zIndex != "" && parseInt(obj.currentStyle.zIndex)>1 ) {
				ifr.style.zIndex = parseInt(obj.currentStyle.zIndex)-1;
			}
			ifr.src = "javascript:false";
			with(ifr.style) {
				filter = "alpha(opacity=0)";
				position = "absolute";
				width =  obj.offsetWidth+"px";
				height =  obj.offsetHeight+"px";
			}
			obj.iframelayer = ifr;
			ifrlayer.move(obj);
		}
	},
	kill:function(obj) {
		if(!obj) return; obj = (typeof(obj)=="string") ? document.getElementById(obj) : obj; if (!obj) return;
		if (!obj.iframelayer) return;
		var ifr = obj.iframelayer;
		if(ifr && ifr.parentNode) {
			ifr.parentNode.removeChild(ifr);
			obj.iframelayer = null
		}
	},
	move:function(obj) {
		if(!obj || !obj.iframelayer) return;
		with(obj.iframelayer.style) {
			top = obj.offsetTop+"px";
			left =  obj.offsetLeft+"px"
		}
	}
}

var actualDate = new Date("07/25/2006");

var today=new Date();

actualDate=today;

var mylocale = true;
if (mylocale) {
	var malangue = getLocale();

	var monthsStrings=new Array();
	monthsStrings['fr']=new Array("Jan","Fev","Mar","Avr","Mai","Juin","Jui","Aou","Sep","Oct","Nov","Dec");
	monthsStrings['cf']=new Array("Jan","Fev","Mar","Avr","Mai","Juin","Jui","Aou","Sep","Oct","Nov","Dec");
	monthsStrings['en']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	monthsStrings['ae']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	monthsStrings['us']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	monthsStrings['dk']=new Array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec");
	monthsStrings['fi']=new Array("Tam","Hel","Maa","Huh","Tou","Kes","Hei","Elo","Syy","Lok","Mar","Jou");
	monthsStrings['de']=new Array("Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez");
	monthsStrings['gr']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // cyrillique
	monthsStrings['it']=new Array("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic");
	monthsStrings['nl']=new Array("Jan","Feb","Maa","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec");
	monthsStrings['no']=new Array("Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des");
	monthsStrings['pl']=new Array("Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru");
	monthsStrings['pt']=new Array("Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez");
	monthsStrings['ru']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // cyrillique
	monthsStrings['es']=new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");
	monthsStrings['se']=new Array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec");
	monthsStrings['ca']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	monthsStrings['cn']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // chinois
	monthsStrings['jp']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // japonais
	monthsStrings['kn']=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); // coren
	monthsStrings['zh']=new Array("&#19968;&#26376;","&#20108;&#26376;","&#19977;&#26376;","&#22235;&#26376;","&#20116;&#26376;","&#20845;&#26376;","&#19971;&#26376;","&#20843;&#26376;","&#x4e5d;&#x6708;","&#21313;&#26376;","&#21313;&#19968;&#26376;","&#21313;&#20108;&#26376;"); // chinois trad
	monthsStrings['zt']=new Array("&#19968;&#26376;","&#20108;&#26376;","&#19977;&#26376;","&#22235;&#26376;","&#20116;&#26376;","&#20845;&#26376;","&#19971;&#26376;","&#20843;&#26376;","&#x4e5d;&#x6708;","&#21313;&#26376;","&#21313;&#19968;&#26376;","&#21313;&#20108;&#26376;"); // chinois trad

	var daysStrings=new Array();
	daysStrings['fr']=new Array("Lu","Ma","Me","Je","Ve","Sa","Di");
	daysStrings['cf']=new Array("Lu","Ma","Me","Je","Ve","Sa","Di");
	daysStrings['ae']=new Array("Mo","Tu","We","Th","Fr","Sa","Su");
	daysStrings['en']=new Array("Mo","Tu","We","Th","Fr","Sa","Su");
	daysStrings['us']=new Array("Mo","Tu","We","Th","Fr","Sa","Su");
	daysStrings['dk']=new Array("Ma","Ti","On","To","Fr","L&oslash;","S&oslash;");
	daysStrings['fi']=new Array("Es","Te","Ko","Ne","Re","La","P&uuml;");
	daysStrings['de']=new Array("Mo","Di","Mi","Do","Fr","Sa","So");
	daysStrings['gr']=new Array("Mo","Tu","We","Th","Fr","Sa","Su"); // cyrillique
	daysStrings['it']=new Array("Lu","Ma","Me","Gi","Ve","Sa","Do");
	daysStrings['nl']=new Array("Ma","Di","Wo","Do","Vr","Za","Zo");
	daysStrings['no']=new Array("Ma","Ti","On","To","Fr","L&oslash;","S&oslash;");
	daysStrings['pl']=new Array("Po","Wt","?r","Cz","Pi","So","Ni");
	daysStrings['pt']=new Array("Se","Te","Qu","Qu","Se","S&aacute;","Do");
	daysStrings['ru']=new Array("Mo","Tu","We","Th","Fr","Sa","Su"); // cyrillique
	daysStrings['es']=new Array("Lu","Ma","Mi","Ju","Vi","S&aacute;","Do");
	daysStrings['se']=new Array("M&aring;","Ti","On","To","Fr","L&ouml;","S&ouml;");
	daysStrings['ca']=new Array("Mo","Tu","We","Th","Fr","Sa","Su");
	daysStrings['cn']=new Array("Mo","Tu","We","Th","Fr","Sa","Su"); // chinois
	daysStrings['jp']=new Array("Mo","Tu","We","Th","Fr","Sa","Su"); // japonais
	daysStrings['kn']=new Array("Mo","Tu","We","Th","Fr","Sa","Su"); // coren
	daysStrings['zh']=new Array("&#19968;","&#20108;","&#19977;","&#22235;","&#20116;","&#20845;","&#26085;"); // chinois trad
	daysStrings['zt']=new Array("&#19968;","&#20108;","&#19977;","&#22235;","&#20116;","&#20845;","&#26085;"); // chinois trad

	var calendardisplayed=false;

	var calendar = {
		monthArr: new Array("Janv","Fev","Mars","Avril","Mai","Juin","Juil","Aout","Sept","Oct","Nov","Dec"),
		dayArr: new Array("Lu","Ma","Me","Je","Ve","Sa","Di"),
		initialised:null,
		selectDay:null,
		selectMonthYear:null,
		minMonth:null,minYear:null,
		maxMonth:null,maxYear:null,
		date:Date,
		tmpDate:Date,
		actualDate:Date,
		popupcontainer:null,
		popupprev:null,
		popupnext:null,
		popuptitle:null,
		popupbody:null,
		show:function(obj,e) {
			if (!obj) return;
			calendar.init(obj);
			calendar.popupcontainer.style.display="block";
			if (e) {
				calendar.getMouse(e);
				with(calendar.popupcontainer.style) {
					left = (window.mouseX-calendar.popupcontainer.offsetWidth)+"px";
					top = window.mouseY+10+"px";
				}
			}
			ifrlayer.make(calendar.popupcontainer);
			ifrlayer.move(calendar.popupcontainer);
			calendardisplayed=true;
		},
		hide:function() {
			calendardisplayed=false;
			calendar.popupcontainer.style.display="none";
			ifrlayer.kill(calendar.popupcontainer);
		},
		init:function(obj) {
			calendar.initialised=true;
			calendar.monthArr = monthsStrings[malangue];
			calendar.dayArr = daysStrings[malangue];
			for(var i=0;i<calendar.dayArr.length;i++){
				document.getElementById('day'+i).innerHTML=calendar.dayArr[i];
			}
			calendar.actualDate = (window.actualDate) ? window.actualDate : new Date();
			var a,i,opt,minval,maxval,x,div;
			while(obj && obj.getElementsByTagName("select").length==0) obj = obj.parentNode;
			calendar.popupcontainer = document.getElementById("calendar");
			if (!calendar.popupcontainer) return;
			if (!obj) return;
			var sel = obj.getElementsByTagName("select");

			if (sel.length<2) return;
			if (malangue == 'jp' || malangue == 'kn') {
				calendar.selectDay = sel[1];
				calendar.selectMonthYear = sel[0];
			} else {
				calendar.selectDay = sel[0];
				calendar.selectMonthYear = sel[1];
			}
			calendar.selectMonthYear.onclick = calendar.selectDay.onclick = function() { calendar.hide()}
			opt = calendar.selectMonthYear.getElementsByTagName("option");

			maxval = opt[opt.length-1].value;
			calendar.maxMonth = maxval.split("-")[0]-1;
			calendar.maxYear = maxval.split("-")[1];
			minval = opt[0].value;
			calendar.minMonth = minval.split("-")[0]-1;
			calendar.minYear = minval.split("-")[1];

			x=calendar.popupcontainer;
			div = x.getElementsByTagName("div");
			for (i=0; i<div.length; i++) {
				switch(div[i].className.toLowerCase()) {
					case "entete" :
						a=div[i].getElementsByTagName("a");
						for (var j=0; j<a.length; j++) {
							switch(a[j].className.toLowerCase()) {
								case "arrow-prev" :
									calendar.popupprev = a[j];
									calendar.popupprev.onclick = function() {
										calendar.goMonth(-1);
										return false;
									}
									break;
								case "arrow-next" :
									calendar.popupnext = a[j];
									calendar.popupnext.onclick = function () {
										calendar.goMonth(1);
										return false;
									}
									break;
								case "title" :
									calendar.popuptitle = a[j];
									calendar.popuptitle.onclick= function() {
										return false;
									}
									break;
							}
						}
						break;
					case "corps" :
						calendar.popupbody = div[i].getElementsByTagName("tbody")[0];
						break;
				}
			}

			// ajout gestion des valeurs par dfaut non conformes au format attendu
			var day,my;
			if(calendar.selectDay.options[calendar.selectDay.selectedIndex].value!='0') {
				day = calendar.selectDay.options[calendar.selectDay.selectedIndex].value;
				day = (parseInt(day)<10) ?"0"+day : day;
			}
			else{
				day = today.getDate();
			}

			if(calendar.selectMonthYear.options[calendar.selectMonthYear.selectedIndex].value!='0'){
				my = calendar.selectMonthYear.options[calendar.selectMonthYear.selectedIndex].value;
				calendar.date = new Date(my.split("-")[0]+ "/" + day + "/" + my.split("-")[1]); // MM/DD/YYYY
			}
			else{
				calendar.date = new Date((today.getMonth()+1)+'/'+day+'/'+today.getFullYear());
			}
			calendar.tmpDate = new Date(calendar.date.getTime());

			calendar.generateDates();

		},
		goMonth:function(incr) {
			calendar.tmpDate.setMonth(calendar.tmpDate.getMonth()+incr);
			var d = new Date(calendar.tmpDate.getTime());
			d.setDate(1);
			var max = new Date(calendar.maxMonth+1+"/01/"+calendar.maxYear);
			var min = new Date(calendar.minMonth+1+"/01/"+calendar.minYear);

			if (d.getTime()>max.getTime()) calendar.tmpDate.setMonth(calendar.tmpDate.getMonth()-1);
			if (d.getTime()<min.getTime()) calendar.tmpDate.setMonth(calendar.tmpDate.getMonth()+1);
			calendar.generateDates();
		},
		generateDates:function() {
			x = calendar.popupbody;
			while(x.childNodes.length>0) x.removeChild(x.childNodes[0]);
			var d=new Date(calendar.tmpDate.getTime());
			d.setDate(1);
			var month = d.getMonth();

			var firstdaypassed = false;
			while(d.getMonth()==month) {
				var tr = calendar.popupbody.appendChild(document.createElement("tr"));
				for (var i=0; i<7; i++) {
					var td = tr.appendChild(document.createElement("td"));
					if (i==(d.getDay()-1>=0 ? d.getDay()-1 : 6)) firstdaypassed=true;
					if (firstdaypassed){
						if (d.getMonth()==month) {
							td.innerHTML = d.getDate();
							var classTd = (d.getTime()<calendar.actualDate.getTime()) ? "past" : "";
							td.className = classTd;
							if (d.getTime()==calendar.actualDate.getTime()) td.className="present";
							d.setDate(d.getDate()+1);
						}
						if(classTd != 'past'){
							td.onclick = function() {
							calendar.tmpDate.setDate(parseInt(this.innerHTML));
							calendar.selectDay.selectedIndex = calendar.tmpDate.getDate();
							var opt = calendar.selectMonthYear.getElementsByTagName("option")
							for (var i=0; i<opt.length; i++) {
								var strMonth = (calendar.tmpDate.getMonth()<9) ? "0" : "";
								opt[i].selected = (opt[i].value == strMonth+(calendar.tmpDate.getMonth()+1) +"-"+ calendar.tmpDate.getFullYear()) ? "selected" : "";
							}
							calendar.hide();
						}
						}
						
					}
				}
			}
			//calendar.popuptitle.innerHTML = calendar.monthArr[calendar.tmpDate.getMonth()] + " " + calendar.tmpDate.getFullYear();
			calendar.popuptitle.innerHTML = calendar.monthArr[calendar.tmpDate.getMonth()] + " " + calendar.tmpDate.getFullYear();
		},
		/*Generics Methods*/
		getMouse:function(e){
			var x,y; var elt = (navigator.userAgent.indexOf("MSIE 5")!=-1) ? document.getElementsByTagName("body")[0] : document.documentElement;
			if ( document.captureEvents ) {
				x = e.pageX;
				y = e.pageY;
			} else if ( window.event.clientX ) {
				x = window.event.clientX+elt.scrollLeft;
				y = window.event.clientY+elt.scrollTop;
			}
			window.mouseX = x;
			window.mouseY = y;
		}
	 }
}

function open_flashHover() {
	var oldflash = document.getElementById('nav_banner').parentNode;
	oldflash.style.zIndex = 10000;
	var newFlash = document.getElementById('nav_banner_hover');
	if(newFlash) {newFlash.style.visibility = 'visible';}
}
function close_flashHover() {
	var oldflash = document.getElementById('nav_banner').parentNode;
	oldflash.style.zIndex = "";
	var newFlash = document.getElementById('nav_banner_hover');
	if(newFlash) newFlash.style.visibility = "hidden";
}

function openInsidePopupArchiv(popupId) {
	if (typeof(window['ouverture']) != "undefined") {
		// Fermeture d'une popup deja ouverte
		if (ouverture != false) {
			closeInsidePopup(ouverture);
		}
		// Enregistrement du nom de la popup ouverte
		ouverture = popupId;
	}
	var pop = document.getElementById(popupId || "insidePopup");
	pop.style.display="block";
	pop.style.position="absolute";
	with(pop.style) {
		top = "500px";
		left = "500px";
		marginLeft = -(pop.offsetWidth/2)+"px";
		marginTop = -(pop.offsetHeight/2)+"px";
	}
}

function $(str) {
	return (typeof str == "string") ? document.getElementById(str) : str;
}



/**********
* $n : objet de parcours du DOM, facile. Les fonctions ne font que les nodes HTML
***********/
var $n = {
	/* 	hasAttributes : retourne true si l'element passe en parametre correspond a tous les attributs passes, on peut aussi donner des attributs que l'on ne veut pas, afin de filtrer tous les &eacute;lements
		ex : if (hasAttributes(div, {nodeName:"div", className:"foobar"), {className:"idontwant"} ) doStuff();
		ici on recherche tous les DIV qui on la classe "foobar", mais on ne prend pas ceux qui ont la classe "idontwant" ex : <div class="foobar idontwant"> ne sera pas recupere.
	*/
	hasAttr : function(n, a, not) {
		var re, at;
		if (n.nodeType!=1) return false;
		function check(attr) {
			for (var i in attr) {
				at = (typeof n[i]) !="undefined" ? n[i] : n.getAttribute(i);
				re = attr[i] instanceof RegExp ? re : new RegExp("\\b" + attr[i] + "\\b","i");
				if (!at || !re.test(at)) 
					return false;
			}
			return true;
		};
		if (not && check(not))	return false;
		if (check(a)) return true;
		return false;
	},
	/* getByTagName : equivalent a element.getElementsByTagName, mais compatible avec IE5 et IE5.5 pour l'histoire du "*" */
	getByTagName : function(n, tag) {
		return  (tag=="*") ? (n.all ? n.all : n.getElementsByTagName("*")) : n.getElementsByTagName(tag);
	},
	/* fonction qui retourne le premier element correspondant aux attributs donnes */
	node : function(n, a, not) {
		return $n.nodes(n, a, not, true);
	},
	/* fonction qui retourne tous les elements correspondant selon "a" */
	nodes : function(n, a, not, oneNode, arrElms) {
		var aRetElms=[];
		if (!a) a = {};
		if (typeof a == "string") a = {nodeName:a}; //si une chaine de caract&egrave;res pass&eacute;e en param&egrave;tre, cela signifie qu'on ne veut que r&eacute;cup&eacute;rer des tags
		if (a.nodeName && a.nodeName=="*") delete a.nodeName;
		var elms = arrElms || $n.getByTagName(n, (a.nodeName || "*"));
		for (var i=0; i<elms.length; i++) {
			var x = elms[i];
			if ($n.hasAttr(x, a, not)) {
				if (oneNode) return x;
				else aRetElms.push(x);
			}
		}
		if (oneNode) return null;
		return aRetElms;
	},
	/* childs : retourne tous les noeuds enfants de l'element  */
	childs : function(n, a, not) {
		return $n.nodes(n, a, not, false, n.childNodes);
	},
	firstChild : function(n, a, not) {
		return $n.nodes(n, a, not, true, n.childNodes);
	},
	lastChild : function(n, a, not) {
		var node = $n.nodes(n, a, not, false, n.childNodes);
		return node[node.length-1];
	},
	move : function(n, a, not, action) {
		n = n[action];
		while (n) {
			if ($n.hasAttr(n, a, not)){
				return n;
			}
			n = n[action];
		}
		return null;
	},
	after : function(n, a, not) { 
		return $n.move(n, a, not, "nextSibling");
	},
	before : function(n, a, not) {
		return $n.move(n, a, not, "previousSibling");
	},
	parent : function(n, a, not) {
		return $n.move(n, a, not, "parentNode");
	}
}
/* fonctions raccourcis */
var getNode = $n.node,
	getNodes = $n.nodes,
	getChildNodes = $n.childs,
	getNextSibling = $n.after,
	getPreviousSibling = $n.before,
	getParent = $n.parent,
	hasAttributes = $n.hasAttr,
	getElementsByTagName = $n.getByTagName;

	
/* show hide extended */
function showHideEx (self,obj1,to,obj2) {
	/*
	self : l'objet lancant la fonction (ex : a)
	obj1 : objet {attribut:'valeur'} a matcher
	to : before | after | inside
	obj2 : objet {attribut:'valeur'} a matcher
	
	possibilite pour les objets (exemples - toto est une variable):
		{className:'toto'} recherche un element en se basant sur sa class, elle devra contenir toto pour etre trouvee;
		{id:'toto'} recherche un element en se basant sur son id, elle devra contenir toto pour etre trouvee;
		{nodeName:'div'} recherche un element en se basant sur le nom de son tag (ex: div);
		et tout autre attribut pouvant etre mis dans une balise.
	*/
	
	var parent = getParent(self,obj1);
	var obj = null;
	switch(to){
		case 'before':
			//console.log(0);
			obj = getPreviousSibling(parent);
			break;
		case 'after':
			obj = getNextSibling(parent);
			//console.log(1,obj,getNextSibling(parent),parent,parent.nextSibling);
			break;
		case 'inside':
			//console.log(2);
			obj = getNode(parent,obj2);
			break;
	}
	if (obj.style.display==""){
		var display = getStyle(obj, 'display');
		obj.style.display = (display == 'none')?'block':'none';
	}else{
		obj.style.display = (obj.style.display == 'none') ? 'block':'none';
	}
	fixColumns();
}
