imgAnimationList = new Array("01","02","03","04","05");
imgAnimationIndex = 0;


function setIdioma(element) { document.location.href="index.aspx?appIdioma="+element; }


function loadHomeAnimation()
{
    if( imgAnimationIndex >= imgAnimationList.length ) { imgAnimationIndex = 0; }
        actionHomeAnimation(imgAnimationIndex);
    imgAnimationIndex ++;
}

    function actionHomeAnimation(element)
    {
        setTimeout("showHomeAnimation("+element+");", 0);       //SHOW
        setTimeout("hideHomeAnimation("+element+");", 3000);    //HIDE
    }

    function showHomeAnimation(element)
    {
        $("#img" + imgAnimationList[element]).fadeIn(1500);
    }

    function hideHomeAnimation(element)
    {
        $("#img" + imgAnimationList[element]).fadeOut(1500, function() { loadHomeAnimation(); } );
    }


function showZoom(productId, imageOrder)
{
    $('#zoom-'+productId+'-1').hide();
    $('#zoom-'+productId+'-2').hide();
    $('#zoom-'+productId+'-3').hide();
    $('#zoom-'+productId+'-4').hide();

    $('#zoom-'+productId+'-'+imageOrder).show();
}


function activateFancybox(Id)
{
    $("#"+Id).fancybox({
	    'titlePosition' : 'inside',
        'transitionIn' : 'none',
		'transitionOut' : 'none'
    });
}


function buyIt(element)
{
    $("#productId").val(element);
    $("#form_productBuy").submit();
}


function validateDates()
{
    $("#frm").submit();
}


function printYear() { document.write(new Date().getFullYear()); }
