function tooltip(theText, event, wid) {
  if(event==null) event=window.event;
  
  var theImage="<img src=\"images/quicktip.gif\" style=\"vertical-align:text-bottom;margin-right:5px;\">";
  
  var x=event.clientX;
	var ox=window.pageXOffset;
	if(ox==null) ox=document.documentElement.scrollLeft;
	if(ox!=null) x+=ox;
	var y=event.clientY;
	var oy=window.pageYOffset;
	if(oy==null) oy=document.documentElement.scrollTop;
	if(oy!=null) y+=oy;
  
  var tt_div=document.getElementById("tt_div");
  var tt_ifr=document.getElementById("tt_ifr");
  var tt_sdw=document.getElementById("tt_sdw");
  if(tt_div==null) {
    tt_div=document.createElement("DIV");
    tt_div.id="tt_div";
    tt_div.className="tooltip";
    tt_div.onmouseout=function() {
      hideTooltip();
    }
    document.body.appendChild(tt_div);
  }
  if(tt_ifr==null) { 
    tt_ifr=document.createElement("IFRAME");
    tt_ifr.id="tt_ifr";
    tt_ifr.className="tooltip";
    document.body.appendChild(tt_ifr);
  }
  if(tt_sdw==null) { 
    tt_sdw=document.createElement("DIV");
    tt_sdw.id="tt_sdw";
    tt_sdw.className="shadowDiv";
    document.body.appendChild(tt_sdw);
  }
  if(wid!=null) {
    tt_div.style.width=wid+"px";
    tt_ifr.style.width=wid+"px";
    tt_sdw.style.width=wid+"px";
  } else {
    tt_div.style.width="300px";
    tt_ifr.style.width="300px";
    tt_sdw.style.width="300px";
  }
  tt_div.innerHTML=theText;
  
  tt_sdw.style.display="block";
  tt_sdw.style.left=(x+19)+"px";
  tt_sdw.style.top=(y+19)+"px";
  
  tt_ifr.style.height=(tt_div.offsetHeight)+"px";
  tt_sdw.style.height=(tt_div.offsetHeight)+"px";
  
  tt_ifr.style.display="block";
  tt_ifr.style.left=(x+15)+"px";
  tt_ifr.style.top=(y+15)+"px";
  tt_div.style.display="block";
  tt_div.style.left=(x+15)+"px";
  tt_div.style.top=(y+15)+"px";
}
function hideTooltip() {
  var tt_div=document.getElementById("tt_div");
  var tt_ifr=document.getElementById("tt_ifr");
  var tt_sdw=document.getElementById("tt_sdw");
  if(tt_div!=null) tt_div.style.display="none";
  if(tt_ifr!=null) tt_ifr.style.display="none";
  if(tt_sdw!=null) tt_sdw.style.display="none";
}

var formNumberText="<strong>Form Number:<br></strong>Open the dropdown list and select the form you want. Then press Search";
var programAreaText="<strong>Program Area:<br></strong>Select the program area to limit the search to all forms belonging to that program area. Selecting a program area will also select the Business Unit that the program area belongs to";
var businessUnitText="<strong>Business Unit:<br></strong>Select the business unit to limit the search to all forms belonging to that business unit. Selecting a business unit will limit the program areas that appear in the Program Area dropdown list to those belonging to that business unit";
var textText="<strong>Title:<br></strong>Type the name of the form, part of the name of the form, or keywords in the name of the form. <br><br>For example, type &quot;insurance&quot; to get the &quot;Certificate of Insurance&quot; form (H0111).";
var externalOrganizationText="<strong>External Organization:<br></strong>External organizations include other BC government ministries and agencies. Select the external organization to limit the search to all forms belonging to that external organization";
var replacementFormText="<strong>Replacement Form:</br></strong>You may specify a replacement for this form. A link to the replacement form specified will appear when users attempt to retrieve the removed form. If you need to add the replacement form to the system, please go to the new form request page and initiate a request, then come back here when that request is complete";

window.onunload=function() {
  hideTooltip();
}