
// 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 += 'onclick="this.blur()" 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);
}

// Switch acitive Promiary Navigation buttons
function SwapNav(nz) {
  switch(nz) {
    case 1 : SwapImage('prod','prod_1'); SwapImage('soln','soln_0'); SwapImage('supp','supp_0'); break;
    case 2 : SwapImage('prod','prod_0'); SwapImage('soln','soln_1'); SwapImage('supp','supp_0'); break;
    case 3 : SwapImage('prod','prod_0'); SwapImage('soln','soln_0'); SwapImage('supp','supp_1'); break;
    default:
  }
}
// Close all Primary Navigation buttons
function closenav() {
  SwapImage('prod','prod_0');
  SwapImage('soln','soln_0');
  SwapImage('supp','supp_0');
}

// 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); }
}

// Omniture Site Catalyst ClickMap ID
function ocm(x) {
	return window.location.pathname.replace(/[/]/g,"_")+x;
}

