   //-----------------------------------------------------------------------
   // *********************** I M P O R T A N T ***************************
   // The following lines of code create cross browser (ie4 to NS)
   // DHTML layer manuipulation and control and should always be
   // included as the first [head][script language..] variable declarations
   // G.Harstad 2000
   // added  partial NS6 compatibilty T. O'Hara 2/2001
   //-----------------------------------------------------------------------
      //Detect browser type (4+ required)
      var ie4 = document.all;
      var ns = document.layers;
      var gh_dom = document.getElementById;
      
     //BEGIN CROSS BROWSER DOM VARIABLE CREATION
     var doc =  gh_dom ? "document.getElementById('" :ie4 ? "document.all." : "document."
     var sty = gh_dom ? "').style" : ie4 ? ".style" : ""
     var vis = ".visibility="
     var bgcol = ie4 ? ".backgroundColor" : ".backgroundColor"
     //(not correct yet) var fgcol = ie4 ? ".Color" : ".Color"
     
     //Used for getting width & height of a layer
     var getwidth  = gh_dom? ".width" :ie4 ? ".pixelWidth"  : ".clip.width"
     var getheight = gh_dom? ".height" :ie4 ? ".pixelHeight" : ".clip.height"
     
     //used for the differences in showing and hiding a layer
     var show = (ie4||gh_dom) ? "'visible'" : "'show'"
     var hide = (ie4||gh_dom) ? "'hidden'"  : "'hide'"
 //END CROSS BROWSER DOM VARIABLE CREATION
 
 
 
  
   //--------------------------------------------------------
   // FUNCTION: togglelayer(lyrname, togval)
   // DESCRIPTION: Toggles a layer's visibility
   // REQUIRES: layers name [string] and 0 or 1 [off or on]  
   // AUTHOR: G.Harstad 2000  
   //--------------------------------------------------------
     function togglelayer(lyrname, togval, outerdiv)
         
     {   
         if ((document.layers) && (outerdiv))
         {
          doc="document." + outerdiv + ".document."
         
         }
         
         //alert(lyrname);
         //alert(togval);
         var togval2 = (togval == 0) ? hide : show
         //alert(togval2)
         //alert(doc+lyrname+sty+vis+togval2)
         eval(doc+lyrname+sty+vis+togval2)
     }
     
    
   //-------------------------------------------------------------
   // FUNCTION: positionlayer(lyrname, topval, leftval)
   // DESCRIPTION: Positions a layer to a new top, left location
   // REQUIRES: layers name [string] and top and left values [int]  
   // AUTHOR: G.Harstad 2000 
   //-------------------------------------------------------------
     function positionlayer(lyrname, topval, leftval)
     {
       eval(doc+lyrname+sty+".top="+topval)
		 eval(doc+lyrname+sty+".left="+leftval)
		 return
     }
	 
	 
   //----------------------------------------------------------------------------------------
   // FUNCTION: getlyrpos(lyrname, toporleft)
   // DESCRIPTION: Returns a layers top or left value (whichever was passed to the function)
   // EXAMPLE CALL: getlyrpos('mylayer', 'left') [this would return int number of pixels]
   // REQUIRES: layers name [string] and top and left values [int]  
   // AUTHOR: G.Harstad 2000 
   //----------------------------------------------------------------------------------------
     function getlyrpos(lyrname, toporleft)
     {
    	 var toporleft = (toporleft == 'top') ? '.top' : '.left'
       //alert(doc+lyrname+sty+toporleft);
       //alert((eval(doc+lyrname+sty+toporleft)));




         return parseInt(eval(doc+lyrname+sty+toporleft))
     }
	 
    
    
   //----------------------------------------------------------------------------------------
   // FUNCTION: getlyrdimension(lyrname, toporleft)
   // DESCRIPTION: Returns a layers width or height dimension in pixels
   //              (whichever was passed to the function)
   // EXAMPLE CALL: getlyrdimension('mylayer', 'height') [this would return int number of pixels]
   // REQUIRES: layers name [string] and 'width' or 'height' command [string]  
   // AUTHOR: G.Harstad 2000 
   //----------------------------------------------------------------------------------------
     function getlyrdimension(lyrname, whichdim)
     {
    	   var whichdim = (whichdim == 'width') ? getwidth : getheight
         //alert(doc+lyrname+sty+whichdim)
         return parseInt(eval(doc+lyrname+sty+whichdim))
     }	
     
     
     //-----------------------From Peter-Paul Koch ---------------------------------------------
     function findPosX(obj)
      {
      
      	var curleft = 0;
      	if (document.getElementById || document.all)
      	{
      		//alert(obj.id)
            while (obj.offsetParent)
      		{
      			curleft += obj.offsetLeft
      			obj = obj.offsetParent;
               
      		}
      	}
      	else if (document.layers)
      		curleft += obj.x;
      	return curleft;
      }
      
      function findPosY(obj)
      {
      	var curtop = 0;
      	if (document.getElementById || document.all)
      	{
      		while (obj.offsetParent)
      		{  
               curtop += obj.offsetTop
      			obj = obj.offsetParent;
      		}
      	}
	else if (document.layers)
		curtop += obj.y;
	return curtop;
}


     
    
     
      
    
    
    
    
   
     
     
     
    
   
    
   

    
   
    
   
    
   
    
    
    
   
    
    
    
   
    
    
    
    
    