//_____________________________________________________
/** Fichier geoStat.js
 *
 * Ce fichier est destiner à être inclut dans les pages
 * qui doivent être statistiquées. Le fichier fait
 * appel à un fichier php notify.php qui va se charger
 * d'enregistrer les information du client dans les bd
 * correspondante au information recueillie.
 *
 * Première visite du fichier geoStat.js:
 *    |- Envoie d'une demande d'enregistrement des information
 *       relier au client
 * 
 * Deuxième visite du fichier goeStat.js:
 *    |- Enregistrement du temp que le client a passé sur
 *       la page
 *
 * @author Analyse : Pierre Voisin, Alexandre Leclerc
 * @author: OGL
 *
 * TRANSITSOFT copyright
 */
 //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
 
  var idGeoStatClient = null;
  
  geoStatsEvents();
 
  //____________________________________________________
  /**
  * Embranchement principale de geoStats.
  * @author OGL
  */
  //ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
  function geoStatsEvents(){
   try{
   
     if(idGeoStatClient == null){
       /*Envoie de la demande d'enregistrement des informaitons du client*/
  	   cdAJAX.get({
  	     url: "http://geostats.transitsoft.ca/notify.php?event=load&localisation=" + location.href,
  	     onSuccess : function(obj) { obj.responseText;}
       });
       
     }else if(idGeoStatClient){
       if(idGeoStatClient != "-666"){
         cdAJAX.get({
    	     url: "http://geostats.transitsoft.ca/notify.php?event=unload&id="+idGeoStatClient
         });
       }
     }
     //onSuccess : function(obj) { obj.responseText;}
   }catch (e)
   
   {
   	}
  }
