<!--
ie=document.all?1:0;
n=document.layers?1:0;

//These are the variables you have to set:

//How much of the layer do you wan't to be visible when it's in the out state?
lshow=250;
//How many pixels should it move every step? 
var move=5;
//At what speed (in milliseconds, lower value is more speed)
menuSpeed=20
//Do you want it to move with the page if the user scroll the page?
var moveOnScroll=true

var tim;
var ltop;

//Object constructor
function makeMenu(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
    this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')						
	this.state=0
	this.go=0
	this.width=n?this.css.document.width:eval(obj+'.offsetWidth')
	this.height=n?this.css.document.height:eval(obj+'.offsetHeight')
	this.left=b_getleft
	this.top=b_gettop
    this.obj = obj + "Object"; 	eval(this.obj + "=this")	
}
//Get's the top position.
function b_getleft(){
	var gleft=(n) ? eval(this.css.left):eval(this.css.pixelLeft);
	return gleft;
}
function b_gettop(){
	var gtop=(n) ? eval(this.css.top):eval(this.css.pixelTop);
	return gtop;
}

function moveMenu(){
	if(!oMenu.state){
		clearTimeout(tim)
		mIn()	
	}else{
		clearTimeout(tim)
		mOut()
	}
}
//Menu in
function mIn(){
	if(oMenu.top()>-oMenu.height+lshow){
		oMenu.go=1
		oMenu.css.top=oMenu.top()-move
		tim=setTimeout("mIn()",menuSpeed)
	}else{
		oMenu.go=0
		oMenu.state=1
		if(ie)document.images.updown.src=imgDown.src;
		if(n)document.layers.ControlP2.document.images.updown.src=imgDown.src;
	}	
}
//Menu out
function mOut(){
	if(oMenu.top()<183){
		oMenu.go=1
		oMenu.css.top=oMenu.top()+move
		tim=setTimeout("mOut()",menuSpeed)
	}else{
		oMenu.go=0
		oMenu.state=0
		if(ie)document.images.updown.src=imgUp.src;
		if(n)document.layers.ControlP2.document.images.updown.src=imgUp.src;
	}	
}
/********************************************************************************
Checking if the page is scrolled, if it is move the menu after
********************************************************************************/
function checkScrolled(){
	if(!oMenu.go) oMenu.css.top=eval(scrolled)+ltop
	if(n) setTimeout('checkScrolled()',30)
}
/********************************************************************************
Inits the page, makes the menu object, moves it to the right place, 
show it
********************************************************************************/
function menuInit(){
	oMenu=new makeMenu('ControlP2')
	scrolled=n?"window.pageYOffset":"document.body.scrollTop"
//	oMenu.css.left=-oMenu.width+lshow
	ltop=(n)?oMenu.css.top:oMenu.css.pixelTop;
	oMenu.css.visibility='visible'
//	if(moveOnScroll) ie?window.onscroll=checkScrolled:checkScrolled();
}

//Initing menu on pageload
onload=menuInit;
//-->

imgUp=new Image(19,18);
imgUp.src="/common/remote/up.gif";

imgDown=new Image(19,18);
imgDown.src="/common/remote/down.gif";
