
/*function hbcpLayout(head, toc, main) {
  this.header = document.getElementById(head);
  this.toc = document.getElementById(toc);
  this.main = document.getElementById(main);
}
*/ 
/******************************************************************************
 *  FUNCTION: hideToc
 *  DESCRIPTION: This function will hide or show the left nav on the page  
 *****************************************************************************/
function hideToc() {    
  return (document.getElementById("toc").style.visibility == 'hidden') ? layout(): layout(0); 
}
/******************************************************************************
 *  FUNCTION: CrossBrowserWindowSize
 *  DESCRIPTION: This function return the size of the visible window: height 
 *               or width  
 *****************************************************************************/
function CrossBrowserWindowSize(widthOrHeight) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }  
  return (widthOrHeight == 0)? myWidth:myHeight; 
}
/******************************************************************************
 *  FUNCTION: layout
 *  DESCRIPTION: This function is responsible of the display of the different
 *               part of the page.  
 *****************************************************************************/
function layout(width) {
  var clientHeight = CrossBrowserWindowSize(1);
  var clientWidth = CrossBrowserWindowSize(0);
  var oHeader = document.getElementById("header");			
	var oToc = document.getElementById("toc");
	var oMain = document.getElementById("main");
  var oTocContent = document.getElementById("tocController");
  var oShowHide = document.getElementById("showHide");
							
	var headerHeight = oHeader.offsetHeight;
	
	// Initializing the header of all layers
	oToc.style.top = oShowHide.style.top = oMain.style.top = headerHeight;	
  oTocContent.style.top = oToc.offsetHeight + headerHeight;
  
  if (width == 0) {     
    oToc.style.visibility = 'hidden';
    oToc.style.width = 0;         
    oTocContent.style.visibility = 'hidden';
    oTocContent.style.width = 0; 
    oShowHide.style.left = 0;
  }
  else {      
    oToc.style.visibility = 'visible';
    oToc.style.width = 253;
    oTocContent.style.visibility = 'visible';
    oTocContent.style.width=253;
    oShowHide.style.left = oToc.offsetWidth;	
  }    
  oShowHide.style.height = clientHeight - oShowHide.offsetTop;
  oTocContent.style.height = clientHeight - oTocContent.offsetTop;
  	
	oMain.style.left = oShowHide.offsetLeft + oShowHide.offsetWidth;		
	oMain.style.height = clientHeight - headerHeight;
	oMain.style.width = clientWidth - oMain.offsetLeft;	  		
	return;	
}

/******************************************************************************
 *
 *****************************************************************************/		
function setData(Content, elementId) {
	document.getElementById(elementId).innerHTML = Content;			
	return;
}		
/******************************************************************************
 *
 *****************************************************************************/
function UpdateTab() {			
	var tabObj = document.getElementById("tocTab");
	var NavObj = document.getElementById('tocNav');
	var tocFrame = document.getElementById("tocController");
	
	var currentMap = tabObj.useMap;
	
	if (currentMap.indexOf('toc') > 0) {
		tabObj.useMap = '#helpMap';		
		tabObj.src='images/toc_header.gif';
		tocFrame.src = 'toc/default.asp?exp=*toc*#toc'
		//NavObj.src= 'images/toc_text.jpg';
		
	} else {
		tabObj.useMap = '#tocMap';
		tabObj.src='images/help_header.gif';
		tocFrame.src = 'help/default.asp?exp=*toc*#techsupport_section'
		//NavObj.src= 'images/help_text.jpg';				
	}
	return false;
}

/******************************************************************************
 *  CLASS: hbcpController
 *****************************************************************************/ 
