
		$(document).ready(function(){ 

			/*  choose year  */
			$("div#handle-year").click(function () {
				$("div#handle-year").toggleClass("highlighted"); 
				$("ul#years").slideToggle(700);
			});






			/*  grow/shrink thumb photos on hover  */
			$("img.thumb").hover(
				function () { $(this).stop().animate( { width: "66px", height: "66px" } , 600 ); },
				function () { $(this).stop().animate( { width: "55px", height: "55px" } , 600 ); }
			);






			/*  next link shows the next thumbset of artist photos  */
			$("#next a").click(function () {
				$("div.thumbset:hidden:first:has(img)").fadeIn(200);
			});

			/*  previous link shows the previous thumbset of artist photos  */
			$("#prev a").click(function () {
				$("div.thumbset:visible:last").fadeOut(200, 
					function () {
						$("div#first").show();					/*  show the first set of thumbs  */
					}				
				);
			});


			/*  show the thumbset of artist photos containing the current photo  */
			var artisturl = unescape(window.document.location);

			if (artisturl.indexOf('imageid=') > -1) {							/*  if there is an image id passed in the url  */

				var featureimage = artisturl.split('imageid=');					/*  extract the image id number  */

				var featurethumb = "p" + featureimage[1];						/*  build the feature image's id  */

				if ( featurethumb.indexOf('#') > -1 ) {							/*  if there is a # at the end of the url, remove it  */
					featurethumb = featurethumb.replace('#', '');
				}

				$("div.thumbset:has('#" + featurethumb + "')").fadeIn(200);		/*  show the thumbset that contains the feature thumb  */

				var featureindex = $("div.thumbset").index( $('div.thumbset:has(\'#' + featurethumb + '\')') );		/*  get the index of the feature thumb  */

				$("div.thumbset:lt(" + featureindex + ")").fadeIn(200);			/*  show all thumbsets under the feature thumb, so previous link works correctly  */

			} else if (artisturl.indexOf('.html') > -1) {						/*  if this is a mod_rewrite page  */

				var fullurl = artisturl.split('-');								/*  fragment the full url  */

				var partialurl = fullurl[fullurl.length-1].split('.');			/*  extract the feature image's id number from the url  */

				var featurethumb = "p" + partialurl[0];							/*  build the feature image's id  */

				if ( featurethumb.indexOf('#') > -1 ) {							/*  if there is a # at the end of the url, remove it  */
					featurethumb = featurethumb.replace('#', '');
				}

				$("div.thumbset:has('#" + featurethumb + "')").fadeIn(200);		/*  show the thumbset that contains the feature thumb  */

				var featureindex = $("div.thumbset").index( $('div.thumbset:has(\'#' + featurethumb + '\')') );		/*  get the index of the feature thumb  */

				$("div.thumbset:lt(" + featureindex + ")").fadeIn(200);			/*  show all thumbsets under the feature thumb, so previous link works correctly  */

			}






			/*  artist photo info  */
			$("#info a").click(function () {
				$("#photo_info").slideToggle(300);
			});

			$("#close_info").click(function () {
				$("#photo_info").slideToggle(300);
			});






			/*  artist photo enlarge  */
			$("#enlarge a").click(function () {				/*  show the enlarged photo  */
				$("#enlarged").animate({ 
					width: "955px",
					opacity: 1,
					marginTop: "0px"
				}, 600 );

			});

			$("#photo").click(function () {					/*  show the enlarged photo  */
				$("#enlarged").animate({ 
					width: "955px",
					opacity: 1,
					marginTop: "0px"
				}, 600 );

			});

			$("#enlarged").click(function () {				/*  close the enlarged photo  */
				$("#enlarged").animate({ 
					width: "955px",
					opacity: 0,
					marginTop: "-=1000px"
				}, 300 );
			});






			/*  other artist dropdown  */
			$("div#handle-names").click(function () { 
				$("div#handle-names").toggleClass("highlight-bar"); 
				$("div#other").slideToggle(600);
			});






			/*  hide the arrows (and add extra spacing) if scrollbars are not present on scrolling content divs  */
			if ( $('#scrolling_content').length > 0 ) {					/*  only execute this code if the scrolling_content id exists  */
				if ( $("#scrolling_content")[0].scrollHeight-1 <= $("#scrolling_content")[0].clientHeight ) {		/*  if scrollHeight-1 is less than or equal to clientHeight, there are no scrollbars  */
					$("#arrow_up").addClass("arrow_hidden");
					$("#arrow_down").addClass("arrow_hidden");
					$(".arrow_beige").addClass("arrow_hidden");
					$("#scrolling_content").css("margin-bottom" , "30px");
					$("#scrolling_content").css("padding-top" , "27px");
				} 			
			} 

			if ( $('#exhibit_scrolling_content').length > 0 ) {			/*  only execute this code if the exhibit_scrolling_content id exists  */
				if ( $("#exhibit_scrolling_content")[0].scrollHeight-1 <= $("#exhibit_scrolling_content")[0].clientHeight ) {		/*  if scrollHeight-1 is less than or equal to clientHeight, there are no scrollbars  */
					$("#arrow_up").addClass("arrow_hidden");
					$("#arrow_down").addClass("arrow_hidden");
					$("#exhibit_scrolling_content").css("margin-bottom" , "16px");
					$("#exhibit_scrolling_content").css("padding-top" , "0");
				}
			}


		}); 



