function jg() { /* Fonction antibug */ }
function jg_popicker(c,l) {
	window.open('picker.php?c='+c+'&l='+l, 'cp', 'resizable=no, location=no, width=400, height=270, menubar=no, status=yes, scrollbars=no, menubar=no');
}
function ap(id, nb, style, value) {
	for(i=1; i<=nb; i++) {
		var testid = id+i; valueSave=value;
		if((testid=="a3" && style=="fontWeight") || (testid=="a8" && style=="fontWeight") || (testid=="a13" && style=="fontWeight") || (testid=="a16" && style=="fontWeight")) { value="bold"; }
		var action = "parent.frames['ap'].window.document.getElementById('"+id+i+"').style."+style+"='"+value+"'";
		eval(action); value=valueSave;
	}
}
function apU(id, style, value) {
	var action = "parent.frames['ap'].window.document.getElementById('"+id+"').style."+style+"='"+value+"'";
	eval(action);
}
function apS(id, nb, style, check, value1, value2) {
	if(check===false) { ap(id, nb, style, value2) }
	else { ap(id, nb, style, value1) }
}
function apA(id, style) {
	parent.frames['ap'].window.document.getElementById(id).value=style;
}
function apAS(id, check, value1, value2) {
	if(check===false) { apA(id, value2) }
	else { apA(id, value1) }
}
function apSOULI(id, id2, nb, style) {
	frameap = parent.frames['ap'].window.document;
	switch(frameap.getElementById('a'+id2+'Souligne').value) {
		case '0' :
			for(i=1; i<=nb; i++) {
				var lien = frameap.getElementById(id+i);
				lien.style.textDecoration="none";
				lien.style.borderBottom="0px none #000";
			} break;
		case '1' :
			for(i=1; i<=nb; i++) {
				var lien = frameap.getElementById(id+i);
				lien.style.textDecoration="underline";
				lien.style.borderBottom="0px none #000";
			} break;
		default :
			for(i=1; i<=nb; i++) {
				var lien = frameap.getElementById(id+i);
				lien.style.textDecoration="none";
				lien.style.borderBottom="1px "+frameap.getElementById('a'+id2+'Souligne').value+" "+frameap.getElementById('a'+id2+'ColorSouligne').value;
			} break;
	}
}
var hexa = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
function generate(hexacolor, r,v,b, id) {
	var rvb = new Array(r,r,v,v,b,b);
	var curseur = 0;
	var hexacolor2 = "";
	for(g=0; g<6; g++) {
		for(i=0; i<=15; i++) {
			if(hexacolor.substring(curseur, curseur+1) == hexa[i]) {
				var nrvb = eval(i+rvb[g]);
				if(nrvb < 0) { hexacolor2 += '0'; }
				else if(nrvb > 15) { hexacolor2 += 'F'; }
				else { hexacolor2 += hexa[nrvb]; }
				curseur++; break;
			}
		}
	}
	if(id!='new'&&id!='nonew') {
		eval("document.jg_form."+id+".value='"+hexacolor2+"'; document.jg_form."+id+".onchange();");
		document.getElementById('a_'+id).style.backgroundColor=hexacolor2;
	} else { return hexacolor2; }
}
function generateall(color,s,rand) {
	color = (rand==1) ? hexa[Math.floor(Math.random()*15)+1]+hexa[Math.floor(Math.random()*15)+1]+hexa[Math.floor(Math.random()*15)+1]+hexa[Math.floor(Math.random()*15)+1]+hexa[Math.floor(Math.random()*15)+1]+hexa[Math.floor(Math.random()*15)+1] : color.toUpperCase();
	if(s==0) { var p="+"; var m="-"; } else { var p="-"; var m="+";}
	generate(color, p+'0',p+'0',p+'0', "color_dominante");
	generate(color, p+'4',p+'4',p+'4', "color_fond");
	generate(color, m+'5',m+'5',m+'5', "color_structure");
	generate(color, m+'2',m+'2',m+'2', "color_2ndbande");
	generate(color, m+'1',m+'1',m+'1', "color_bandeV");
	generate(color, m+'3',m+'3',m+'3', "color_border");
	generate(color, m+'7',m+'7',m+'7', "color_txt");
	generate(color, p+'7',p+'7',p+'7', "color_titres");
	generate(color, m+'8',m+'8',m+'8', "color_link");
	generate(color, m+'5',m+'5',m+'5', "color_underlink");
	generate(color, m+'1',m+'1',m+'1', "bgcolor_link");
	generate(color, m+'4',m+'4',m+'4', "color_hoverlink");
	generate(color, p+'5',p+'5',p+'5', "color_underhoverlink");
	generate(color, p+'1',p+'1',p+'1', "bgcolor_hoverlink");
	generate(color, p+'7',p+'7',p+'7', "color_linkMenu");
	generate(color, p+'7',p+'7',p+'7', "color_underlinkMenu");
	generate(color, m+'4',m+'4',m+'4', "bgcolor_linkMenu");
	generate(color, p+'5',p+'5',p+'5', "color_hoverlinkMenu");
	generate(color, p+'5',p+'5',p+'5', "color_underhoverlinkMenu");
	generate(color, m+'3',m+'3',m+'3', "bgcolor_hoverlinkMenu");
	generate(color, m+'3',m+'3',m+'3', "color_new");
	generate(color, p+'1',p+'1',p+'1', "color_nonew");
	document.getElementById("ssurl1").checked="checked";
	document.getElementById("ssurl1").onclick();
	document.getElementById("ssurl2").checked="checked";
	document.getElementById("ssurl2").onclick();
	document.getElementById("ssurl3").checked="checked";
	document.getElementById("ssurl3").onclick();
	document.getElementById("ssurl4").checked="checked";
	document.getElementById("ssurl4").onclick();
}
function resyncronisation() {
	document.jg_form.color_dominante.onchange();
	document.jg_form.color_structure.onchange();
	document.jg_form.color_fond.onchange();
	document.jg_form.color_2ndbande.onchange();
	document.jg_form.color_bandeV.onchange();
	document.jg_form.color_border.onchange();
	document.jg_form.color_txt.onchange();
	document.jg_form.color_new.onchange();
	document.jg_form.color_nonew.onchange();
	document.jg_form.color_titres.onchange();
	document.jg_form.bold_titres.onclick();
	document.jg_form.italic_titres.onclick();
	document.jg_form.color_link.onchange();
	document.jg_form.bold_link.onclick();
	document.jg_form.italic_link.onclick();
	document.jg_form.under_link.onclick();
	document.jg_form.color_underlink.onchange();
	document.jg_form.bgcolor_link.onchange();
	document.jg_form.color_hoverlink.onchange();
	document.jg_form.bold_hoverlink.onclick();
	document.jg_form.italic_hoverlink.onclick();
	document.jg_form.under_hoverlink.onclick();
	document.jg_form.color_underhoverlink.onchange();
	document.jg_form.bgcolor_hoverlink.onchange();
	document.jg_form.color_linkMenu.onchange();
	document.jg_form.bold_linkMenu.onclick();
	document.jg_form.italic_linkMenu.onclick();
	document.jg_form.under_linkMenu.onclick();
	document.jg_form.color_underlinkMenu.onchange();
	document.jg_form.bgcolor_linkMenu.onchange();
	document.jg_form.color_hoverlinkMenu.onchange();
	document.jg_form.bold_hoverlinkMenu.onclick();
	document.jg_form.italic_hoverlinkMenu.onclick();
	document.jg_form.under_hoverlinkMenu.onclick();
	document.jg_form.color_underhoverlinkMenu.onchange();
	document.jg_form.bgcolor_hoverlinkMenu.onchange();
	document.getElementById("ssurl1").checked="checked";
	document.getElementById("ssurl1").onclick();
	document.getElementById("ssurl2").checked="checked";
	document.getElementById("ssurl2").onclick();
	document.getElementById("ssurl3").checked="checked";
	document.getElementById("ssurl3").onclick();
	document.getElementById("ssurl4").checked="checked";
	document.getElementById("ssurl4").onclick();
}
function rgbch(nom,mode) {
	var chem = "document.jg_form."+nom+".value";
	var change = "document.jg_form."+nom+".onchange()";
	switch(mode) {
		case "r+":
			generate(eval(chem), '+1','+0','+0', nom); eval(change); break;
		case "r-":
			generate(eval(chem), '-1','+0','+0', nom); eval(change); break;
		case "g+":
			generate(eval(chem), '+0','+1','+0', nom); eval(change); break;
		case "g-":
			generate(eval(chem), '+0','-1','+0', nom); eval(change); break;
		case "b+":
			generate(eval(chem), '+0','+0','+1', nom); eval(change); break;
		case "b-":
			generate(eval(chem), '+0','+0','-1', nom); eval(change); break;
	}
}


