/* 
 * Intro
 * 
 */
var introOut=false;
$(document).ready(function(){
  
    var $flashContainer=$('#col');
    
    var $cortina=$('<div class="home-cortina" />').appendTo($('body'));
    
    
    var opts = {
        lines: 128, // The number of lines to draw
        length: 0, // The length of each line
        width: 3, // The line thickness
        radius: 65, // The radius of the inner circle
        color: '#F00', // #rgb or #rrggbb
        speed: 0.2, // Rounds per second
        trail: 80, // Afterglow percentage
        shadow: false // Whether to render a shadow
    };
    var target = document.getElementById('loading-animation');
    var spinner = new Spinner(opts).spin(target);
    
    var $ray1 =$('<div class="i-v-container anim-node">'
        +'<img id="ray1" src="img/banda-ver-1.png" class="common-start i-vertical">'
        +'<span class="i-vertical middle-shadow  common-start"></span>'
        +'</div>').appendTo($('body'));
    $ray1.find('.common-start').removeClass('common-start',2000,function(){
          $('.i-v-container').slideUp('slow');
    });
    $cortina.fadeOut(5000);
    $('#col').hide().delay(1500).fadeIn(1000,function(){
    	//$(this).css({'filter':''});
    	$(this).removeAttr('style');
    });
    $('#loading-animation').doTimeout(5000,function(){
       finalize_intro();
    })
    
    $('#col').click(function(){
        finalize_intro();
    });
  
});

function finalize_intro(){
    if(!introOut){
        introOut=true;
     $('#col *').css({filter:'inherit'}).fadeOut(1000);
     $('#loading-animation').css({filter:'inherit'}).fadeOut(1000,function(){
     	
     });
    }
}

function show_collections(){
     $('#supersized').fadeIn(1000,function(){
                $('#trs_text').show(1000);
                $('#torras_text').show(1000);
            });
            $('#col, .i-v-container .anim-node').fadeOut(750);
            $(window).trigger('resize');
}


