//Javascript for Dennis Maust Website
//:fyocum:17 July 2009
//Frederick D Yocum


	$(document).ready(function () {
	//Setting up the main navigational panels
		//Fades in the panel of links associated with the section when hovered over
		$('div#mainNav ul li').each(function () {
			$(this).hover(
				function(){
					$(this).children('ul').show('1000');
					},//hover in
					function(){
						//var p = setTimeout(function(){
							return false;
							//$(this).children('ul').hide('1000');
							//},2000 );
					}//hover out
			);//Hover method
		}//Panel Fade function
		);//Panel Fade each method
		

		//Routines that have to do with the Galleries
		var theDisplayed = $('<div class="objHighlight"></div>').hide().insertBefore('#objGallery').click(function(){
			$(this).empty('');
			});//Set up display area
		$('.objDisplay').removeClass('objDisplay').addClass('objHidden');//Hide the objects
		
		$('#objGallery li a').each(function(){ 
			var theObj = this.getAttribute('href',2);//Grab the href reference, 2 clips the value to the value in IE
			var theThumb = this;
   			$(this).click(function() {
   				$('#objGallery li a img').removeClass('imgHighlight');
   				var t = setTimeout(function(){$(theThumb).children('img').addClass('imgHighlight');},0);//Uses setTimeout to ensure the previous method completes.
   				$('.objHighlight').hide('fast', function(){
	   			var theObjecttoDisplay = $(theObj).clone().removeClass('objHidden').addClass('objDisplay');//Clone the object referenced in the link
	   			$('div.objHighlight').empty().append(theObjecttoDisplay);
	   			$('.objHighlight').show('slow');
   					});
 				return false;
   				} );//End of on click

			});//end of objGallery link each function
			$('html').removeClass('js');//Tidying up the hiding function initialized in the gallery 
		}//End of ready function
	);//End of .ready method
  
