jQuery(document).ready(function() {
				
                        $("#contact").hide();
			
			$('#contact-link').click(function() {
			  $("#contact").show('slow');
			});
			
			$('.close').click(function() {
			  $("#contact").hide('slow');
			});
			
			$("#pdfs").hide();
			
			$('#pdfs-link').click(function() {
			  $("#pdfs").show('slow');
			});
			
			$('.pdfs-close').click(function() {
			  $("#pdfs").hide('slow');
			});

			$('.splash-slideshow').hide();
			var percentage;
			
			$.preload( '.splash-slideshow img', {//the first argument is a selector to the images
				//onRequest:request,
				onComplete:complete,
				onFinish:finish,
				placeholder:'images/album-thumbs/loading.jpg',//this is the really important option
				notFound:'../img/notfound.jpg'//optional image if an image wasn't found
				//threshold: 2 //'2' is the default, how many at a time, to load.
			});
			
			function update( data ){
				percentage = Math.ceil((data.done / data.total) * 100);
				$('#data').html( ''+percentage + '% ' );
			};
			function complete( data ){
				update( data );
			};
			function finish(){//hide the summary
				$('#data').fadeOut();
				$('#data').html( ' ' );
				$('.splash-slideshow img:gt(0)', this).hide();	
				setInterval(function(){
						$('.splash-slideshow :first-child').fadeOut(1000).next('img').fadeIn(1000)
						.end().appendTo('.splash-slideshow');}, 
					3000);
				$('.splash-slideshow').fadeIn();
			};			
						
			$(".rollover a").mouseover(function(){
				imgsrc = $(this).children("img").attr("src");
				matches = imgsrc.match(/_over/);
				if (!matches) {
					imgsrcON = imgsrc.replace(/.png$/ig,"_over.png");
					$(this).children("img").attr("src", imgsrcON);
				}						   
			});
			
			$(".rollover a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);
			});
			
			$(".rollover img").each(function() {
				rollsrc = $(this).attr("src");
				rollON = rollsrc.replace(/.png$/ig,"_over.png");
				$("<img>").attr("src", rollON);
			});
			
			$(".rollover2 a").mouseover(function(){
				imgsrc = $(this).children("img").attr("src");
				matches = imgsrc.match(/_over/);
				if (!matches) {
					imgsrcON = imgsrc.replace(/.jpg$/ig,"_over.jpg");
					$(this).children("img").attr("src", imgsrcON);
				}						   
			});
			
			$(".rollover2 a").mouseout(function(){
				$(this).children("img").attr("src", imgsrc);
			});
			
			$(".rollover2 img").each(function() {
				rollsrc = $(this).attr("src");
				rollON = rollsrc.replace(/.jpg$/ig,"_over.jpg");
				$("<img>").attr("src", rollON);
			});
			
			
			var object = $(".sidebar-link").first();
			var delay = 1600;
			var noble = $(".sidebar-links > div").size();

			
			for(var i=0; i<noble; i++){
			 	object.animate({ opacity: 0 }, 0, "swing" ).delay(delay).animate({ opacity: 1 }, 500, "swing" );
				object = object.next();
				delay = delay + 100;
			}
			
			$("#logo").animate({ opacity: 0 }, 0, "swing" ).delay(0).animate({ opacity: 1 }, 500, "swing" );
			
			
			
			$(".grey").animate({ opacity: 1 }, 0, "swing" ).delay(1500).fadeOut(1000);
			$(".grey-logo").animate({ opacity: 1 }, 0, "swing" ).delay(1500).fadeOut(1000);
			
			$("#main").animate({ opacity: 0 }, 0, "swing" ).delay(1500).animate({ opacity: 1 }, 1000, "swing" );
			
			resize();
				
			
			
			$(window).resize(function(){
				resize()
			});
			
			
				$('.splash-slideshow img:gt(0)', this).hide();				
				var inter = setInterval(function(){
						$('.splash-slideshow :first-child').fadeOut(1000).next('img').fadeIn(1000)
						.end().appendTo('.splash-slideshow');}, 
					3000);
				
				clearInterval(inter);

			
			
			
			
			
			
			
		
			
});			

	function resize() {
				
				
				var w = $(window).width();
				w = w - 300;
				w = w * 0.9;
				if (w < 750) {
					w = 750;
				} else if (w > 1400) {
					w = 1400;
				}
				$(".splash").css('width', w);
				
				

				
				
				var w = $(window).width();
				
				$(".grey-logo img").css('margin-left', ((w / 2) - 190));
				
				var h = $(window).height();
				
				$(".grey-logo img").css('margin-top', ((h / 2) - 160));
				
				
				 
	}
