/* action_global.js yoss3d */
//ocultar mostarr
function mostrarDiv(n_tipo1, id, i, t)
{
	//alert(i);
	$('#'+n_tipo1+id+'_'+i).fadeIn('normal');
	if(i<=t){
	i++;
		setTimeout("mostrarDiv('"+n_tipo1+"',"+id+","+ i +","+ t +")",500);
	}
}
function ocultarDiv(n_tipo1, id, i, t, id2, t2)
{
	//alert(i);
	$('#'+n_tipo1+id+'_'+i).fadeOut('fast');
	if(i>=1){
	i--;
		setTimeout("ocultarDiv('"+n_tipo1+"',"+id+","+ i +","+ t +","+ id2 +","+ t2 +")",200);
	}else{
		$('#'+n_tipo1+id2).fadeIn('normal');
		mostrarDiv(n_tipo1, id2, 1, t2);	
	}
}
function standBy_show(n_tipo1, id_s, t)
{
$('#'+n_tipo1+id_s).fadeIn('normal');
	mostrarDiv(n_tipo1, id_s, 1, t);
}
function standBy_hide(n_tipo1, id_h, t, id_s, t2)
{
	$('#'+n_tipo1+id_h).fadeOut('normal');
	ocultarDiv(n_tipo1, id_h, t, t, id_s, t2);
}


function animChange2(n_tipo1)
{
	var act_tap_1=$("#activo_"+n_tipo1).val();//tap que esta activo
	var total_tap_1=$("#total_"+n_tipo1).val();//total de los tap
	var play_tap_1=$("#play_"+n_tipo1).val();//total de los tap
	//var total_X_tap=$("#total_X_tap").val();//total de los div de cada tap
	//alert('pase: activo '+act_tap);
	
	var standBy = 220; ///tiempor de espera
	var recursiva = 5000;
	
	if((act_tap_1>=total_tap_1) || (act_tap_1==''))
	{
		next_1=0;
	}
	else
	{
		next_1=act_tap_1;
	}
	var total_h_tap=$("#total_s_"+n_tipo1+act_tap_1).val();//total hide tap
	id_show_1= parseInt(next_1) +1;
	var total_s_tap=$("#total_s_"+n_tipo1+id_show_1).val();//total de los tap to show
	
	id_hide_1 = act_tap_1;
	
	////HIDEEE
	if(id_hide_1!=0){
		ocultarDiv(n_tipo1, id_hide_1, total_h_tap, total_h_tap);
		setTimeout("standBy_hide('"+n_tipo1+"', "+ id_hide_1+", "+total_h_tap+", "+ id_show_1+", "+total_s_tap+")",standBy*total_h_tap);
	}
		
	////Show
	if(id_hide_1!=0){
	//setTimeout("standBy_show('"+n_tipo1+"', "+ id_show_1+", "+total_s_tap+")",standBy*total_h_tap);
	}else{
		standBy_show(n_tipo1, id_show_1, total_s_tap);
	}
	//t_Show_Hide(2, id_hide);//oculto
	//t_Show_Hide(1, id_show);//muestro
	$("#activo_"+n_tipo1).val(id_show_1);//guardoactivo
	if(play_tap_1!=1){// 1= se ejecuta una sola vez
		setTimeout("animChange('"+n_tipo1+"')",recursiva);
	}
}

function animChange(n_tipo1)
{
	var act_tap_1=$("#activo_"+n_tipo1).val();//tap que esta activo
	var total_tap_1=$("#total_"+n_tipo1).val();//total de los tap
	var play_tap_1=$("#play_"+n_tipo1).val();//total de los tap
	//var total_X_tap=$("#total_X_tap").val();//total de los div de cada tap
	//alert('pase: activo '+act_tap);
	
	var standBy = 220; ///tiempor de espera
	var recursiva = 5000;
	
	if((act_tap_1>=total_tap_1) || (act_tap_1==''))
	{
		next_1=0;
	}
	else
	{
		next_1=act_tap_1;
	}
	var total_h_tap=$("#total_s_"+n_tipo1+act_tap_1).val();//total hide tap
	id_show_1= parseInt(next_1) +1;
	var total_s_tap=$("#total_s_"+n_tipo1+id_show_1).val();//total de los tap to show
	
	id_hide_1 = act_tap_1;
	
	////HIDEEE
	if(id_hide_1!=0){
		ocultarDiv(n_tipo1, id_hide_1, total_h_tap, total_h_tap);
		setTimeout("standBy_hide('"+n_tipo1+"', "+ id_hide_1+", "+total_h_tap+", "+ id_show_1+", "+total_s_tap+")",standBy*total_h_tap);
	}
		
	////Show
	if(id_hide_1!=0){
	//setTimeout("standBy_show('"+n_tipo1+"', "+ id_show_1+", "+total_s_tap+")",standBy*total_h_tap);
	}else{
		standBy_show(n_tipo1, id_show_1, total_s_tap);
	}
	//t_Show_Hide(2, id_hide);//oculto
	//t_Show_Hide(1, id_show);//muestro
	$("#activo_"+n_tipo1).val(id_show_1);//guardoactivo
	if(play_tap_1!=1){// 1= se ejecuta una sola vez
		setTimeout("animChange('"+n_tipo1+"')",recursiva);
	}
}

//otro

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
function showDiv(id_show, i, t)
{
	for(a=1; a<=6; a++){
			$('#tap_'+id_show+'_'+a).fadeIn('normal');
		}
	$('#tap_'+id_show).fadeIn('normal');
}
function hideDiv(id, i, t)
{
	for(a=0; a<=t; a++){
	$('#tap_'+id+'_'+i).fadeOut('normal');
	}
}
function esperar(id_show)
{
$('#tap_'+id_show).fadeIn('normal');
	showDiv(id_show, 1, 6);
}


function Mycarrusel()
{
	var id_hide;
	var id_show;
	var act_tap;
	var next;

	var act_tap=$("#activo_tap").val();//tap que esta activo
	var total_tap=$("#total_tap").val();//total de los tap
	//var total_X_tap=$("#total_X_tap").val();//total de los div de cada tap
	
	if((act_tap>=total_tap) || (act_tap=='0'))
	{
		next=0;
	}
	else
	{
		next=act_tap;
	}
	
	id_show= parseInt(next) +1;
	id_hide = act_tap;
	////HIDEEE
	if(id_hide!=0){
		for(a=0; a<=6; a++){
			$('#tap_'+id_hide+'_'+a).fadeOut('normal');
		}
		$('#tap_'+id_hide).fadeOut('normal');
		setTimeout("showDiv("+id_show+", 1, 6)",500);
	}else{
		showDiv(id_show, 1, 6);
	}
	
	$("#activo_tap").val(id_show);//guardoactivo
	setTimeout("Mycarrusel()",8000);
}