$(document).ready( function(){
	animator();
	$('a', '.logo').css({top:10});
})

$(window).resize( function(){
	animator();
})

function animator(){
	var wh = $(window).height();
	if( wh < 649 ) wh = 649;
	$('.body').height( wh - 1 );
	
	var center_y = wh / 2;

	if( !$.browser.mobile ){
		$('#photo1').css({ left:23, top: center_y - 299, opacity: 0.2 });
		$('#photo2').css({ left:73, top: center_y - 327, opacity: 0.2 });
		$('#photo3').css({ left:184, top: center_y - 138, opacity: 0.2 });
		$('#lnk1').css({top: center_y+185, opacity:0});
		$('#lnk2').css({top: center_y+55, opacity:0});
		$('#lnk3').css({top: center_y-240, opacity:0});

		$('#photo1').animate( { left:75, top: center_y - 25, opacity:1 }, { duration:900, easing:'easeInOutBack', complete: function(){
			$('#lnk1').animate( { left:420, opacity:1 }, 400 );
		}});
		$('#photo2').animate( { left:-200, top: center_y - 285, opacity:1 }, {duration:900,easing:'easeInOutBack', complete: function(){
			$('#lnk2').animate( { left:-130, opacity:1 }, 400 );
		}});
		$('#photo3').animate( { left:230, top: center_y - 380, opacity:1 }, {duration:900,easing:'easeInOutBack', complete: function(){
			$('#lnk3').animate( { left:565, opacity:1 }, 400 );
		}});

		$('#lnk1').mouseenter( function(){ $('#photo1').animate( { left:95, top: center_y - 29 }, 200 ); })
				.mouseleave( function(){ $('#photo1').animate( { left:75, top: center_y - 25 }, 200 ); });
		$('#lnk2').mouseenter( function(){ $('#photo2').animate( { left:-220, top: center_y - 281 }, 200 ); })
				.mouseleave( function(){ $('#photo2').animate( { left:-200, top: center_y - 285 }, 200 ); })
		$('#lnk3').mouseenter( function(){ $('#photo3').animate( { left:250, top: center_y - 376 }, 200 ); })
				.mouseleave( function(){ $('#photo3').animate( { left:230, top: center_y - 380 }, 200 ); })
	}
	else{
		$('#photo1').css({ left:75, top: center_y - 25, opacity: 1 });
		$('#photo2').css({ left:-200, top: center_y - 285, opacity: 1 });
		$('#photo3').css({ left:230, top: center_y - 380, opacity: 1 });
		$('#lnk1').css({ left:400, top: center_y + 185, opacity:1 });
		$('#lnk2').css({ left:-130, top: center_y+55, opacity:1 });
		$('#lnk3').css({ left:565, top: center_y-240, opacity:1 });
	}
}
