/* speed of slideshow fader in miliseconds */
var _speed = 2000; // 5 seconds

$(document).ready(function(){

  $('.seq-2').css('background-image', 'url(' + $('.seq-2 img:first').attr('src') + ')');

	$('.seq-1').fadeIn(1000);
	window.setTimeout(function(){
		$('.seq-1 p').animate({
			width: 	'975px',
			marginLeft: '-477px'
		}, 2500);
	}, 200);
  
  
	window.setTimeout(function(){
		$('.seq-1').fadeOut(2000);
	}, 2000);
  
  window.setTimeout(function(){
		$('.seq-2').animate({
			height: '650px',
			marginTop: '-335px'
		}, 2000, function(){
				$('.seq-2').click(function(){
					HopToEnter();
				});
				window.setTimeout('startFader()', _speed);
		});
	}, 3000);
})

function startFader(){
	// remove the node
	if($('.seq-2 img').length > 1){
		$('.seq-2 img:first').next().fadeIn(600);
		$('.seq-2 img:first').fadeOut(600, function(){
      $('.seq-2').css('background-image', 'none');
			$('.seq-2 img:first').remove();
		});
		window.setTimeout('startFader()', _speed);
	}else{
    $('.seq-2 img').animate({
			height: '550px',
      width: '825px',
      marginLeft: '75px',
      marginTop: '28px'
		}, 1500, function(){
  		HopToEnter();
		});
	}
}

function HopToEnter(){
	document.location.href = $('#enter').attr('href');
}
