   // client in uso
   var NN6=false;
   var IE=false;
   var evt = "";
   var client ="";
   
// Chiama la funzione init() per inizializzare il tipo di browser
 if (document.all){
   document.onLoad = init(evt);        
 }
 else if (document.getElementById){  
    document.captureEvents(Event.LOAD)   
    document.onLoad = init(Event);
 }
 

 
 /**
  Rileva il browser in uso nel client (1)
  @author Alessandro Pani
  @version 1.0
  @see browser_detector
 */ 
function init(e){
  if ((!document.all)&&(document.getElementById)){
     NN6=true;
  }
  if (document.all) {
     IE=true;
     NN6=false;
  }

  browser_detector();
}

 /**
  Rileva il browser in uso nel client (2) e setta il parametro client col nome del browser
  @author Alessandro Pani
  @version 1.0
 */
function browser_detector(){
  if (IE) {
    client="IE";
  }

  if (NN6){
    client="NN6";
  }
}

/**
   Rende il contenuto del parametro client
   @author Alessandro Pani
   @version 1.0   
   @return cient - la stringa identificativa del tipo di browser
*/   
function getClient(){
   return client;
}

/**
   Rende true se il browser in uso è Iexplorer o compatibile
   @author Alessandro Pani
   @version 1.0   
   @return true se il browser in uso è Iexplorer o compatibile
*/
function isIE(){
   if (client == "IE") return true     
   else return false
}

/**
   Rende true se il browser in uso è Netscape o compatibile
   @author Alessandro Pani
   @version 1.0   
   @return true se il browser in uso è Netscape o compatibile
*/
function isNN6(){
   if (client == "NN6") return true     
   else return false
}


/**
   Rende la corretta sintassi di un layer in base al browser in uso dal client
   @author Alessandro Pani
   @version 1.0
   @param element - il nome del layer(DIV)
   @return crossElement - la sintassi corretta
*/
function crossBrowserElement(element){
        var crossElement = ""
        if (isIE()){
               crossElement = document.all(element)
        }
        else if(isNN6()){
               crossElement = document.getElementById(element)
        }
        return crossElement;
}


