// NexusFX global Javascript file

// on load
window.onload = function(){ abbr() };

// IE based browser check
isIE = (document.all) ? 1 : 0;

// get the element resource for a given ID
function byID(id){
  return document.getElementById ? document.getElementById(id) : document.all[id];
}

function byId(id){
  return document.getElementById ? document.getElementById(id) : document.all[id];
}

// toggle layers on and off
function toggle(id,set){ // self explanatory
  var ele = byId(id).style;
  var status = (ele.display) ? '' : 'none';
  ele.display = status;
}

// small window for info windows etc.
function barewin(url,hei,wid){
  window.open(url, '', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=yes, scrollbars=yes, width='+hei+', height='+wid+', left=20, top=20');
}

// full size window
function link(url,hei,wid){
  window.open(url, '', 'toolbar=yes, directories=yes, location=yes, status=yes, menubar=yes, resizable=yes, scrollbars=yes, width='+hei+', height='+wid+', left=15, top=15');
}

// google ad settings
google_ad_client = "pub-2439527156818196";
google_alternate_ad_url = "/googlepsa";
google_ad_width = 120;
google_ad_height = 240;
google_ad_format = "120x240_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "F9F9F9";
google_color_bg = "F9F9F9";
google_color_link = "000040";
google_color_url = "666666";
google_color_text = "333333";

// image preloader
var preloaded = new Array(100);
function load_images(imagearray){
  for(i = 0; i < imagearray.length; i++){
  preloaded[i] = new Image()
  preloaded[i].src = imagearray[i]
  }
}

// <abbr> bug in IE fix
function abbr() {
  var oldBodyText, newBodyText, reg
  if (isIE) {
    oldBodyText = document.body.innerHTML;
    reg = /<abbr([^>]*)>([^<]*)<\/abbr>/g;
    newBodyText = oldBodyText.replace(reg, '<abbr $1><span class=\"abbr\" $1>$2</span></abbr>');
    document.body.innerHTML = newBodyText;
  }
}

