/**
 * JS
 * (c) 2007 Darío G. Ruellan / ecimTech
 * http://www.ecimtech.com.ar
 */

var gindex = 0;

function slideShow(show)
{
	if ( !show[gindex] ) {
		gindex = 0;
	}
	
	var item = show[gindex];
	gindex++;
	
	var animframe	= $("#animframe");

	animframe.append(	"<div id=\"cover\"><img src=\"files/coverbase/"+item[3]+"\" alt=\"tapa\" /></div>"+
							"<div id=\"title\">"+item[1]+"</div>"+
							"<div id=\"desc\">"+item[2]+"</div>" );
	
	if ( !$("#buttons").is("div") ) {
		animframe.append("<div id=\"buttons\"><a href=\"catalogo_popup.php?id=" + item[0] + "\" id=\"masinfo\"><img src=\"images/btn_masinfo.png\" alt=\"más info\" /></a> &nbsp; <a href=\"catalogo.php\"><img src=\"images/btn_catalogo.png\" alt=\"catálogo\" /></a></div>");
	} else {
		$('#masinfo').attr("href","catalogo_popup.php?id=" + item[0]);
	}

	$('#cover img').load(function()
	{
		$('#cover').animate({
				left: 18, opacity: 'show'
			}, 900
		);
		
		$('#title').fadeIn("slow",function()
		{
			$('#desc').slideDown("slow",function()
			{
				$('#buttons').show("normal");
			});
		});
		MyPopup();
		setTimeout(function()
		{
			$("#cover").fadeOut("fast",function(){
				$(this).remove();
				slideShow(show);
			});
			$("#title").fadeOut("fast",function(){
				$(this).remove();
			});
			$("#desc").fadeOut("fast",function(){
				$(this).remove();
			})
			
			
		},7000)
		
	});
}


