function changeImage( namePhoto )
{
	var objeto = document.getElementById('fotografiasFotos');
	objeto.style.visibility = "hidden";
	var previousInnerHTML = new String();
	previousInnerHTML = objeto.innerHTML;

	//previousInnerHTML = previousInnerHTML.concat("hola");
	previousInnerHTML = '<img src="imagesWeb/fotos/'+namePhoto+'" alt="imagen">';
	objeto.innerHTML = previousInnerHTML;
	objeto.style.visibility = "visible";
}

function changeVideo( refVideo )
{
	var objeto = document.getElementById('reproductorVideo');
	objeto.style.visibility = "hidden";
	var previousInnerHTML = new String();
	previousInnerHTML = objeto.innerHTML;

	previousInnerHTML = '<object style="margin-top:25px; background-color:#000;" width="800" height="450" type="application/x-shockwave-flash" data="http://www.youtube.com/v/'+refVideo+'&amp;hl=es&amp;fs=1"><param name="movie" value="http://www.youtube.com/v/'+refVideo+'&amp;hl=es&amp;fs=1" /></object>'
	
	/*'<object style="margin-top:25px; background-color:#000;" width="800" height="450" type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $arrayImagenesMiniatura[0]; ?>&amp;hl=es&amp;fs=1">
<param name="movie" value="http://www.youtube.com/v/<?php echo $arrayImagenesMiniatura[0]; ?>&amp;hl=es&amp;fs=1" /></object>'*/
	
	objeto.innerHTML = previousInnerHTML;
	objeto.style.visibility = "visible";
}

var incrementVal = 50;
var maxScrollFotos = -1150;
var maxScrollVideos = 0;
var timer;
var flag;

function scroll_fotos(flag)
{
	var obj = document.getElementById("contenedor_miniaturas");
	//var isIE6 = (document.documentElement.clientHeight)? true : false;

	var Y = parseInt(obj.style.left);
	//var cY = (isIE6)?document.documentElement.clientHeight-173 :((document.all)? document.body.clientHeight-173:window.innerHeight - 173);
	if(flag==1 && Y<0)
	{
		obj.style.left = (Y+incrementVal)+"px";
		timer = setTimeout("scroll_fotos(1)",incrementVal*2);
	//}else if(flag==-1 && Y>0)
	}
	//else if(flag==-1)
	else if(flag==-1 && Y>maxScrollFotos)
	{
		obj.style.left = (Y-incrementVal)+"px";
		timer = setTimeout("scroll_fotos(-1)",incrementVal*2);
	}
	else
	{
		//alert("Mira: " + Y);
		clearTimeout(timer);
	}
}


function scroll_videos(flag)
{
	var obj = document.getElementById("contenedor_miniaturas_videos");
	//var isIE6 = (document.documentElement.clientHeight)? true : false;

	var Y = parseInt(obj.style.left);
	//var cY = (isIE6)?document.documentElement.clientHeight-173 :((document.all)? document.body.clientHeight-173:window.innerHeight - 173);
	if(flag==1 && Y<0)
	{
		obj.style.left = (Y+incrementVal)+"px";
		timer = setTimeout("scroll_videos(1)",incrementVal*2);
	//}else if(flag==-1 && Y>0)
	}
	//else if(flag==-1)
	else if(flag==-1 && Y>maxScrollVideos)
	{
		obj.style.left = (Y-incrementVal)+"px";
		timer = setTimeout("scroll_videos(-1)",incrementVal*2);
	}
	else
	{
		//alert("Mira: " + Y);
		clearTimeout(timer);
	}
}



