if (jQuery) {  

	//initializes the list of drawings, puts the list into an array which we can easlily iterate through
	var drawingList = [
		{title: "MONARACY", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/1-monaracy.jpg"},
		{title: "DISHER", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/2-disher.jpg"},
		{title: "INGRIDS HAIR ", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/3-ingrids-hair.jpg"},
		{title: "A GROUP OF TROPICAL", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/4-a-group-of-tropical.jpg"},
		{title: "MENU SOPRANO", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/5-menu-soprano.jpg"},
		{title: "FOX BUDDA ", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/6-fox-buddah.jpg"},
		{title: "CARDINAL", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/7-cardinal.jpg"},
		{title: "CARDINAL INSTALLATION ", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/8-cardinal-installation.jpg"},
		{title: "FISHING LICENSE", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/9-fishing-license.jpg"},
		{title: "DRIVERS LICENSE", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/10-drivers-license.jpg"},
		{title: "SOCIAL SECURITY", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/10a-social-security.jpg"},
		{title: "BUTTER FLY BOXER", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/11-butter-fly-boxer.jpg"},
		{title: "EASTER ILAND CREPE", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/12-easter-iland-crepe.jpg"},
		{title: "SIX SENSE", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/14-six-sense.jpg"},
		{title: "MILKWEED", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/15-milkweed.jpg"},	
		{title: "INSTALLATION VIEW MILKWEED", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/16-installtion-view-milkweed.jpg"},
		{title: "TEA BAG", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/17-tea-bag.jpg"},
		{title: "SILVER SPOON", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/18-silver-spoon.jpg"},
		{title: "ST PIERRE", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/19-st-peirre.jpg"},
		{title: "INGRID CESARIAN", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/20-ingrid-cesarian.jpg"},
		{title: "THUMB VISION", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/21-thumb-vision.jpg"},
		{title: "WOODCOCK WING", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/22-woodcock-wing.jpg"},
		{title: "DOLLAR", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/23-dollar.jpg"},
		{title: "FRENCHED FARMED", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/24-frenched-farmed.jpg"},
		{title: "PEOGEOT", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/25-peogeot.jpg"},
		{title: "DR. LILY", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/26-dr-lily.jpg"},
		{title: "E TWO", medium: "Photograph on archival papers", size: "variable 18x24 to 60x80 inches", path: "images/27-e-two.jpg"}
	];

	$(document).ready( function(){
		
		var drawingContainer = $("#drawing");
		
		//initialize the index holder
		drawingContainer.data("cur",0);
		
		//hide the back button because we are on the first element
		$("div#back").hide();
		
		//this is triggered when a client clicks the prev button
		$("#btnPrev").click( function(){
			var currentIndex = drawingContainer.data("cur");
			if( currentIndex > 0){			
				LoadDrawing(currentIndex - 1);
			}		
			if( (currentIndex -1) == 0 ){
				$("div#back").hide();
			}		
			
			$("div#next").show();
			
			return false;
		});
		
		// this triggers when a client clicks the next button
		$("#btnNext").click( function(){
			var currentIndex = drawingContainer.data("cur");
			if( currentIndex < drawingList.length - 1){			
				LoadDrawing(currentIndex + 1);
			}
			if( ( currentIndex + 2 ) == drawingList.length){
				$("div#next").hide();
			}
			
			$("div#back").show();
			
			return false;
		});
		
		function LoadDrawing(index){
			drawingContainer.data("cur", index);
			
			//load the image
			$("#image", drawingContainer).attr("src", drawingList[index].path);
			
			//load the title
			$("#title", drawingContainer).html(drawingList[index].title);
			
			//load the medium
			$("#medium", drawingContainer).html(drawingList[index].medium);
			
			//load the size
			$("#size", drawingContainer).html(drawingList[index].size);
		}
		
	});
}