/***** LE CODE CI-DESSOUS EST LA PROPRIETE EXCLUSIVE DE TOUTJAVASCRIPT.COM *****/
var tjs_delai=20;
var tjs_max=20;
//var tjs_mode=1;
var tjs_hauteur=0;
function PrintCalque(left,top,width,height,contenu) {
	tjs_hauteur=height;
	if ((document.all)||(document.getElementById)) {
		var Z="<div id='tomber' style='position:absolute;left:"+left+";top:"+top+";width:"+width+";height:"+height+"'>"+contenu+"</div>";
	} else {
		var Z="<layer name='tomber' left="+left+" top="+top+" width="+width+" height="+height+">"+contenu+"</layer>";
	}
	document.write(Z);
	setTimeout("Start()",tjs_delai);
}
function Start() {
	MoveLayer("tomber",GetTop("tomber"));
	setTimeout("Start()",tjs_delai);
}
function Debug() {
	var obj=document.body;
	var Z="";
	for (var i in obj) {
		Z+=i+"="+obj[i]+"\n";
	}
	alert(Z);
}
function MoveLayer(nom,top) {
	if (document.getElementById) { //IE5 et NS6
		document.getElementById(nom).style.top=top;
	}
	if ((document.all)&&(!document.getElementById)) { //IE4 seul
		document.all[nom].style.top=top;
	}
	if (document.layers) { //NS4.X seul
		document.layers[nom].top=top;
	}
}
function GetTop(nom) {
	if (document.getElementById) { //IE5 
		var pos=parseInt(document.getElementById(nom).style.top);
		var wintop=parseInt(document.body.scrollTop);
		var avail=document.body.clientHeight;
	}
	if ((document.getElementById)&&(!document.all)) { //NS6
		var pos=parseInt(document.getElementById(nom).style.top);
		var wintop=parseInt(window.pageYOffset);
		var avail=window.innerHeight;
	}
	if ((document.all)&&(!document.getElementById)) { //IE4 seul
		var pos=parseInt(document.all[nom].style.top);
		var wintop=parseInt(document.body.scrollTop);
		var avail=document.body.clientHeight;
	}
	if (document.layers) { //NS4.X seul
		var pos=parseInt(document.layers[nom].top);
		var wintop=parseInt(window.pageYOffset);
		var avail=window.innerHeight;
	}
	if (tjs_mode==0) {
		var delta=Math.ceil((pos-wintop)/3);
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var top=pos-delta;
	}
	if (tjs_mode==1) {
		var delta=Math.ceil((pos-(wintop+avail-tjs_hauteur)));
		if (delta>tjs_max) {delta=tjs_max;}
		if (delta<-1*tjs_max) {delta=-1*tjs_max;}
		var top=pos-delta;
	}
	return top;
}