/*
function hbcpController(iframe_name) {
  var controller; // = document.createElement(name);
  //controller.src = void();
  var IFrameDoc;
  
//  var IFrameObj; // our IFrame object
 // function callToServer() {
    if (document.createElement) {return null};    
    var URL = void();
    if (!controller && document.createElement) {
      // create the IFrame and assign a reference to the
      // object to our global variable IFrameObj.
      // this will only happen the first time 
      // callToServer() is called
     try {
        var tempIFrame=document.createElement('iframe');
        tempIFrame.setAttribute('id',iframe_name);
        tempIFrame.style.border='0px';
        tempIFrame.style.width='0px';
        tempIFrame.style.height='0px';
        controller = document.body.appendChild(tempIFrame);
        
        if (document.frames) {
          // this is for IE5 Mac, because it will only
          // allow access to the document object
          // of the IFrame if we access it through
          // the document.frames array
          controller = document.frames[iframe_name];
        }
      } catch(exception) {
        // This is for IE5 PC, which does not allow dynamic creation
        // and manipulation of an iframe object. Instead, we'll fake
        // it up by creating our own objects.
        iframeHTML='\<iframe id="' + iframe_name +'" style="';
        iframeHTML+='border:0px;';
        iframeHTML+='width:0px;';
        iframeHTML+='height:0px;';
        iframeHTML+='"><\/iframe>';
        document.body.innerHTML+=iframeHTML;
        controller = new Object();
        controller.document = new Object();
        controller.document.location = new Object();
        controller.document.location.iframe = document.getElementById(iframe_name);
        controller.document.location.replace = function(location) {
          this.iframe.src = location;
        }
      }
    }
    
    if (navigator.userAgent.indexOf('Gecko') !=-1 && !controller.contentDocument) {
      // we have to give NS6 a fraction of a second
      // to recognize the new IFrame
      setTimeout('hbcpController(iframe_name)',10);
      return false;
    }
    
    if (controller.contentDocument) {
      // For NS6
      IFrameDoc = controller.contentDocument; 
    } else if (controller.contentWindow) {
      // For IE5.5 and IE6
      IFrameDoc = controller.contentWindow.document;
    } else if (controller.document) {
      // For IE5
      IFrameDoc = controller.document;
    } else {
      return true;
    }
    
    controller.location.replace(URL);
    return false;
  }
}
*/
     
     
/******************************************************************************
 *
 *****************************************************************************/
 function HBCPsearchRequest(TableId) {
  //local variables
  var m_SearchTermsArray;
  var m_Table = document.getElementById(TableId);
  //var m_columns = new Array('property','displayName', 'type','visibility');
  
  //properties & methods
  this.dataSrc = function(dataSource) {m_SearchTermsArray = dataSource;}
  /***************************************************************************/  
  this.show = function() {    
                    for (i=0;i<m_SearchTermsArray.length;i++) {
                      displayRow(i);
                    }
              }  
  /***************************************************************************/              
  //Methods 
  /*
  * 
  */  
  function displayRow(position){
    var rowElement = m_SearchTermsArray[position]
    var newRow = m_Table.insertRow(-1);
    for (j=0;j<rowElement.length;j++) {    
      var newCell = newRow.insertCell(-1);
      newCell.onMouseOver = handler;
      newCell.innerHTML = rowElement[j] ;
    }
  }
  
  
 }
 
/*****************************************************************************
 *  XML manipulation.....
 ****************************************************************************/     
 function importXML(url)
{
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = createTable;
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) createTable()
		};
 	}
	else
	{
		alert('Your browser can\'t handle this script');
		return;
	}
	xmlDoc.load(url);
}

function createTable()
{
	var x = xmlDoc.getElementsByTagName('emperor');
	var newEl = document.createElement('TABLE');
	newEl.setAttribute('cellPadding',5);
	var tmp = document.createElement('TBODY');
	newEl.appendChild(tmp);
	var row = document.createElement('TR');
	for (j=0;j<x[0].childNodes.length;j++)
	{
		if (x[0].childNodes[j].nodeType != 1) continue;
		var container = document.createElement('TH');
		var theData = document.createTextNode(x[0].childNodes[j].nodeName);
		container.appendChild(theData);
		row.appendChild(container);
	}
	tmp.appendChild(row);
	for (i=0;i<x.length;i++)
	{
		var row = document.createElement('TR');
		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1) continue;
			var container = document.createElement('TD');
			var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
			container.appendChild(theData);
			row.appendChild(container);
		}
		tmp.appendChild(row);
	}
	document.getElementById('writeroot').appendChild(newEl);
}
 
 
function browserType() {
 	var link = ['default.asp','services.asp','contact.asp','quote.asp'];
	var isNav4, isIE4
	
	if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
	  isNav4 = (navigator.appName == "Netscape") ? true : false
	  isIE4 = (navigator.appName.indexOf("Microsoft" != -1)) ? true : false
	}
	return (isNav4 )? 'Mozilla': (isIE4 ? 'Microsoft':'Other');
}
	function EventHandler(evnt) {
	  // Netscape passes an event object to event handlers,
	  // but IE passes nothing.  Note that childW is hard-wired.
	  var menuItems = document.getElementsByName("menuItem");
	  var currentElm = null;
	  var eventType = null;
	  if (isNav4) {  
		currentElm = evnt.target;  
		eventType = evnt.type;
		//alert(currentElm.inner + " fired... ");
		}
	  else if (isIE4) {
		currentElm = event.srcElement;
		eventType = event.type
		//alert(event.srcElement.innerText + " fired... ");
		}
	  //else alert("Unknown browser type");
	  if (currentElm) {			  
		for (i=0;i<4;i++) {
			if (currentElm == document.getElementById('Item' + i)){
				switch(eventType) {
					case 'mouseover': {currentElm.className = "menuItemOver"; break;}
					case 'mouseout': {currentElm.className = "menuItem";	break;}
					case 'click': {document.location.href = link[i]; break;}
				}//switch
			} // if (currentElm...
		} //for (i=0...
	  } //if (currentElm...
	  return;
	} // function EventHandler(evnt)
	function assignEvent() {
  	if (isNav4)
  		document.captureEvents(Event.MOUSEOVER);			
  	document.onmouseover = EventHandler;
  	document.onmouseout = EventHandler;
  	document.onclick = EventHandler;
	}								
 
 









