//var Base="http://www.arcalpin.com/temp/spm-mairie/";
//var Base="http://olivier/maurienne-fr/www/";
//var Base="http://yannick/atlasenergie/";
var Base="http://www.maurienne.fr/";


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
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_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 Ouvre(url){
	window.open(url,'Aide','height=600,width=780,scrollbars=yes')
}

function ClickSurCase(obj) {
 var taille = obj.all.length;
 var i;
 for(i=0;i<taille;i++) {
  if (obj.all[i].tagName.toUpperCase()=="A") top.location.href = obj.all[i].href;
 } 
}

var CouleurCellule;			// nécessaire
var CouleurFondMenu='#E0ECB2';
var CouleurFondMenuOver='#E0ECB2';
var CouleurFondMenuSelect='#E0ECB2';
var ImageFondMenu=Base+"images/fond_menuselect.gif";


///
function ChangeColorOut(TT) {
	TT.style.backgroundColor=CouleurCellule;
}

function ChangeColorOver(TT) {
	CouleurCellule=TT.style.backgroundColor;
	TT.style.backgroundColor=CouleurFondMenuOver;
	TT.style.cursor='hand';
	
}
//////////////////////////////////////
///  Survol des actus 
//////////////////////////////

function ChangeColorBlocOut(TT) {
	TT.style.backgroundColor=CouleurCellule;
}

function ChangeColorBlocOver(TT) {
	CouleurCellule=TT.style.backgroundColor;
	TT.style.backgroundColor="#F54949";
	TT.style.cursor='hand';
	
}

function SelectionMenu(IdCell) {
var aa="";
	if(((IdCell!='')&&(IdCell!='TMenu'))&&(document.getElementById(IdCell))){
		document.getElementById(IdCell).style.backgroundImage="url("+ImageFondMenu+")";
		document.getElementById(IdCell).style.fontWeight='bold';
	}
}

function SelectionMenu2(IdCell) {
 if((IdCell!='')&&(document.getElementById(IdCell)!=null)){
  document.getElementById(IdCell).className="SelectMenu";
 }
}

function SelectionListe(NomChamp,Valeur) {
	if(document.getElementById(NomChamp)){
		var NomCombo=document.getElementById(NomChamp);
		for (i=0; i<NomCombo.length;i++){
			if(NomCombo[i].value==Valeur){				
				NomCombo.selectedIndex=i;			
			}
		}
	}	
}


function SelectionCheckbox(NomChamp,Valeur) {
	if(document.getElementById(NomChamp)){
		var NomCombo=document.getElementById(NomChamp);
			if(NomCombo.value==Valeur){				
				NomCombo.checked=true;			
			} else {
				NomCombo.checked=false;
			}
	}	
}


function ChangeColorCellule(IdCell,coul) {
if(IdCell!=''){
		document.getElementById(IdCell).style.backgroundColor=coul;	
	}
}

function ouvre(url) {
  window.open(url,'Detail','width=440,height=230,toolbar=no')
}
function ClickSurCase(obj) {
 var taille = obj.all.length;
 var i;
 for(i=0;i<taille;i++) {
  if (obj.all[i].tagName.toUpperCase()=="A") top.location.href = obj.all[i].href;
 } 
}
 
 
 function VoirImage(Img,txt){
	window.open(Base+"voirimage.asp?I="+Img+"&T="+txt,'Image','height=200,width=300,resizable=yes')
}

function ChangeRollOver(IdCell) {
	if(IdCell!=-1){
		document.getElementById("menu"+IdCell).src=eval("DQM_rollover_image"+IdCell);
	}
}

function MatthieuImage(IdCell) 
{
	var src = document.getElementById("menu"+IdCell).src;
	document.getElementById("menu"+IdCell).src = src.replace("menu","menu-roll");
}


/******************************
	Initialisation Combo
*******************************/

function SelectCombo(NomObj,valeur){
	// cette fonction permet de sélectionner un élément = valeur dans la liste déroulante NomObj
//	alert(NomObj+" "+valeur)
	var obj=document.getElementById(NomObj);
//	alert(obj)
	var aaa="";
	var IdIndex;
	for (i=0;i<obj.length;i++){
		if (valeur==obj.options[i].value){IdIndex=i;}
	}
	document.getElementById(NomObj).selectedIndex=IdIndex;
}


/****************************
	MACROMEDIA
*****************************/

function MM_jumpMenu(targ,selObj,restore,page){ //v3.0
  eval(targ+".location='"+page+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/****************************
	POPUP ATLAS ENERGIE
*****************************/


function FichesCarte(url){
	aa=window.open(url,'popup','height=600,width=550,scrollbars=yes')
	aa.focus();
}
