///////////////////////////////////
//         ajax im 3.41          //
//    AJAX Instant Messenger     //
//   Copyright (c) 2006-2008     //
//    http://www.ajaxim.com/     //
//   Do not remove this notice   //
///////////////////////////////////


/**
 * Class to handle browser requests
 **/
var Browser = {
   /**
    * Get the width of the client browser
    *
    * @author Joshua Gross
    * @return Document Width
    **/
   width: function() {
      if (self.innerWidth) {
         return self.innerWidth;
      } else if (document.documentElement && document.documentElement.clientWidth) {
         return document.documentElement.clientWidth;
      } else if (document.body) {
         return document.body.clientWidth;
      }
      return 630;
   },

   /**
    * Get the height of the client browser
    *
    * @author Joshua Gross
    * @return Document Height
    **/
   height: function() {
      if (self.innerWidth) {
         return self.innerHeight;
      } else if (document.documentElement && document.documentElement.clientWidth) {
         return document.documentElement.clientHeight;
      } else if (document.body) {
         return document.body.clientHeight;
      }
      return 470;
   }
};

var BrowserCheck = {
   
   browserCheck: function(){
      
      this.ver=navigator.appVersion;
      
      this.agent=navigator.userAgent;
      
      this.dom=document.getElementById?1:0;
      
      this.opera5=this.agent.indexOf("Opera 5")>-1;
      
      this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
      
      this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
      
      this.ie4=(document.all && !this.dom && !this.opera5)? 1 : 0;
      
      this.ie8=document.documentMode ? 1 : 0;
      
      this.ie=this.ie4||this.ie5||this.ie6||this.ie8;
      
      this.mac=this.agent.indexOf("Mac")>-1;
      
      this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
      
      this.ns4=(document.layers && !this.dom)?1:0;
      
   },
   
   catchIE6: function(){
      
      BrowserCheck.browserCheck();
      
      ////we don't want to run on IE older than IE7
      
      if((BrowserCheck.ie5 || BrowserCheck.ie6 || BrowserCheck.ie4) && !BrowserCheck.ie8){
         
         document.location = 'ie6.html';
         
      }
      
   }
   
};

//if the browser isn't ie6 and not ie8 in compatible Mode enabled, it passes BrowserCheck conventions

BrowserCheck.catchIE6();