		//ulMoreInfo.js
		//Created By: John Chapman
		//Created Date: 3/11/03
		
		//This javascript file is required for proper execution of the ulMoreInfo
		// custom control.  This file handles all client side scripting of the popup
		// layer.
		
		//Global variables defining mouse location
		var xPos=0;
		var yPos=0; 
		
		var isShowing = new Boolean(false);
		isShowing=false;
		var visLayer; //id of the visible layer
		var ifLayer; //id of the coverup IFRAME Layer

    //store the old function which was called onmousemove
		var old_capture;

		function initMouse()
		{
		 old_capture=document.onmousemove;
		 if (document.all || document.getElementById) 
		 { 
			document.onmousemove = captureMouse;		  
		 }	  
		 else if (document.layers) 
		 { 
		  document.captureEvents(Event.MOUSEMOVE);
			document.onmousemove = captureMouse;
		 }
		 
	  }
		
		//put the old mouse movement capture back the way it was before we used my control
		function releaseMouse()
		{
		 document.onmousemove=old_capture;
		}

		//Function finds the current X and Y values of the mouse relative to the
		//absolute top left of the page (not just the current viewable screen
		function captureMouse(e)
		{
		 if (document.all)
		 {
		  xPos = window.event.x+document.body.scrollLeft;
      yPos = window.event.y+document.body.scrollTop;	
		 }
		 else if (document.layers || document.getElementById)
		 {
		  xPos=e.pageX;
			yPos=e.pageY;
		 }
		 yPos+=20; //add a buffer so it is not covered by the mouse pointer
		 if (isShowing)
		 {
		  setLayerXY(xPos, yPos);
		 }
		}
	
		function setLayerXY(x, y)
		{
		 var command1;
		 var command2;
		 if (document.all) //IE
		 {
			command1="document.all['"+visLayer+"'].style.left = " + x;
      			command2="document.all['"+visLayer+"'].style.top = " + y;		
		
			command3="document.all['"+ifLayer+"'].style.left = " + x;
      			command4="document.all['"+ifLayer+"'].style.top = " + y;		
		 }
		 else if (document.layers) //Netscape
		 {
			command1="document.layers['"+visLayer+"'].top = " + x;
			command2="document.layers['"+visLayer+"'].left = " + y;
		
			command3="document.layers['"+ifLayer+"'].top = " + x;
			command4="document.layers['"+ifLayer+"'].left = " + y;
		 }
		 else if (document.getElementById) //Navigator 6
		 {
		  	command1="document.getElementById('"+visLayer+"').style.left=" + x;
			command2="document.getElementById('"+visLayer+"').style.top=" + y;			
		
			x-=2;
			y-=2;
		  	command3="document.getElementById('"+ifLayer+"').style.left=" + x;
			command4="document.getElementById('"+ifLayer+"').style.top=" + y;			
		 }
		 eval(command1);
		 eval(command2);
		 eval(command3);
		 eval(command4);
		}
		
		function ShowPopUp(layer_id,layer_id_if)
		{
		 var command;
		 var element;
		 //var elementCommand;
		 visLayer=layer_id;
		 ifLayer=layer_id_if;
 		 initMouse();
		 //set initial position for IE so that we do not see a jumping layer
		 if (document.all) //IE
		 {
		  captureMouse(this);
		 }
		  
		 setLayerXY(xPos, yPos); //set the current layer position		 


		 if (document.all) //IE
		 {
			command="document.all['"+layer_id+"'].style.visibility = 'visible'";
			element = document.all[layer_id];
		 }
		 else if (document.layers) //Netscape
		 {
		  command="document.layers['"+layer_id+"'].visibility = 'visible'";
		  element = document.layers[layer_id];
		 }
		 else if (document.getElementById) //Navigator 6
		 {
			command="document.getElementById('"+layer_id+"').style.visibility='visible'";
			element = document.getElementById(layer_id);
		 }
		 eval(command);
		 isShowing=true;
		 visLayer=layer_id;

		 


		 //Finding an IFRAME this is done in 3 ways for sake of consistency with older code
		 if (document.all) //IE
		 {
			frameel = document.all[layer_id_if];
			frameel.style.visibility = 'visible';
		 	frameel.style.enabled = 'false';
		 
		 }
		 else if (document.layers) //Netscape
		 {
		  frameel = document.layers[layer_id_if];
			frameel.style.visibility = 'visible';
		 frameel.style.enabled = 'false';
		 
		 }
		 else if (document.getElementById) //Navigator 6
		 {
			frameel = document.getElementById(layer_id_if);
		 }
		 //Unhides an IFRAME and sets it's size to same size as popup (assumption that this will work we 
		 //May have to calculate offsets for element since there may be more than one element 
		 //don't forget to thest this with IE on the mac otherwise there will be many people upset
		 //frameel.style.left = element.offsetLeft;
		 //frameel.style.top = element.offsetTop;
		 frameel.style.height = element.offsetHeight;
		 frameel.style.width = element.offsetWidth;
		 element.style.visibility='hidden';
		 element.style.visibility='visible';
		 
    }

		function HidePopUp(layer_id,layer_id_if)
		{
		 var command;
		 visLayer=layer_id;
		 releaseMouse();
		 if (document.all)
		 {
		 	command="document.all['"+layer_id+"'].style.visibility = 'hidden'";
		 }
		 else if (document.layers)
		 {
		  command="document.layers['"+layer_id+"'].visibility = 'hidden'";
		 }
		 else if (document.getElementById)
		 {
		  command="document.getElementById('"+layer_id+"').style.visibility='hidden'";
		 }
		 eval(command);
		 isShowing=false;
		 if (document.all) //IE
		 {
			frameel = document.all[layer_id_if];
		 }
		 else if (document.layers) //Netscape
		 {
		  frameel = document.layers[layer_id_if];
		 }
		 else if (document.getElementById) //Navigator 6
		 {
			frameel = document.getElementById(layer_id_if);
		 }
		 //Hiding an IFRAME this will hide underlaying cover for SELECT Elements 
		 //This should not case a problem
		 frameel.style.visibility = 'hidden';	 
		}

