var block = false;
var hid= 0;
var steps = 10;
var stepTime = 100;

function changeTab(id) 
{
	var num = parseFloat(id);
	if(hid != num && !block)
	{
		//block = true;
		hideTab();
		showTab(num);
	}
}

function hideTab() 
{
	var bottomImgText = 'bottomImgText_'+hid;
	if(hid > 0) 
	{
		var id = "div_"+hid;
		var bottomImgText = 'bottomImgText_'+hid;
		var bottom = document.getElementById(bottomImgText);
		
		if(id)
		{
			if(animate == 0)
			{
				var div = document.getElementById(id);
				div.style.width = '0px';
			}
			else
				new Rico.Effect.Size( id,"0",null,stepTime, steps, "");
		}
		
		if(bottomImgText)
		{
			 bottom.style.display = 'block';
			 new Rico.Effect.FadeTo( bottomImgText, 1,  500,  10, '' );
		}
	}
}

function showTab(num) 
{

	hid = num;
	
	var bottomImgText = 'bottomImgText_'+hid;
	var bottom = document.getElementById(bottomImgText);
	var name = "div_"+num
	if(name)
	{
		if(animate == 0)
		{
			var div = document.getElementById(name);
			div.style.width = BTsize+'px';
		}
		else
			new Rico.Effect.Size( name,	BTsize,null,stepTime, steps , "");      			
	}
	

	if(bottomImgText) {
		
		 new Rico.Effect.FadeTo( bottomImgText, .0,  500,  10, '' );
		 var temp1 ='setDisplay("'+bottomImgText+'")';
		 setTimeout(temp1,500);
	}
}

function setDisplay(el){
	
	o = document.getElementById(el);
	o.style.display = 'none';
}


function showTab2(num) 
{

	hid = num;
	var bottomImgText = document.getElementById('bottomImgText_'+hid);
	var name = document.getElementById("div_"+num);
	
	if(name){
		name.style.width = 	BTsize+"px";      			
	}
	if(bottomImgText) {
			var newOpacity = 0;
		  bottomImgText.style.filter = "alpha(opacity:"+Math.round(newOpacity*100)+")";
			bottomImgText.style.opacity = newOpacity;
			bottomImgText.style.display = 'none';
	}
}
