$(document).ready(function(){
	// find the elements to be eased and hook the hover event
  $('div.jimgMenu ul li a').hover(function() {
    
    // if the element is currently being animated (to a easeOut)...
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "310px"}, {duration: 450, easing:"easeOutQuad"});
    } else {
      // ease in quickly
      $(this).stop().animate({width: "310px"}, {duration: 400, easing:"easeOutQuad"});
    }
  }, function () {
    // on hovering out, ease the element out
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "150px"}, {duration: 400, easing:"easeInOutQuad"})
    } else {
      // ease out slowly
      $(this).stop('animated:').animate({width: "150px"}, {duration: 450, easing:"easeInOutQuad"});
    }
  });
	$.gallerax({
		outputSelector: 		'#gallery-fullview img',			// Output selector
		thumbnailsSelector:		'#gallery-thumbnails ul li img',	// Thumbnails selector
	//	captionSelector:		'#captions .line',					// Caption selector
	//	captionLines:			3,									// Caption lines (3 lines)
		fade: 					'fast',								// Transition speed (fast)
		navNextSelector:		'#gallery-nav a.navNext',			// 'Next' selector
		navPreviousSelector:	'#gallery-nav a.navPrev',			// 'Previous' selector
	//	navFirstSelector:		'#nav a.navFirst',					// 'First' selector
	//	navLastSelector:		'#nav a.navLast',					// 'Last' selector
	//	navStopAdvanceSelector:	'#nav a.navStopAdvance',			// 'Stop Advance' selector
	//	navPlayAdvanceSelector:	'#nav a.navPlayAdvance',			// 'Play Advance' selector
		advanceFade:			'slow',								// Advance transition speed (slow)
		advanceDelay:			4000,								// Advance delay (4 seconds)
		advanceResume:			12000,								// Advance resume (12 seconds)
		thumbnailsPreloadOutput: true,
		thumbnailsFunction: 	function(s) {						// Thumbnails function
			/*
				The statement below replaces the '_thumb.jpg' suffix at the end of a thumbnail's SRC
				attribute with '.jpg' and returns the result. eg.
				
				'images/pic2thumb.jpg'
				
				which is the thumbnail-size version of image 2, becomes:
				
				'images/pic2.jpg'
				
				which is the full-size version of image 2. 
			*/

			return s.replace(/thumb\.jpg$/, '.jpg');
		}
	});
});

