
isMac = (navigator.appVersion.indexOf('Mac') != -1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all) && (isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all) && (navigator.appVersion.indexOf('MSIE 4.') != -1)) ? true : false;
IE5 = ((document.all) && (navigator.appVersion.indexOf('MSIE 5.') != -1)) ? true : false;
IE6 = ((document.all) && (navigator.appVersion.indexOf('MSIE 6.') != -1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape') != -1) ? true : false;

IE5plus = IE5 || IE6;
IEMajor = 0;

if (IE4plus) {
  var start = navigator.appVersion.indexOf('MSIE');
  var end = navigator.appVersion.indexOf('.', start);
  IEMajor = parseInt(navigator.appVersion.substring(start + 5, end));
  IE5plus = (IEMajor >= 5) ? true : false;
}


var img;
var img_mo;
var img_cl;
img = new Array();
img_mo = new Array();
img_cl = new Array();


if (top.location.href.indexOf('frameid=') != -1 && top.location.href.indexOf('/print=true') == -1) {
  top.location.href = top.location.href.replace('frameid=', 'framenoid=');
}



function setCookie(name, value, expire) {
  if (expire == '') {
    document.ignore = name + "=" + escape(value);
  } else {
    var expires = new Date();
    expires.setTime(expires.getTime() + expire);

    document.ignore = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expires.toGMTString())) + "; path=/";
  }
}


function getCookie(name) {
   var search = name + "=";
   var val = "";

   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 

      if (offset != -1) { // if cookie exists 
         offset += search.length;

         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 

         // set index of end of cookie value
         if (end == -1) {
            end = document.cookie.length;
         }

         val = unescape(document.cookie.substring(offset, end));
      } 
   }

   return val;
}



function initMo(uniqueid, origImgSrc, overImgSrc, clickImgSrc) {
  if (origImgSrc != '') {
    img[uniqueid] = new Image();
    img[uniqueid].src = origImgSrc;
  }
  if (overImgSrc != '') {
    img_mo[uniqueid] = new Image();
    img_mo[uniqueid].src = overImgSrc;
  }
  if (clickImgSrc != '') {
    img_cl[uniqueid] = new Image();
    img_cl[uniqueid].src = clickImgSrc;
  }
}


function mov(uniqueid) {
  if (img_mo[uniqueid]) {
    document[uniqueid].src = img_mo[uniqueid].src;
  }
}


function mou(uniqueid) {
  if(img[uniqueid]) {
    document[uniqueid].src = img[uniqueid].src;
  }
}


function md(uniqueid) {
  if (img_cl[uniqueid]) {
    document[uniqueid].src = img_cl[uniqueid].src;
  }
}


function initMouseOver(uniqueid, origImgSrc, overImgSrc, clickImgSrc) {
  img['I' + uniqueid + origImgSrc] = new Image();
  img['I' + uniqueid + origImgSrc].src = origImgSrc;
  img_mo['I' + uniqueid + origImgSrc] = new Image();
  img_mo['I' + uniqueid + origImgSrc].src = overImgSrc;
  img_cl['I' + uniqueid + origImgSrc] = new Image();
  img_cl['I' + uniqueid + origImgSrc].src = clickImgSrc;
}

function MouseOver(imgName) {
  document[imgName].src = img_mo[imgName].src;
}

function MouseOut(imgName) {
  document[imgName].src = img[imgName].src;
}

function MouseDown(imgName) {
  document[imgName].src = img_cl[imgName].src;
}


function showWindow(uniqueid,id,qs,width,height) {
  var windowObj;
  windowObj = eval('top.Info' + uniqueid);

  if (windowObj !=null && (windowObj + "" != "undefined") && !windowObj.closed) {
    windowObj.focus();
  } else {
    windowObj = null;
    windowObj = top.open('/planet/show/id=' + id + qs,'Info'+uniqueid,'toolbar=no,width=' + width + ',height=' + height + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no');
    top.name = 'wm';

    if (windowObj != null) {
      windowObj.focus();
    }     
  }
  reload = false;
}


vers = navigator.appVersion;
vflag = false;
vflag2 = false;

if (navigator.appName == "Microsoft Internet Explorer") {
  vers = vers.substring(vers.lastIndexOf("MSIE") + 4, vers.length);
  vers = parseFloat(vers.substring(0, vers.indexOf(";")));

  if (vers >= 5) {
    vflag = true;
  }
} else {
  if (navigator.appName == "Netscape") {
    vers = parseInt(navigator.appVersion);

    if (vers >= 5) {
      vflag = true;
    }
  }
}

var requiredVersion = 5;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

jsVersion = 1.1;

if (isIE && isWin) {
  document.write('<scr' + 'ipt language="VBScript"\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

if (navigator.plugins) {
  if (navigator.plugins["Shockwave Flash 2.0"]
    || navigator.plugins["Shockwave Flash"]) {
    var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
    var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
    var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

    flash2Installed = flashVersion == 2;
    flash3Installed = flashVersion == 3;
    flash4Installed = flashVersion == 4;
    flash5Installed = flashVersion == 5;
    flash6Installed = flashVersion == 6;
  }
}

for (var i = 2; i <= maxVersion; i++) {
  if (eval("flash" + i + "Installed") == true) {
    actualVersion = i;
  }
}

if (navigator.userAgent.indexOf("WebTV") != -1) {
  actualVersion = 2;
}

