// Juan Matias de la Camara Beovide
// TJF - Tiger JavaScrip Framework
// Abril 2008

// Funciones para detectar el navegador


var TJF_browser = Class.create();

TJF_browser.DEFAULTS = {}
TJF_browser.prototype = {
  initialize : function (options) {
    this.options = Extend(options, TJF_browser.DEFAULTS);
    this.isMoz=0;
    this.isIe=0;
    this.lastindex=-1;
    this.displayRow='block';
    this.displayCell='block';
  
    var nav=navigator.userAgent.toLowerCase();
    if ( nav.indexOf("gecko") != -1 ) {
      this.isMoz=1;
      this.lastindex=null;
      this.displayRow='table-row';
      this.displayCell='table-cell';
    }
    else if ( nav.indexOf("msie") != -1 ) {
      this.isIe=1;
    }
    return this;
  },

  getscreenheight : function() {return(screen.height);},
  getscreenavailHeight : function() {return(screen.availHeight);},
  getscreenwidth : function() {return(screen.width);},
  getscreenavailWidth : function() {return(screen.availWidth);},
  getscreenupdateInterval : function() {return(screen.updateInterval);},
  getscreenfontSmoothingEnabled : function() {return(screen.fontSmoothingEnabled);},
  getscreenbufferDepth : function() {return(screen.bufferDepth);},
  getscreencolorDepth : function() {return(screen.colorDepth);},
  getnavigatorappCodeName : function() {return(navigator.appCodeName);},
  getnavigatorappMinorVersion : function() {return(navigator.appMinorVersion);},
  getnavigatorappName : function() {return(navigator.appName);},
  getnavigatorappVersion : function() {return(navigator.appVersion);},
  getnavigatorcookieEnabled : function() {return(navigator.cookieEnabled);},
  getnavigatorcpuClass : function() {return(navigator.cpuClass);},
  getnavigatorjavaEnabled : function() {return(navigator.javaEnabled());},
  getnavigatormimeTypeslength : function() {return(navigator.mimeTypes.length);},
  getnavigatoronLine : function() {return(navigator.onLine);},
  getnavigatorplatform : function() {return(navigator.platform);},
  getnavigatorpluginslength : function() {return(navigator.plugins.length);},
  getnavigatorsystemLanguage : function() {return(navigator.systemLanguage);},    
  getnavigatortaintEnabled : function() {return(navigator.taintEnabled());},
  getnavigatoruserAgent : function() {return(navigator.userAgent);},
  getnavigatoruserLanguage : function() {return(navigator.userLanguage);},
  getwindowinnerwidth : function() {if(this.isMoz==1){return(window.innerWidth);}else{return(document.body.clientWidth);}},
  getwindowinnerheight : function() {if(this.isMoz==1){return(window.innerHeight);}else{return(document.body.clientHeight);}}
}


// browser management
var __navigator__= new TJF_browser();