		function checkSpeed(){
			//firefox is one lameass handling more than 4 Boxes so increase speed of transitions
			/*
			if(navigator.userAgent.indexOf("Firefox")!=-1 && allBarsArr.length>4){
				scaleUpSpeed = 0.5;
				fadeInSpeed = 0.7;
				fadeOutSpeed = 0.3;
				scaleDownSpeed = 0.6;
			}*/
		}
		
		
		function setAlpha(id, value){
			var theDiv = document.getElementById(id).style;
			theDiv.opacity = (value / 100);
			theDiv.MozOpacity = (value / 100);
			theDiv.KhtmlOpacity = (value / 100);
			theDiv.filter = "alpha(opacity=" + value + ")";
		}
		function setSize(id, height){
			var theDiv = document.getElementById(id).style;
			theDiv.height = height+"px";
		}
		
		function showDiv(id){
			stopTimeout(allBarsArr[id].getTimer());
			if(!allBarsArr[id].isOpen() && !allBarsArr[id].isOpening()){				
				allBarsArr[id].startScaleUp();
				closeAllOtherBars(id);
			}
		}
		function closeAllOtherBars(id){
			var l = allBarsArr.length;
			for(var i=1; i < l; i++){
				if(id!=allBarsArr[i].getId()){
					removeDivImmediately(id);
				}
			}
		}
		
		
		function hideDiv(id){
			stopTimeout(allBarsArr[id].getTimer());
			var tmp = setTimeout('removeDivImmediately("'+id+'")', 300);
			allBarsArr[id].setTimer(tmp);
		}
		function removeDiv(id){
			if(!allBarsArr[id].isClosed()){				
				allBarsArr[id].startFadeOut();
			}
		}
		function removeDivImmediately(id){
			if(!allBarsArr[id].isClosed()){				
				allBarsArr[id].hideImmediately();
			}
		}
		
		function stopTimeout(id){
			clearTimeout(id);
		}
		
		
		
		
		
		function Bar(id, superdiv, subdiv, textcontent){
			this.id = id;
			this.superdiv = superdiv; 
			this.subdiv = subdiv;
			this.textcontent = textcontent;
			this.height = 1;
			this.alpha = 1;
			this.opening = false;
			this.closing = false;
			this.timerId = 0;
		}
		Bar.prototype.getId = function(){
			return this.id;
		}
		Bar.prototype.isOpening = function(){
			return this.opening;
		}
		Bar.prototype.isClosing = function(){
			return this.closing;
		}
		Bar.prototype.setTimer = function(id){
			this.timerId = id;
		}
		Bar.prototype.getTimer = function(){
			return this.timerId;
		}
		Bar.prototype.isOpen = function(){
			//alert(this.alpha +" | "+this.height+" | "+scaleUpTo);
			return this.alpha == 100 && this.height == scaleUpTo;
		}
		Bar.prototype.isClosed = function(){
			//alert(this.id+" | "+this.alpha +" | "+this.height+" | "+scaleUpTo);
			return this.alpha == 1 && this.height == 1;
		}
		Bar.prototype.startScaleUp = function(){
			document.getElementById(this.superdiv).style.display = "block";
			this.opening = true;
			this.closing = false;
			this.scaleUp();
		}
		Bar.prototype.startFadeOut = function(){
			this.closing = true;
			this.opening = false;
			this.fadeOut();
		}	
		Bar.prototype.scaleUp = function(){
			var thisBar = this;
			if(thisBar.opening){
			function doStep(){
				setSize(thisBar.superdiv,thisBar.height);		
				thisBar.height = thisBar.height/scaleUpSpeed;
				if(thisBar.height < scaleUpTo){
					thisBar.stepOn("up");
				}else{
					thisBar.height = scaleUpTo;
					setSize(thisBar.superdiv,thisBar.height);
					document.getElementById(thisBar.subdiv).innerHTML = thisBar.textcontent;
					thisBar.fadeIn();
				}
			}
			setTimeout(doStep, 10);
			}
		}
		Bar.prototype.fadeIn = function(){
			var thisBar = this;
			if(thisBar.opening){
				function doStep(){
					setAlpha(thisBar.subdiv,thisBar.alpha);
					thisBar.alpha = thisBar.alpha/fadeInSpeed;
					if(thisBar.alpha < 100){
						thisBar.stepOn("in");
					}else{
						thisBar.height = scaleUpTo;
						setSize(thisBar.superdiv,thisBar.height);
						document.getElementById(thisBar.subdiv).innerHTML = thisBar.textcontent;
						thisBar.alpha = 100;
						setAlpha(thisBar.subdiv,thisBar.alpha);
						thisBar.opening = false;
					}
				}
				setTimeout(doStep, 10);
			}
		}
		Bar.prototype.fadeOut = function(){
			var thisBar = this;
			function doStep(){
				setAlpha(thisBar.subdiv,thisBar.alpha);
				thisBar.alpha = thisBar.alpha*fadeOutSpeed;
				if(thisBar.alpha > 3){
					thisBar.stepOn("out");
				}else{
					thisBar.alpha = 1;
					setAlpha(thisBar.subdiv,0);
					document.getElementById(thisBar.subdiv).innerHTML = "";
					thisBar.scaleDown();
				}
			}
			setTimeout(doStep, 10);
		}
		Bar.prototype.scaleDown = function(){
			var thisBar = this;
			function doStep(){
				setSize(thisBar.superdiv,thisBar.height);					
				thisBar.height = thisBar.height*scaleDownSpeed;
				if(thisBar.height > 1){
					thisBar.stepOn("down");
				}else{
					thisBar.alpha = 1;
					setAlpha(thisBar.subdiv,0);
					document.getElementById(thisBar.subdiv).innerHTML = "";
					thisBar.height = 1;
					setSize(thisBar.superdiv,0);
					thisBar.closing = false;
				}
				
			}
			setTimeout(doStep, 10);

		}
		Bar.prototype.hideImmediately = function(){
			var thisBar = this;
				thisBar.opening = false;
				setAlpha(thisBar.subdiv,0);
				setSize(thisBar.superdiv,0);
				document.getElementById(thisBar.subdiv).innerHTML = "";
				thisBar.alpha = 1;
				thisBar.height = 1;
				thisBar.closing = false;
				document.getElementById(thisBar.superdiv).style.display = "none";
		}
		Bar.prototype.stepOn = function(act){
			var thisBar = this;
			if(act=='up'){
				thisBar.scaleUp();
			}else if(act=='in'){
				thisBar.fadeIn();
			}else if(act=='down'){
				thisBar.scaleDown();
			}else if(act=='out'){
				thisBar.fadeOut();
			}
		}

