
// Multi-Browser DOM operator
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
   browserVersion = parseInt(navigator.appVersion);
   if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
   else {
     if (document.all) {isAll = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
  if (withStyle == 1) {
    if (isID) { return (document.getElementById(objectID).style) ; }
    else {
      if (isAll) { return (document.all[objectID].style); }
    else {
      if (isLayers) { return (document.layers[objectID]); }
    };}
  }
  else {
    if (isID) { return (document.getElementById(objectID)) ; }
    else {
      if (isAll) { return (document.all[objectID]); }
    else {
      if (isLayers) { return (document.layers[objectID]); }
    };}
  }
}

// page jump
function select_url(x) { location = x; }

// Create Rollover image
//  img : image file name xxx [_0|1.gif] added here
//  url : address of destination
var lableinc = 0;
function rolloverbtn(img,url,alt) {
  tmp = new Image();
  tmp.src = img + "_1.gif"; // load image to cache
  lableinc += 1; // image label increment
  tmpstr  = '<a href="' + url + '" ';
  tmpext = url.split('//');
  if (tmpext[0] == 'http:') {
    tmpstr += 'target="_blank" ';
  }
  tmpstr += 'onmouseover="document.i' + eval(lableinc) + '.src=' + "'" + img + '_1.gif' + "'" + '" ';
  tmpstr += 'onmouseout="document.i' + eval(lableinc) + '.src=' + "'" + img + '_0.gif' + "'" + '" ';
  tmpstr += '><img name="i' + eval(lableinc) + '" src="' + img + '_0.gif' + '" border="0" alt="' + alt + '"></a>';
  document.write(tmpstr);
}

// Image Rollover code
//  id : image name
//  name : pre-declared image from cache
function SwapImage(id,name) {
  document.images[id].src = eval(name+".src");
}

// Pop-up Window
//  page : URL of page
//  x,y : size of pop-up window
function openwindow(page,x,y) {
  window.open(page,'','menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=' + x + ',height=' + y);
}

// Fix Netscape window resize
function FixNSResize() {
  if (isLayers == 1) { document.location.reload(true); }
}

// Primary image declarations for Sitewide navigation
//pnav is an array of object holding image off & on refs, alt txt & link url.
//It's written to the page in common.js, by GlobalNavTag.class
pnav1_0     = new Image();
pnav1_0.src = pnav[0].image_0; //'assets/pnav1_0.gif';
pnav1_1     = new Image();
pnav1_1.src = pnav[0].image_1; //'assets/pnav1_1.gif';
pnav2_0     = new Image();
pnav2_0.src = pnav[1].image_0; //'assets/pnav2_0.gif';
pnav2_1     = new Image();
pnav2_1.src = pnav[1].image_1; //'assets/pnav2_1.gif';
pnav3_0     = new Image();
pnav3_0.src = pnav[2].image_0; //'assets/pnav3_0.gif';
pnav3_1     = new Image();
pnav3_1.src = pnav[2].image_1; //'assets/pnav3_1.gif';

// Image Rollover for Primary Navigation images
function swapNav(id,state) {
  imgId = 'pnav'+id;
  document.images[imgId].src = eval(imgId+"_"+state+".src");
}

function bannerHtml (argImg,argAlt) {
  ret = '\
  <img src="' + imgComGlob + '/spacer.gif" width="1" height="4" alt="" border="0"><br>\
  <table width="100%" cellpadding="0" cellspacing="0" border="0">\
  <tr>\
    <td width="103" height="1"><img src="' + imgComGlob + '/spacer.gif" width="103" height="1" alt="" border="0"></td>\
    <td width="4" height="1" bgcolor="#000000" colspan="3"><img src="' + imgComGlob + '/spacer.gif" width="4" height="1" alt="" border="0"></td>\
    <td width="663" height="1" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="663" height="1" alt="" border="0"></td>\
    <td width="1000" height="1" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="1" height="1" alt="" border="0"></td>\
  </tr>\
  <tr>\
    <td width="103" height="116" align="right" valign="top">\
      <a href="'+ pnav[0].href +'" onmouseover="popUp(\'HM_Menu1\',event)" onmouseout="popDown(\'HM_Menu1\')"><img name="pnav1" src="' + imgComLocal + '/pnav1_0.gif" width="100" height="30" alt="' + pnav[0].alt + '" border="0"></a><br>\
      <a href="'+ pnav[1].href +'" onmouseover="popUp(\'HM_Menu2\',event)" onmouseout="popDown(\'HM_Menu2\')"><img name="pnav2" src="' + imgComLocal + '/pnav2_0.gif" width="100" height="30" alt="' + pnav[1].alt + '" border="0"></a><br>\
      <a href="'+ pnav[2].href +'" onmouseover="popUp(\'HM_Menu3\',event)" onmouseout="popDown(\'HM_Menu3\')"><img name="pnav3" src="' + imgComLocal + '/pnav3_0.gif" width="100" height="30" alt="' + pnav[2].alt + '" border="0"></a><br>\
    </td>\
    <td width="1" height="116" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="1" height="1" alt="" border="0"></td>\
    <td width="2" height="116" bgcolor="#ffffff"><img src="' + imgComGlob + '/spacer.gif" width="2" height="1" alt="" border="0"></td>\
    <td width="1" height="116" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="1" height="1" alt="" border="0"></td>';

  ret += '<td width="663" height="116" background="' + argImg.replace(".jpg","_bg.jpg") + '"><img src="' + argImg + '" width="663" height="116" alt="' + argAlt + '" border="0"></td>';
  ret += '<td width="1000" height="116" background="' + argImg.replace(".jpg","_bg.jpg") + '"><img src="' + imgComGlob + '/spacer.gif" width="1" height="1" alt="" border="0"></td>';
  ret += '\
  </tr>\
  <tr>\
    <td width="103" height="1"><img src="' + imgComGlob + '/spacer.gif" width="103" height="1" alt="" border="0"></td>\
    <td width="4" height="1" bgcolor="#000000" colspan="3"><img src="' + imgComGlob + '/spacer.gif" width="4" height="1" alt="" border="0"></td>\
    <td width="663" height="1" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="663" height="1" alt="" border="0"></td>\
    <td width="1000" height="1" bgcolor="#000000"><img src="' + imgComGlob + '/spacer.gif" width="1" height="1" alt="" border="0"></td>\
  </tr>\
  </table>';
  return ret;
}

