
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;
IE7 = ((document.all) && (navigator.appVersion.indexOf('MSIE 7.') != -1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape') != -1) ? true : false;

IE5plus = IE5 || IE6 || IE7;
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();



function setCookie(name, value, expire) {
  if (expire == '') {
    document.cookie = name + '=' + escape(value) + '; path=/';
  } else {
    var expires = new Date();
    expires.setTime(expires.getTime() + expire);

    document.cookie = 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;
}

var ord;
ord=Math.random()*10000000000000000;

var tile;
tile = 0;