<!--
function ContainerTailleEcran(container,taille_page){
document.getElementById(container).style.left=(screen.width-taille_page)/2;
document.getElementById(container).style.visibility="visible";
}
function MasqueContainer(container){
//document.getElementById(container).style.visibility="hidden";
}
function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}
function CopyVal(type,val_copie,val_vers,separateur){
if (type=="select1"){
resultat="";
if(document.getElementById(val_vers).value!=''){
resultat=document.getElementById(val_vers).value+separateur;
}
resultat+=document.getElementById(val_copie).options[document.getElementById(val_copie).selectedIndex].text;
}
document.getElementById(val_vers).value=resultat;
}
function execAppli(app) 
{
    var wshShell = new ActiveXObject("WScript.Shell");
    wshShell.Run(app, 1, true);
}

function return_get(param){
var valeur="<?php echo $_GET['"+param+"']; ?>";
return valeur;
}

function return_post(param){
var valeur="<?php echo $_POST['"+param+"']; ?>";
return valeur;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function action_div(mode,element){

if (document.getElementById){
	if(document.getElementById(element).style.display == 'none') 
		document.getElementById(element).style.display = 'block'; 
	else 
		document.getElementById(element).style.display = 'none';
	}else if(document.all){
		if(document.all[element].style.display == 'none') 
			document.all[element].style.display = 'block'; 
		else 
			document.all[element].style.display = 'none';
	}else if(document.layers){
		if(document.layers[element].display == 'none') 
			document.layers[element].display = 'block'; 
		else 
			document.layers[element].display = 'none';
	}
}
function menuover(menu){
	if (document.getElementById){
		if(document.getElementById("ssmenu" + menu).style.display == 'none') 
			document.getElementById("ssmenu" + menu).style.display = 'block'; 
		else 
			document.getElementById("ssmenu" + menu).style.display = 'none';
	}else if(document.all){
		if(document.all["ssmenu" + menu].style.display == 'none') 
			document.all["ssmenu" + menu].style.display = 'block'; 
		else 
			document.all["ssmenu" + menu].style.display = 'none';
	}else if(document.layers){
		if(document.layers["ssmenu" + menu].display == 'none') 
			document.layers["ssmenu" + menu].display = 'block'; 
		else 
			document.layers["ssmenu" + menu].display = 'none';
	}
}


function filegetname(){
var name=document.getnamefile.file.value;
location.href="?namefile="+name;
} 

function ChangeUrl(formulaire){
	if (formulaire.listecat.selectedIndex != 0) { location.href = formulaire.listecat.options[formulaire.listecat.selectedIndex].value; }
	else { alert('Choisissez une catégorie.'); }
	}
	
function tst_checkbox(chk){
	if(document.getElementById(chk).checked == true) {
		 document.getElementById("chk_"+chk).value = "checked";
	} else {
		 document.getElementById("chk_"+chk).value = "nd";
	}
}
/* *****************************************************************************************************
*********************************************** JAVASCRIPT COMMANDE FLASH ******************************
********************************************************************************************************
*/
function is_charge(){ 
  var monswf = window.document.aniflash; 
  if(monswf.PercentLoaded()==100) {return true}; 
  return false; 
}
// passe une variable à l'animation puis commence en 1 
function play_flash(){
//if(is_charge(animation)){  
//  var monswf = window.document.rubriques; 
//    fichier_xml=xml/amenagement.xml
//	monswf.SetVariable("123aze",variable);
//	monswf.GotoFrame(1); 
//}
//return true;
}
function soumettre(){
document.recalculer.submit();
}
// SELECTEUR DE COULEURS
function Hexa(Dec){
	var nb = Dec.toString(16)
	if (nb.length < 2) {nb = "0" + nb}
	return(nb)
}
function GradientPart(dr, dg, db, fr, fg, fb, Step,Champ_encours) {			
	cr=dr;cg=dg;cb=db
	//	Calcul du pas par couleur
	sr=((fr-dr)/Step)	// rouge
	sg=((fg-dg)/Step)	// vert
	sb=((fb-db)/Step)	// bleu
	var Result = ''
    for (var x = 0; x <= Step; x++) {
		var cmd = " onclick=\"document.getElementById('"+Champ_encours+"').value=this.bgColor;document.getElementById('menu_selecteur').style.visibility='hidden';document.getElementById('ColorShow').style.visibility='hidden';\" onmouseover=\"ColorShow.style.backgroundColor=this.bgColor;\""
		Result += "<TD CLASS=ColorCell BGCOLOR=#" + Hexa(Math.floor(cr)) + Hexa(Math.floor(cg)) + Hexa(Math.floor(cb)) + cmd + "></TD>"	
		cr += sr; cg += sg; cb += sb
		}
	return(Result)
}
function WriteRow(a,i,Champ_encours){
	document.write("<TR>")
	document.write(GradientPart(a,i,i, a,a,i, StepH,Champ_encours))
	document.write(GradientPart(a,a,i ,i,a,i, StepH,Champ_encours))
	document.write(GradientPart(i,a,i, i,a,a, StepH,Champ_encours))
	document.write(GradientPart(i,a,a, i,i,a, StepH,Champ_encours))
	document.write(GradientPart(i,i,a, a,i,a, StepH,Champ_encours))
	document.write(GradientPart(a,i,a, a,i,i, StepH,Champ_encours))
	document.write("</TR>")
}

