$(document).ready(function() {
	//$('div:not(#menu)').hide(); 																									// hide the menu contents
	$('#menu div:last').slideDown(500);																										// show the contact pane
	$('.copyrightnotice').hide();																									// hide the extended copyright notice
	$('.portfolioitems').hide(); 																									// align and hide the portfolio subitems
	$('#menu div li').click(function(){																								// on click for the selected images menu items
									   	$(this).children('.portfolioitems').toggle(150);											// toggle the clicked item's image numbers
										$(this).siblings('li:visible').children('.portfolioitems').hide(500);						// take the visible image numbers and hide them
									   });
	$('.copyright').hover(function () { $('.copyright span').fadeIn(250); }, function () { $('.copyright span').fadeOut(750); }	); 	// show the copyright notice on hover
	$('#gallery').load(function(){
							  $('#image').fadeIn(750);																				// animate the fade of the gallery image
							  });
	$('.menu_headline').click(function(){																							// toggle the submenus into view
										$(this).next().slideToggle();
										});
	$('.imglink').click(function(){																									// selected images links
										var imgtitle = $(this).attr("href");														// take href from links
										$('#gallery').fadeOut(100, function(){														// fade out the gallery image
																		   $('#loading').fadeIn(50);
																		   $('#gallery').attr("src", imgtitle);						// change the gallery image
																		   });
										
										$('#gallery').load(function(){																// wait until it's loaded, then fade back in
																	$('#loading').fadeOut(50, function(){ 
																										$('#gallery').fadeIn(500);
																										});
																	
																	});
				   						return false;																				// kill the original link
										});
	$('.portfolioitems').removeClass('display');																					// kill the block display css just in case when js is enabled
	$('a').click(function(){
						  $(this).blur();
						  });
	$('#upload').fadeIn(750);
});
