 function admin_valide_form_home() {
	d = document.forms[0];
	d.submit();
}

//////////////////////////
function admin_inserer_rub(id_espace, id_pere) {
var lg=500;
var ht=250;
var left=(screen.width-lg)/2;
var top=(screen.height-ht)/2; 
ch2 = "inserer_rub.asp?id_espace=" + id_espace + "&id_pere=" + id_pere ;
window.open(ch2,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}

//////////////////////////
function admin_valide_form_inserer() {
	d = document.forms[0];
	if (d.nom_rub.value=="") alert("Veuillez saisir le nom de la rubrique");
	else {
		d.ACT.value = "ok";
		d.submit();
		}
}

///////////////////////
function admin_del_rub(id_espace, id_rub) {
	if (confirm("Etes-vous sûr(e) ?")) {
		document.location="mod_arbo.asp?ACT=sup&id_espace=" + id_espace + "&id_rub=" + id_rub ;
	}
}
///////////////////////
function admin_mod_rub(id_espace, id_rub) {
var lg=500;
var ht=250;
var left=(screen.width-lg)/2;
var top=(screen.height-ht)/2; 
ch2 = "mod_rub.asp?id_espace=" + id_espace + "&id_rub=" + id_rub ;
window.open(ch2,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}

////////////////////
function sup_page(id_page) {
	if (confirm("Etes-vous sûr(e) ?")) {
		document.location="liste_pages.asp?ACT=sup&id_page=" + id_page ;
	}
}

///////////////////////////
function admin_verif_mod_page() {
	d = document.forms[0];
	if (d.titre_ref.value=="") alert("Veuillez saisir le nom de référence");
	else {
		if (d.ACT.value=="aj") d.ACT.value="insert"; else d.ACT.value = "update";
		d.submit();
		}
}


///////////////////////
function ouvre_news(id_news) {
var lg=500;
var ht=300;
var left=(screen.width-lg)/2;
var top=(screen.height-ht)/2; 
ch2 = "detail_news.asp?id_news=" + id_news ;
window.open(ch2,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}

///////////////////////
function ouvre_detail_pave(id_pave_droite) {
var lg=500;
var ht=300;
var left=(screen.width-lg)/2;
var top=(screen.height-ht)/2; 
ch2 = "ouvre_detail_pave.asp?id_pave_droite=" + id_pave_droite ;
window.open(ch2,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}

///////////////////////
function ouvre_imple(id_pave_ville) {
var lg=500;
var ht=400;
var left=(screen.width-lg)/2;
var top=(screen.height-ht)/2; 
ch2 = "ouvre_detail_pave_imple.asp?id_pave_ville=" + id_pave_ville ;
window.open(ch2,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}


///////////////////////////
function allumer(id) {
	ch = "l" + String(id);
	obj = document.getElementById(ch) ;
	obj.className = "petitbleupassoul";

	obj = document.getElementById(id) ;
	obj.style.background="#e4edf6";

	txt = document.forms[0].rubs.value;
	tb = txt.split(",");
	for (i=0;i<tb.length;i++) {
		obj = document.getElementById(tb[i]) ;
		ch = "l" + String(tb[i]);
		obj2 = document.getElementById(ch) ;
		if (tb[i] != id) {
			obj.style.background="#153b63";
			obj2.className = "petitblanc";
			}
	}
}
////////////
function montrer_imple(id_ville) {
	obj = document.getElementById("contenu");
	ch = eval("document.forms[0].html" + String(id_ville)); 
	
	//obj2 = document.getElementById(ch);
	//obj.innerHTML = obj2.value ;
	obj.innerHTML = ch.value ;
}

////////////////////////
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

////////////////////
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

///////////// 
function raz_calks(id) {
	txt = document.forms[0].rubs.value;
	tb = txt.split(",");
	for (i=0;i<tb.length;i++) {
		if (tb[i] != id) {
			ch = "layer" + String(tb[i]);
			MM_showHideLayers(ch,'','hide','mode','','hide');
			}
		}		 
}

function inverse(obj) {
	obj.style.background = "#2269b5" ;
}

function retablir(obj) {
	obj.style.background = "" ;
}

