var LastDivId, LastImageId;
var SelectedImage = "/images/layout/left/vinieta_f2.gif";
var NormalImage = "/images/layout/left/vinieta.gif";

function ShowHideDiv(DivId,SelectedId,ImageId)
{
	if(LastDivId && LastDivId != DivId)
	{
		document.getElementById(LastDivId).style.display = 'none';
		document.getElementById(LastImageId).src = NormalImage;
	}
	
	if(SelectedId != DivId)
	{
		ImageObj = document.getElementById(ImageId);
		DivObj = document.getElementById(DivId);
		if(DivObj.style.display=='none')
		{
			DivObj.style.display='inline'
			ImageObj.src = SelectedImage;
		}
		else
		{	
			DivObj.style.display='none'
			ImageObj.src = NormalImage;
		}
		LastDivId = DivId;
		LastImageId = ImageId;
	}
}

/***************Rotativo Vertical *******************/
var LayerHeight = new Number(0);
var Stop = new Number(0);
var Speed = new Number(1);
var Pixeles = new Number(7);

function initVRotative(LayerName)
{
	Layer = document.getElementById(LayerName);
	if (Layer)
	{
		LayerHeight = Layer.offsetHeight - 180;
		
		Inicio = 1;
		Layer.style.top = Inicio;
	}
}

function ChangePosition(LayerName,Top)
{
	Layer  = document.getElementById(LayerName);
	Px = new String(Layer.style.top);
	Px = Px.replace('px','');
	Px = new Number(Px);
	
	//alert(BottomPx);
	if(Top==1)
		Layer.style.top = Px + Pixeles;
	else
		Layer.style.top = Px - Pixeles;
}

function MoveContinuousDown(LayerName,Init)
{
	Layer  = document.getElementById(LayerName);
	BottomPx = new String(Layer.style.top);
	BottomPx = BottomPx.replace('px','');
	BottomPx = new Number(BottomPx);
	
	if(Init)
		Stop=0;
	
	if(Stop!=1 && BottomPx > - (LayerHeight-210))
	{
		ChangePosition(LayerName);
		movedown = setTimeout("MoveContinuousDown('"+LayerName+"')",Speed);
	}
}

function MoveContinuousUp(LayerName,Init)
{
	Layer  = document.getElementById(LayerName);
	TopPx = new String(Layer.style.top);
	TopPx = TopPx.replace('px','');
	TopPx = new Number(TopPx);
	
	if(Init)
		Stop=0;
	
	if(Stop!=1 && TopPx <0)
	{
		ChangePosition(LayerName,1);
		moveup = setTimeout("MoveContinuousUp('"+LayerName+"')",Speed);
	}
}

function StopDiv()
{
	Stop=1;		
}