// JavaScript Document
function parentPosition(ch) {

var valueT = 0, valueL = 0;

do
{ valueT += ch.offsetTop || 0;
valueL += ch.offsetLeft || 0;
ch = ch.offsetParent;
}
while (ch);
return [valueL, valueT];

}

function menu() {

navRoot = document.getElementById("menu");
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=="LI")
{
node.onmouseover=function()
{
this.className+=" over";

}
node.onmouseout=function()
{
this.className=this.className.replace("over", "");
}
tagA = document.getElementsByTagName("UL");
for(a = 0; a < tagA.length; a++)
{
if (tagA[a].className == 'submenu')
{
parentPosition(tagA[a]);
}
}
}
}
}

function allf() {
menu();
}
window.onload=allf;

if (document.images)
{
  pic1= new Image; 
  pic1.src="images/free_case.jpg";
  pic2= new Image; 
  pic2.src="images/free_case_over.jpg"; 

  pic3= new Image; 
  pic3.src="images/legal_glossary.jpg";
  pic4= new Image; 
  pic4.src="images/legal_glossary_over.jpg";
  
  pic5= new Image; 
  pic5.src="images/menu/menu_1_over.gif";

  pic6= new Image; 
  pic6.src="images/menu/menu_2_over.gif";

  pic6= new Image; 
  pic6.src="images/menu/menu_3_over.gif";

  pic7= new Image; 
  pic7.src="images/top_left.gif"; 

  pic8= new Image; 
  pic8.src="images/top_right.gif"; 

  pic9= new Image; 
  pic9.src="images/bot_right.gif"; 

  pic9= new Image; 
  pic9.src="images/bot_left.gif"; 
}

var TRange = null;
var dupeRange = null;
var TestRange = null;
var win = null;


var nom = navigator.appName.toLowerCase();
var agt = navigator.userAgent.toLowerCase();
var is_major   = parseInt(navigator.appVersion);
var is_minor   = parseFloat(navigator.appVersion);
var is_ie      = (agt.indexOf("msie") != -1);
var is_ie4up   = (is_ie && (is_major >= 4));
var is_not_moz = (agt.indexOf('netscape')!=-1)
var is_nav     = (nom.indexOf('netscape')!=-1);
var is_nav4    = (is_nav && (is_major == 4));
var is_mac     = (agt.indexOf("mac")!=-1);
var is_gecko   = (agt.indexOf('gecko') != -1);
var is_opera   = (agt.indexOf("opera") != -1);

var is_rev=0
if (is_gecko) {
temp = agt.split("rv:")
is_rev = parseFloat(temp[1])
}

var frametosearch = self;


function search(whichform, whichframe) {



if (is_ie4up && is_mac) return;



if (is_gecko && (is_rev <1)) return;



if (is_opera) return;



if(whichform.findthis.value!=null && whichform.findthis.value!='') {

       str = whichform.findthis.value;
       win = whichframe;
       var frameval=false;
       if(win!=self)
{

       frameval=true; 
       win = parent.frames[whichframe];

}

    
}

else return;

var strFound;



if(is_nav4 && (is_minor < 5)) {
   
  strFound=win.find(str); // case insensitive, forward search by default



 
        }


if (is_gecko && (is_rev >= 1)) {
   
    if(frameval!=false) win.focus(); // force search in specified child frame
    strFound=win.find(str, false, false, true, false, frameval, false);



    if (is_not_moz)  whichform.findthis.focus();

}

 if (is_ie4up) {

  // EXPLORER-SPECIFIC CODE revised 5/21/03

  if (TRange!=null) {
	  
   TestRange=win.document.body.createTextRange();
 
	  

   if (dupeRange.inRange(TestRange)) {

   TRange.collapse(false);
   strFound=TRange.findText(str);
    if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = win.document.body.scrollTop + TRange.offsetTop;
        TRange.select();
        }


   }
   
   else {

     TRange=win.document.body.createTextRange();
     TRange.collapse(false);
     strFound=TRange.findText(str);
     if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }



   }
  }
  
   if (TRange==null || strFound==0) {
   TRange=win.document.body.createTextRange();
   dupeRange = TRange.duplicate();
   strFound=TRange.findText(str);
    if (strFound) {
        //the following line added by Mike and Susan Keenan, 7 June 2003
        win.document.body.scrollTop = TRange.offsetTop;
        TRange.select();
        }

   
   }

 }

  if (!strFound) alert ("String '"+str+"' not found!") // string not found

        
}
