// BrowserCheck Object
function BrowserCheck() {
  this.agent = navigator.userAgent;
  this.platform = navigator.platform;

  //Platform
  this.win = (this.platform.indexOf("Win")>-1);
  this.mac = (this.platform.indexOf("Mac")>-1);
  this.linux = (this.platform.indexOf("X11")>-1 || this.platform.indexOf("Linux")>-1);

  //Browser
  this.ie = (this.agent.indexOf("MSIE")>-1);
  this.version = parseInt(this.agent.substr(this.agent.indexOf("MSIE")+5,1));
  this.ie6 = (this.ie && this.version==6);
  this.ie6down = (this.ie && this.version<=6);
  this.ie7 = (this.ie && this.version==7);
  this.ie7up = (this.ie && this.version>=7);
  this.ie8 = (this.ie && this.version==8);
  this.ie8up = (this.ie && this.version>=8);
  this.khtml = (this.agent.indexOf("KHTML")>-1);

  //Language
  this.lang = ((this.ie)?navigator.browserLanguage:navigator.language).substring(0,2);
}
is = new BrowserCheck();


// Get window size
if (!is.ie) {
  winH = window.innerHeight;
  winW = window.innerWidth;
}
function getMsWindowSize() {    //for IE only, call it after <body> tag
  if (is.ie) {
    if (is.ie7up) {
      winH = document.documentElement.offsetHeight;
      winW = document.documentElement.offsetWidth;
    }
    else {
      winH = document.body.offsetHeight-4;
      winW = document.body.offsetWidth;
    }
  }
}


// Inits
function StartInit() {
  pageW = 1000;
  xOffset = 15;
  if (is.ie6down) xOffset = 0;
  if (is.ie) getMsWindowSize();
  marginLeft = (winW-pageW-xOffset)/2;
}

function EndInit() {
/*  // Set CSS
  document.body.style.backgroundImage = 'none';
  document.getElementById('wrapper').style.overflow = 'hidden';
  document.getElementById('basenav').style.height = winH+'px';
  document.getElementById('content').style.width = contentW+'px';
  document.getElementById('content').style.height = contentH+'px';
*/
}


// On window resize: reload page
function reload() {
  location.href = location.href;
}
window.onresize = reload;






