function ouvreFenetre(adresse,titre,options)
{
	window.open(adresse, titre, options );
}
function PlanVille(page) {
	window.open(page, 'Plan', 'top=25, left =50, resizable=yes, directories=no, location=no, width=750, height=550, menubar=no, status=yes, scrollbars=yes');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function AddToFavorite(){
	try{
		window.external.AddFavorite(window.location, "Mairie Neuville sur Saône");
	}catch(exc1){
		try{
			window.sidebar.addPanel("Mairie Neuville sur Saônes", window.location, "");
		}catch(exc2){
			alert("Afin d'ajouter cette page à vos favoris, appuyez sur les touches Ctrl + D de votre clavier");
		}
	}
}

function send_art() {
	// On récupère ici l'url de la page en cours 
	var url=escape('<%=Request.ServerVariables("SERVER_NAME")%>');
	// On récupère en javascript le nom de la page en cours
	var title=escape(document.title);
	// On appelle le fichier send_mail.asp se trouvant à la racine du site
	window.open("/send_mail.asp?url='"+url+"'&titre="+title,'','toolbar= no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,height=400,width=600');
}

function checkAllFields(ref) {
  var chkAll = document.getElementById('checkAll');
  var checks = document.getElementsByName('check[]');
  //var removeButton = document.getElementById('removeChecked');
  var boxLength = checks.length;
  var allChecked = false;
  var totalChecked = 0;
  if ( ref == 1 ) {
    if ( chkAll.checked == true ) {
      for ( i=0; i < boxLength; i++ ) {
        checks[i].checked = true;
      }
    }
    else {
      for ( i=0; i < boxLength; i++ ) {
        checks[i].checked = false;
      }
    }
  }
  else {
    for ( i=0; i < boxLength; i++ ) {
      if ( checks[i].checked == true ) {
        allChecked = true;
        continue;
      }
      else {
        allChecked = false;
        break;
      }
    }
    if ( allChecked == true ) {
      chkAll.checked = true;
    }
    else {
      chkAll.checked = false;
    }
  }
  for ( j=0; j < boxLength; j++ ) {
    if ( checks[j].checked == true ) {
      totalChecked++;
	}
  }
  //removeButton.value = "Suppr ["+totalChecked+"] ";
  document.frm.boxchecked.value=totalChecked;
}

