function menuItem (objNr){

	this.obj = document.getElementById("item" + objNr);
	var objNumber = objNr;
	var minWidth = 39;
	var maxWidth = 185;
	var speed = 1;
	
	var increase = 15;
	var increaseSmall = 1;
	var smallWidth = 30;
	
	this.width = minWidth;
	this.timeInId;
	this.timeOutId;
	this.timeNormalId;
	this.timeSmallId;
	
	this.moveIn = function(){
		clearTimeout(this.timeOutId);
		clearTimeout(this.timeNormalId);
		clearTimeout(this.timeSmallId);
		var me = this;
		if(this.width<maxWidth)
		{
			this.width+= (increase);
			this.obj.style.width = this.width + "px";
			this.timeInId = setTimeout(function(){me.moveIn();},speed/2);
		}
	}
	this.moveOut = function(){
		clearTimeout(this.timeInId);
		clearTimeout(this.timeNormalId);
		clearTimeout(this.timeSmallId);
		var me = this;
		if(this.width>minWidth)
		{
			this.width-= (increase);
			this.obj.style.width = this.width + "px";
			this.timeOutId = setTimeout(function(){me.moveOut();},speed);
		}
		else {
			this.obj.style.width = minWidth + "px";
		}
		
	}
	
	this.makeSmall = function(){
		clearTimeout(this.timeNormalId);
		clearTimeout(this.timeInId);
		clearTimeout(this.timeOutId);
		var me = this;
		if(this.width>smallWidth)
		{
			this.width-= increaseSmall;
			if(this.width>minWidth)
				this.width-= increase;
			this.obj.style.width = this.width + "px";
			this.timeSmallId = setTimeout(function(){me.makeSmall();},speed);
		}	
	}
	
	this.makeNormal = function(){
		clearTimeout(this.timeSmallId);
		clearTimeout(this.timeInId);
		clearTimeout(this.timeOutId);
		var me = this;
		if(this.width<minWidth)
		{
			this.width+= increaseSmall;
			this.obj.style.width = this.width + "px";
			this.timeNormalId = setTimeout(function(){me.makeNormal();},speed);
		}	
	}
	
	this.makeOtherSmall = function(){
		this.moveIn();
		for(i=1;i<12;i++)
		{
			if(i!=objNumber)
				eval("item"+i+".makeSmall()");
		}
	}
	
	this.makeAllNormal = function(){
		this.moveOut();
		for(i=1;i<12;i++)
		{
			if(i!=objNumber)
				eval("item"+i+".makeNormal()");
		}
	}

} //end menuItem Class

function buttomMenu(id)
{
	this.obj = document.getElementById(id);
	this.height = obj.style.height;
	maxHeight = 100;
	
	this.movein = function() {
		var me = this;
		if(this.height<maxHeight)
		{
			this.height += 1;
			this.obj.style.height = this.height + "px";
			this.timeInId = setTimeout(function(){me.moveIn();},1);
		}	
	}
}//end buttomMenu

function centerMenu()
{
	var menu = document.getElementById("menu");

	menu.style.left= (document.body.offsetWidth - 400) / 2 + "px";

}
