/*********************************************************
Fonctions de bases pour illicopage
**********************************************************/

/* Fonction d'ouverture d'un popup : evite le target */
popup_vide ='/popup_vide.htm';
function winOpen(url, largeur, hauteur){
      gauche = (screen.width/2)-(largeur/2);
      haut = (screen.height/2)-(hauteur/2);
      window.open(url,"popup","height="+hauteur+",width="+largeur+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = yes,fullscreen = no,top ="+haut+",left ="+gauche);
   }


/* Fonction de remplissage d'un div avec le contenu passé par programme */
function ChangeMessage(message,champ)
{
	var msg2 = message.replace(/\&gt\;/gi, ">");
	msg2 = msg2.replace(/\&lt\;/gi, "<");
  if(document.getElementById)
    document.getElementById(champ).innerHTML = msg2;
}

/* Fonction d'ouverture de la version imprimable*/
function printer_friendly()
{
	
	ret = window.open('/cgi-local/printer_friendly.pl?url='+url_printer, 'printer_friendly','width=800,height=600,scrollbars=1');
	
}

/* Fonction de passage à la version malvoyant */
function version_malvoyant()
{
	if( url_lien_malvoyant != "" )
		document.location=url_lien_malvoyant;
	
}

/* Fonction d'ajout du site aux favoris : Attention à l'adresse du site*/
function favoris() 
{
	if ( navigator.appName != 'Microsoft Internet Explorer' ){ 
		window.sidebar.addPanel("Rêves à l'horiZon","http://www.revesalhorizon.fr/",""); 
	}
	else { 
		window.external.AddFavorite("http://www.revesalhorizon.fr/","Rêves à l'horiZon"); 
	} 
}
/* Fonction de transformation de la page html en un fichier pdf */
function version_pdf()
{
    ret = window.open('/cgi-local/imprime-pdf.pl?url='+url_printer, 'printer_friendly','width=800,height=600,scrollbars=1');
    
}
/* fonction pour ouvrir un popup depuis flash */
function popup(lien, titre, largeur, hauteur, scrollb)
  {
	
  window.open(lien, titre, 'width=' + largeur + ', height=' + hauteur + ', scrollbars=' + scrollb);
  }


function info_commune(id, nom)
{
  popup("/cgi-local/detail_commune.pl?action=Donnees&ID="+id, "detail_commune","500px" , "500px" , "yes");  
}


/* Initialisation des parametres */

var prse_menu_lateral = 0;
var url_printer = "";
var url_lien_malvoyant = "";



