var ID_STACK =0 
function block(x,y,w,h,bgcolor,html){
	// Create Object
	var e1 = document.createElement('DIV') ;
	e1.id = 'block_' + ID_STACK++
	e1.style.position = 'absolute';	e1.style.overflow = 'hidden' ;	e1.style.top =  y||0 ;	e1.style.left =  x||0 ; 	e1.style.width = w||0 ; 	if(h) e1.style.height = h ; 	e1.style.display = 'block' ;	e1.style.backgroundColor = bgcolor || '';	e1.appendChild(document.createTextNode(html || ''));

	// Add Methods
	e1.setClip = function(clip){ this.style.clip =  'rect('+clip[0]+'px '+clip[1]+'px '+clip[2]+'px '+clip[3]+'px)';}
	e1.hide = function(){ this.style.visibility = 'hidden' }
	e1.show = function(){ this.style.visibility = 'visible'	}
	e1.getY = function(){ return (this.style.left == '') ? 0 : parseInt(this.style.left) }
	e1.getX = function(){ return (this.style.top == '') ? 0 : parseInt(this.style.top) }
	e1.moveTo = function(x,y){ if(x) this.style.top = x; if(y) this.style.left = y; }
	// Return Object
	return e1
}

function sliderMenu(x,y,cssclass,html,width){
	var w = width || 100
	this.block = new block(x,y,w,17)
	this.block.className = cssclass
	this.block.height = 17
	this.block.text = new block(0,0,w)
	this.block.appendChild(this.block.text)
	this.block.text.innerHTML = html
	this.block.style.cursor = 'hand'
	this.block.godown = false
	//this.block.style.height = this.block.text.height
	this.block.animate = function(){
		clearTimeout(this.timer)
		var h = this.height
		if(this.godown && this.height <= this.text.scrollHeight)
			this.height+=5
		else if(!this.godown && this.height > 17) this.height-=5

		this.setClip([0,200,this.height,0])

		if(h != this.height)
			this.timer = setTimeout('document.getElementById("'+this.id+'").animate()',10)
	}
	this.block.onmouseover = function(){

		this.godown = true
		this.animate()

	}

	this.block.onmouseout = function(){
		this.godown = false
		this.animate()
	}
	document.body.appendChild(this.block)
	this.block.setClip([0,200,17,0])
	this.block.style.height = this.block.text.scrollHeight
}