$(document).ready(
	function() {	

	if($.browser.msie){
		$('.wrapper').css("top","10.5%");
	}
   	else if($.browser.opera)
		$('.wrapper').css("top","50%");
   	else if($.browser.safari)
		$('.wrapper').css("top","10.5%");
	else
		$('.wrapper').css("top","10.5%");	

	$('.welcome').hide();
	$('.photos').hide();
	$('.links').hide();
	$('.contact').hide();
	$('.updates').hide();
	$('.linksbox').hide();//these hide all the boxes
	$('.contactbox').hide();
	$('.photosbox').hide();
	$('.skate').hide();
	$('.skate2').hide();
	$('.skate3').hide();
	$('.skate4').hide();
	$('.people').hide();
	$('.people2').hide();
	$('.people3').hide();
	$('.places').hide();
	$('.places2').hide();
	$('.places3').hide();
	$('.first').hide();
});
	
$(window).load(
	function() {
	$('.load').fadeOut(200);
	$('.first')
	.animate({opacity: 1.0}, 800)
	.fadeIn('slow');

	$('.first').click(function () {
	$('.ent').fadeOut(0);     	
	$('.first').animate({left: '-=3%', top: '+=62%', height: '0px', width: '0px'},588)
	.hide(7);
	$('.welcome')
	.animate({opacity: 1.0}, 600)
	.fadeIn('slow');
	$('.welcome')
	.animate({opacity: 1.0}, 600)
	.fadeOut('500');
	$('.photos')
	.animate({opacity: 1.0}, 2300)
	.fadeIn('slow');
	$('.links')
	.animate({opacity: 1.0}, 2740)
	.fadeIn('slow');
	$('.contact')
	.animate({opacity: 1.0}, 3180)
	.fadeIn('slow');
	$('.updates')
	.animate({opacity: 1.0}, 3620)
	.fadeIn('slow',function(){$('.slideshow').start()});
	});

	$('a#p').click(function() {
	$('.updates').fadeTo(200, 0.33);
	$('.slideshow').fadeTo(200,0.1);
	if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);	
	}
	if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);	
	}
	if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);	
	}
	if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);	
	}
	if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);	
	}
	if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);	
	}
	if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);	
	}
	if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);	
	}
	if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);	
	}
	if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);	
	}
	if ( $('.linksbox').is(':visible') ) {
	$('.linksbox').fadeOut(200);	
	}	
	if ( $('.contactbox').is(':visible') ) {
	$('.contactbox').fadeOut(200);	
	}	
	if( $('.photosbox').is(':hidden') ) {
	$('.photosbox').fadeIn(200);
	 return false;
	}
	else {
	$('.photosbox').fadeOut(200);
	$('.updates').fadeTo(200, 1);
	$('.slideshow').fadeTo(200, 1);
	}
  	 });	

	$('a#l').click(function() {
	$('.updates').fadeTo(200, 0.22);
	$('.slideshow').fadeTo(200,0.1);
	if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);	
	}
	if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);	
	}
	if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);	
	}
	if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);	
	}
	if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);	
	}
	if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);	
	}
	if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);	
	}
	if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);	
	}
	if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);	
	}
	if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);	
	}
	if ( $('.photosbox').is(':visible') ) {
	$('.photosbox').fadeOut(200);	
	}	
	if ( $('.contactbox').is(':visible') ) {
	$('.contactbox').fadeOut(200);	
	}	
	if( $('.linksbox').is(':hidden') ) {
	$('.linksbox').fadeIn(200);
	 return false;
	}
	else {
	$('.linksbox').fadeOut(200);
	$('.updates').fadeTo(200, 1);
	$('.slideshow').fadeTo(200, 1);
	}
  	 });	

	$('a#c').click(function() {
	$('.updates').fadeTo(200, 0.33);
	$('.slideshow').fadeTo(200,0.1);
	if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);	
	}
	if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);	
	}
	if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);	
	}
	if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);	
	}
	if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);	
	}
	if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);	
	}
	if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);	
	}
	if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);	
	}
	if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);	
	}
	if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);	
	}
	if ( $('.photosbox').is(':visible') ) {
	$('.photosbox').fadeOut(200);	
	}	
	if ( $('.linksbox').is(':visible') ) {
	$('.linksbox').fadeOut(200);	
	}
	if( $('.contactbox').is(':hidden') ) {
	$('.contactbox').fadeIn(200);
	 return false;
	}
	else {
	$('.contactbox').fadeOut(200);
	$('.updates').fadeTo(200, 1);
	$('.slideshow').fadeTo(200, 1);
	}
	 });

	$('a#skate').click(function() {
	if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);	
	}
	else if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);	
	}
	else if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);	
	}
	else if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);	
	}
	else if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);
	$('.skate').fadeIn(500);	
	}
	else {	
	$('.skate').fadeIn(500);
	 return false;
	}
  	 });

	$('a#people').click(function() {
	if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);	
	}
	else if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);	
	}
	else if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);	
	}
	else if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);
	$('.people').fadeIn(500);	
	}
	else {	
	$('.people').fadeIn(500);
	 return false;
	}
  	 });

	$('a#places').click(function() {
	if ( $('.places').is(':visible') ) {
	$('.places').fadeOut(500);	
	}
	else if ( $('.places2').is(':visible') ) {
	$('.places2').fadeOut(500);	
	}
	else if ( $('.places3').is(':visible') ) {
	$('.places3').fadeOut(500);	
	}
	else if ( $('.skate').is(':visible') ) {
	$('.skate').fadeOut(500);
	$('.places').fadeIn(500);	
	}
	else if ( $('.skate2').is(':visible') ) {
	$('.skate2').fadeOut(500);	
	$('.places').fadeIn(500);
	}
	else if ( $('.skate3').is(':visible') ) {
	$('.skate3').fadeOut(500);
	$('.places').fadeIn(500);	
	}
	else if ( $('.skate4').is(':visible') ) {
	$('.skate4').fadeOut(500);
	$('.places').fadeIn(500);	
	}
	else if ( $('.people').is(':visible') ) {
	$('.people').fadeOut(500);
	$('.places').fadeIn(500);	
	}
	else if ( $('.people2').is(':visible') ) {
	$('.people2').fadeOut(500);
	$('.places').fadeIn(500);		
	}
	else if ( $('.people3').is(':visible') ) {
	$('.people3').fadeOut(500);
	$('.places').fadeIn(500);		
	}
	else {	
	$('.places').fadeIn(500);
	 return false;
	}
  	 });

	
	$('.next').click(function() {
	if ( $('.skate').is(':visible') ) {
	$('.skate').hide();
	$('.skate2').show();	
	}
	else if ( $('.skate2').is(':visible') ) {
	$('.skate2').hide();
	$('.skate3').show();	
	}
	else if ( $('.skate3').is(':visible') ) {
	$('.skate3').hide();
	$('.skate4').show();	
	}
	else if ( $('.people').is(':visible') ) {
	$('.people').hide();
	$('.people2').show();	
	}
	else if ( $('.people2').is(':visible') ) {
	$('.people2').hide();
	$('.people3').show();	
	}
	else if ( $('.places').is(':visible') ) {
	$('.places').hide();
	$('.places2').show();	
	}
	else if ( $('.places2').is(':visible') ) {
	$('.places2').hide();
	$('.places3').show();	
	}
	return false;
	 });

	$('.previous').click(function() {
	if ( $('.skate2').is(':visible') ) {
	$('.skate2').hide();
	$('.skate').show();	
	}
	else if ( $('.skate3').is(':visible') ) {
	$('.skate3').hide();
	$('.skate2').show();	
	}
	else if ( $('.skate4').is(':visible') ) {
	$('.skate4').hide();
	$('.skate3').show();	
	}
	else if ( $('.people2').is(':visible') ) {
	$('.people2').hide();
	$('.people').show();	
	}
	else if ( $('.people3').is(':visible') ) {
	$('.people3').hide();
	$('.people2').show();	
	}
	else if ( $('.places2').is(':visible') ) {
	$('.places2').hide();
	$('.places').show();	
	}
	else if ( $('.places3').is(':visible') ) {
	$('.places3').hide();
	$('.places2').show();	
	}
	return false;
	 });

});

