
function ChoisirGreta() {
   document.location.href = 'http://' + document.forme.site.value;
   }
   
function ChoisirGretaOrganisation() {
   document.location.href = 'http://' + document.organisation_site.site.value;
   }   
   
function RechercherFormationsZF() {   
   if (document.forme.id_zone.value == -1 && document.forme.id_filiere.value == -1) 
       alert("Attention : Vous devez saisir au moins une zone ou un domaine");
    else {
      url  = '/public/formations/requete_zf.php?';
      url += 'id_structure=' + document.forme.id_structure.value;
      url += '&id_zone=' + document.forme.id_zone.value;
      url += '&id_filiere=' + document.forme.id_filiere.value;
 
      document.location.href = url;
      }
   }
   
function RechercherFormationsMC() { 
   url  = '/public/formations/requete_mc.php?';
   url += 'id_structure=' + document.forme.id_structure.value;
   url += '&id_zone=' + document.forme.id_zone.value;
   url += '&id_filiere=' + document.forme.id_filiere.value;
   url += '&saisie=' + document.forme.saisie.value;
   document.location.href = url;
   }   
   
function RafraichirZonesFilieres() {    
   if (document.forme.id_zone.value != '-1' && document.forme.id_filiere.value != '-1') {
      url  = '/public/formations/requete_zf.php?';
      url += 'id_structure=' + document.forme.id_structure.value;
      url += '&id_zone=' + document.forme.id_zone.value;
      url += '&id_filiere=' + document.forme.id_filiere.value;     
      document.location.href = url;
      }
   else {
      url  = document.forme.url_document.value;
      url += '?id_structure=' + document.forme.id_structure.value;
      url += '&id_zone=' + document.forme.id_zone.value;
      url += '&id_filiere=' + document.forme.id_filiere.value;      
      document.location.href = url;
      }
   }

function RafraichirZonesFilieresFormations() {    
   if (document.formation.id_zone.value != '-1' && document.formation.id_filiere.value != '-1') {
      url  = '/public/formations/requete_zf.php?';
      url += 'id_structure=' + document.formation.id_structure.value;
      url += '&id_zone=' + document.formation.id_zone.value;
      url += '&id_filiere=' + document.formation.id_filiere.value;     
      document.location.href = url;
      }
   else {
      url  = document.formation.url_document.value;
      url += '?id_structure=' + document.formation.id_structure.value;
      url += '&id_zone=' + document.formation.id_zone.value;
      url += '&id_filiere=' + document.formation.id_filiere.value;      
      document.location.href = url;
      }
   }
   
 


function urlencode( str ) {
      var ret = str; 
      ret = ret.toString();
      ret = encodeURIComponent(ret);
      ret = ret.replace(/%20/g, '+');
      ret = ret.replace('\'', '+');
      return ret;
      }

   
   
   