(function($) {

  function init() {


	    	var $h = $('#cabecera');

		    $h.prepend('<div class="bg"></div><div class="bg bg2"></div>');

		    $h.find('div.bg').css({
		      width: $h.width() + 'px',
		      height: $h.height() + 'px'
		    });

		    $h.find('div.bg2').css({
		      opacity: 0
		    });

  }

  function animate() {
    var $bgs = $('#cabecera div.bg');
    $bgs.eq(0).animate({opacity: 0}, 5000);
    // $bgs.eq(1).css({ display: block }).animate({opacity: 1}, 1000);

  }


ie6 = 0;
if(/MSIE 6.0/i.test(navigator.userAgent)) {
	ie6 = 1;
    }

if(ie6==0){
	$(init);
	$(window).load(animate);
    }

})(jQuery);