$(function() {
	$('#skate a').lightBox();
	$('#skate2 a').lightBox();
	$('#skate3 a').lightBox();
	$('#skate4 a').lightBox();
	$('#peeps a').lightBox();
	$('#peeps2 a').lightBox();
	$('#peeps3 a').lightBox();
	$('#places a').lightBox();
	$('#places2 a').lightBox();
	$('#places3 a').lightBox();
});

jQuery.fn.slideshow = function() {
	$('.photo1').animate({opacity: 1, left: '+=175', top: '+=125'},2050,
		function(){$('.photo1').animate({opacity: 0, left: '+=175', top: '+=125'},2050,
			function(){$('.photo2').animate({opacity: 1, right: '+=175', top: '+=125'},2050,
				function(){$('.photo2').animate({opacity: 0, right: '+=175', top: '+=125'},2050,
					function(){$('.photo3').animate({opacity: 1, right: '-=175', top: '-=55'},2050,
						function(){$('.photo3').animate({opacity: 0, right: '-=175', top: '-=55'},2050,
							function(){$('.photo4').animate({opacity: 1, left: '-=275', top: '-=165'},2050,
								function(){$('.photo4').animate({opacity: 0, left: '-=275', top: '-=65'},2050,
									function(){$('.photo5').animate({opacity: 1, left: '+=175', top: '+=125'},2050,
										function(){$('.photo5').animate({opacity: 0, left: '-=175', top: '+=125'},2050,
											function(){$('.slideshow').reset1()}
										)}
									)}
								)}
							)}
						)}
					)}
				)}//photo2final
			)}//photo2animate
		)}//photo1final
	)//photo1animate

jQuery.fn.slideshow2 = function() {
		$('.photo6').animate({opacity: 1, left: '+=15', bottom: '+=125'},2050,
			function(){$('.photo6').animate({opacity: 0, left: '+=15', bottom: '+=125'},2050,
				function(){$('.photo7').animate({opacity: 1, left: '+=5', top: '-=50'},2050,
					function(){$('.photo7').animate({opacity: 0, left: '+=5', top: '-=50'},2050,
						function(){$('.photo8').animate({opacity: 1, left: '+=175', top: '+=75'},2050,
							function(){$('.photo8').animate({opacity: 0, left: '+=175', top: '+=75'},2050,
								function(){$('.photo9').animate({opacity: 1, left: '+=175', top: '-=100'},2050,
									function(){$('.photo9').animate({opacity: 0, left: '+=175', top: '-=100'},2050,
										function(){$('.photo10').animate({opacity: 1, right: '-=100', top: '-=125'},2050,
											function(){$('.photo10').animate({opacity: 0, right: '+=100', top: '+=125'},2050
											)}
										)}
									)}
								)}
							)}
						)}
					)}
				)}
			)}
		)}
};

jQuery.fn.reset1 = function() {
	$('.photo1').css({top:'0px',left:'0px'})
	$('.photo2').css({top:'100px',right:'-20px'})
	$('.photo3').css({top:'100px',right:'400px'})
	$('.photo4').css({top:'300px',left:'400px'})
	$('.photo5').css({top:'-30px',left:'300px'})
	$('.photo6').css({bottom:'-30px',left:'300px'})
	$('.photo7').css({top:'300px',left:'100px'})
	$('.photo8').css({top:'200px',left:'-100px'})
	$('.photo9').css({top:'400px',left:'-50px'})
	//$('.photo10').css({top:'300px',right:'400px'})
	$('.slideshow').slideshow()
	$('.slideshow').animate({opacity:1},2102, function(){$('.slideshow').slideshow2()})
};

jQuery.fn.start = function() {
	$('.slideshow').slideshow();
	$('.slideshow').animate({opacity:1},2050, function(){$('.slideshow').slideshow2()})
};