/*	summary:
		used to display the tool tips on the pages. uses tooltip.css for style.
	author: Ken Beaumont

	copyright:
		(&copy;) Copyright 2006 by GATS Inc.
		11864 Canon Blvd., Suite 101, Newport News, VA 23606

		All Rights Reserved. No part of this software or publication may be
		reproduced, stored in a retrieval system, or transmitted, in any form
		or by any means, electronic, mechanical, photocopying, recording, or
		otherwise without the prior written permission of GATS Inc.
*/
var DH = 0;
var an = 0;
var al = 0;
var ai = 0;
if (document.getElementById)
{
 ai = 1;
 DH = 1;
}else {if (document.all) {
al = 1;
 DH = 1;
} else {
 browserVersion = parseInt(navigator.appVersion);
 if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4))
   {an = 1; DH = 1;
  }
 }
}
 function fd(oi, wS)
{
 if (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi);
 if (al) return wS ? document.all[oi].style: document.all[oi];
 if (an) return document.layers[oi];
}
function pw()
{
 return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;
}
function mouseX(evt)
{
 if (evt.pageX) return evt.pageX;
 else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft);
 else return null;
}
function mouseY(evt)
{
 if (evt.pageY) return evt.pageY;
 else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
 else return null;
}

function popUp(evt,oi) {
//pausecomp(500);
if (DH) {
var wp = pw();
 ds = fd(oi,1);
 dm = fd(oi,0);
 st = ds.visibility;
 if (dm.offsetWidth) ew = dm.offsetWidth;
 else if (dm.clip.width) ew = dm.clip.width;
 if (st == "visible" || st == "show") { ds.visibility = "hidden";
 } else {
          tv = mouseY(evt) + 20;
          lv = mouseX(evt) - (ew/4);
          if (lv < 2) lv = 2;
          else if (lv + ew > wp) lv -= ew/2;
          if (!an) 
            {
              lv += 'px';
              tv += 'px';
             } ds.left = lv;
           ds.top = tv;
           ds.visibility = "visible";
         }
 }
}

function popUp2(oi, which_tool) {
//pausecomp(500);
if (DH) {
var wp = pw();
 ds = fd(oi,1);
 dm = fd(oi,0);
 st = ds.visibility;
 if (dm.offsetWidth) ew = dm.offsetWidth;
 else if (dm.clip.width) ew = dm.clip.width;
 if (st == "visible" || st == "show") { ds.visibility = "hidden";
 } else {
      if(which_tool == "spec_calc")      {
          tv = 400;
          lv = 320;
      }
      else if(which_tool == "bb_calc")      {
          tv = 700;
          lv = 350;
      }
       else if(which_tool == "ab_calc")     {
          tv = 500;
          lv = 350;
      } 
      else if(which_tool == "db_brw") {
          tv = 350;
          lv = 350;      
      }
      else if(which_tool == "db_brwDT") {
          tv = 800;
          lv = 350;      
      }
      else if(which_tool == "db_brwDTxs") {
          tv = 400;
          lv = 350;      
      }
      else if(which_tool == "db_brwIN") {
          tv = 850;
          lv = 350;
      }
      else if(which_tool == "solar") {
          tv = 570;
          lv = 350;
      }
          if (lv < 2) lv = 2;
          else if (lv + ew > wp) lv -= ew/2;
          if (!an) 
            {
              lv += 'px';
              tv += 'px';
             } ds.left = lv;
           ds.top = tv;
           ds.visibility = "visible";
         }
 }
}

function pausecomp(millis)
{
date = new Date();
var curDate = null;

do { var curDate = new Date(); }
while(curDate-date < millis);
} 
