﻿
function win(url, winname, winwidth, winheight) {
  offset=0;
  if (winwidth > screen.width) {
    winwidth = parseInt(screen.width)-200;
  }
  if (winheight > screen.height) {
    winheight = parseInt(screen.height)-200;
  }
  if (navigator.userAgent.toLowerCase().indexOf("msie")!=-1) {
    eval(winname+"=window.open('"+url+"','"+winname+"','titlebar=yes,left='+(((parseInt(screen.width)/2)-parseInt(winwidth/2))+offset)+',top='+(((parseInt(screen.height)/2)-parseInt(winheight/2))+offset)+',status=yes,resizable=no,toolbar=no,scrollbars=no,menubar=no,Width='+winwidth+',Height='+winheight);");
  } else {
    eval(winname+"=window.open('"+url+"','"+winname+"','titlebar=yes,screenX='+(((parseInt(screen.width)/2)-parseInt(winwidth/2))+offset)+',screenY='+(((parseInt(screen.height)/2)-parseInt(winheight/2))+offset)+',status=yes,resizable=no,toolbar=no,scrollbars=no,menubar=no,Width='+winwidth+',Height='+winheight);");
  }
  eval(winname+".focus();");
}

window.onload = function() {
  setBottomPos();
}

function fixIE() {
  if(navigator.userAgent.indexOf("MSIE 6") != -1) {
    document.body.className="";
  }
}

function setBottomPos() {
  setBottomPosPerLayout("wrapper");
  setBottomPosPerLayout("wrapper_home");
}

function setBottomPosPerLayout(divID) {
  if(document.getElementById) {
    if(document.getElementById(divID)) {
      if(navigator.userAgent.toLowerCase().indexOf("khtml")!=-1)
        document.getElementById(divID).style.height = (document.body.scrollHeight+2)+"px";
      else
        document.getElementById(divID).style.height = document.documentElement.scrollHeight+"px";
      document.getElementById(divID).style.backgroundImage = "url(/images/bottom_grass.gif)";
      document.getElementById(divID).style.backgroundRepeat = "repeat-x";
      document.getElementById(divID).style.backgroundPosition = "bottom left";
    }
  }
}

function fixIE() {
  if(navigator.userAgent.indexOf("MSIE 6") != -1) {
    document.body.className="";
  }
}

var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
x = navigator.plugins["Shockwave Flash"];
if (x)
{
flashinstalled = 2;
if (x.description)
{
y = x.description;
flashversion = y.charAt(y.indexOf('.')-1);
}
}
else
flashinstalled = 1;
if (navigator.plugins["Shockwave Flash 2.0"])
{
flashinstalled = 2;
flashversion = 2;
}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-shockwave-flash'];
if (x && x.enabledPlugin)
flashinstalled = 2;
else
flashinstalled = 1;
}
else
MSDetect = "true";