var curpage=0;
var timer=null;
//var imagesWidth=null;
//var imagesHeight=null;
var slideHeight=0;
var stopped = false;
var numpages = 0;
var arraySlides;
var obj;

function test()
{}


function fnc_next()
{
	if (curpage > numpages-1)
	{
		curpage=0;
	}

	obj=arraySlides[curpage];
	obj.style.visibility = "hidden";
	obj.style.display = "none";
	obj.style.height = "1px";

	curpage++;

	if (curpage>numpages - 1) 
	{
		curpage = 0;
	}

	obj=arraySlides[curpage];
	obj.style.visibility = "visible";
	obj.style.display = "block";
	obj.style.height = slideHeight + "px";

	if(!stopped)
	{
		clearTimeout(timer);
		start();
	}

}

function fnc_prev()
{
	if (curpage>numpages)	curpage = 0;

	//Obtengo la nota Actual
	obj= arraySlides[curpage];

	if(obj)
	{
		obj.style.visibility = "hidden";
		obj.style.display = "none";
		obj.style.height = "1px";
	}
	
	curpage--;
	if (curpage<0)	curpage = numpages-1;

	//Obtengo la nota Anterior
	obj=arraySlides[curpage];
	if(obj)
	{
		obj.style.visibility = "visible";
		obj.style.display = "block";
		obj.style.height = slideHeight + "px";
	}

	if(!stopped)
	{
		clearTimeout(timer);
		start();
	}
}



function stop() 
{
	if (!(stopped)) 
	{
		clearTimeout(timer);
		stopped=true;
	}
}
function start() 
{
	timer=setTimeout('fnc_next()',10000);
	stopped=false;
}

function firsthideImgs()
{
	arraySlides = document.getElementsByName("rota");

	numpages = arraySlides.length;
	//Oculto cada una de las imagenes
	for (i=0;i <= numpages;i++)
	{
		var obj=arraySlides[i];
		if(obj)
		{
			if(i==0) 
			{
				imagesWidth	 = document.getElementById('imgSlide').width;
				imagesHeight = document.getElementById('imgSlide').height;
			}
			
			slideHeight = imagesHeight + ((muestraTitulo==0)?88:0);
//			slideHeight = imagesHeight;
			obj.style.visibility="hidden";
			obj.style.display = "none";
			obj.style.height = "1px";
			obj.style.overflow ="hidden";
			obj.style.top = "0px";
			obj.style.position = "relative";
			obj.style.border = "0px solid";
			obj.style.zIndex = 1;
		}
	}

	//Ubico la botonera segun el alto de la primer imagen

	//Muestro la primer imagen
	curpage = 0;
	var firstSlide = arraySlides[0];
	if(firstSlide)
	{
		firstSlide.style.visibility = "visible";
		firstSlide.style.display = "block";
		firstSlide.style.height = imagesHeight + "px";
		slideHeight = imagesHeight;
		start();
	}
}


function firsthide()
{
	

	arraySlides = document.getElementsByName("rota");

	numpages = arraySlides.length;

	//Oculto cada una de las imagenes

	//for (i=0;i < numpages ;  i ++)
	//{
		//obj=arraySlides[i];
		//if(obj)
		//{
			//if(i==0) 
			//{
				//imagesWidth	 = document.getElementById('imgSlide').width;
				//imagesHeight = document.getElementById('imgSlide').height;
			//}

			//slideHeight = imagesHeight + 83;
			<!-- obj.style.visibility="hidden";
			//obj.style.display = "none";
			//obj.style.height = "1px";
			//obj.style.overflow ="hidden";
			//obj.style.top = "0px";
			//obj.style.position = "relative";
			//obj.style.border = "0px solid";
			//obj.style.zIndex = 1;
		//}
	//} -->

	//Ubico la botonera segun el alto de la primer imagen
	//if (numpages > 1)
	//{
		////var botonera=document.getElementById('botoneraSlide');
		//if(botonera)
		//{
			//var top = imagesHeight - 18;
			//var left = imagesWidth - 95;
			//botonera.style.visibility = "visible";
			//botonera.style.display = "block";
			//botonera.style.top = top + "px";
			//botonera.style.left = left+ "px";
			//botonera.style.zIndex = "5";
		//}
	//}

	//Muestro la primer imagen
	//curpage = 0;
	//var firstSlide = arraySlides[0];
	//if(firstSlide)
	//{
		//firstSlide.style.visibility = "visible";
		//firstSlide.style.display = "block";
		//firstSlide.style.height = slideHeight + "px";
		//start();
	//}
	

}
