////////////////////////////////////////////////////////////////////////////////////
//  JavaScript Layer <div> tools  v1.0  
//
//  Last modified 2003-09-12.
//
//  Browser Support: Netscape 4.x, Mozilla-engine 1.x, IE 5+
//
////////////////////////////////////////////////////////////////////////////////////

var moving=0;
var NN4, NN6, IE, bName=navigator.appName; 
		
		
//--Sets Browser Variable.
if(bName.indexOf("Microsoft")!=-1)
  IE=true;  //--Internet Explorer.
if(bName.indexOf("Netscape")!=-1)
  if(parseInt(navigator.appVersion)<5)
    NN4=true;  //--Versions 4.x and lower.
  else
    NN6=true;  //--Versions 5.x and Higher.

/****************
Description:  Returns an layer object independant of browser.
Parameters:
  object       - String name of id tag for object to return.
*****************/	
function getDiv(object){
  if (IE)
    thisdiv = eval(object+".style");
  if (NN4)
    thisdiv = eval("document."+object);
  if(NN6)
    thisdiv = eval("document.getElementById('"+object+"').style");
  return thisdiv;
  }

/****************
Description:  Moves a given layer to x and y coordinates.
Parameters:
  object       - String name of id tag for object to return.
	x            - x coordinate to move to(Moz-engine need specification of px, etc). 
	y            - y coordinate to move to(Moz-engine need specification of px, etc).
*****************/
function moveTo(object, x, y){
    thisdiv = getDiv(object);
    thisdiv.left=x;
		thisdiv.top=y;
    }


/****************
Description:  Slides a given layer to x and y coordinates.
Note:  Do not call if(moving), multiple calls can cause conflicts.
Parameters:
  object       - String name of id tag for object to return.
	x            - x coordinate to move to(Moz-engine need specification of px, etc).
	y            - y coordinate to move to(Moz-engine need specification of px, etc).
*****************/
function slideTo(object, x, y){
  moving[object]=true;
  thisdiv = getDiv(object);
  thisdiv.left=parseInt(thisdiv.left)+(x-parseInt(thisdiv.left))/2;
  if(parseInt(thisdiv.left)<x-1||parseInt(thisdiv.left)>x+1)
    setTimeout("mover('"+object+"',"+x+","+y+");", 40);
  else
    moving[object]=false;
  }

/****************
Description:  Hides a given layer.
Parameters:
  object       - String name of id tag for object to return.
	onOff        - Boolean value indicating on or off.
*****************/  
function ShowDiv(object, onOff){
	thisdiv=getDiv(object);
	if(onOff)
		thisdiv.visibility='visible';
	else
		thisdiv.visibility='hidden';
  }
