$(document).ready(function(){

	var max_width = 216; 	//Sets the max width, in pixels, for every image
	var selector = '#img1 img'; //selector for div.
	
	$(selector).each(function(){
		var width = $(this).width();
		var height = $(this).height();
		if (width > max_width) {
			//Set variables	for manipulation
			var ratio = (height / width );
			var new_width = max_width;
			var new_height = (new_width * ratio);
			
			//Shrink the image and add link to full-sized image
			$(this).height(new_height).width(new_width);
			$(this).hover(function(){
				$(this).attr("title", "This image has been scaled down.  Click to view the original image.")
				$(this).css("cursor","pointer");
				});
			$(this).click(function(){
				window.location = $(this).attr("src");
				});
		} //ends if statement
	} //ends each function
	);
	var max_width = 326; 	//Sets the max width, in pixels, for every image
	var selector = '#img2 img'; //selector for div.
	
	$(selector).each(function(){
		var width = $(this).width();
		var height = $(this).height();
		if (width > max_width) {
			//Set variables	for manipulation
			var ratio = (height / width );
			var new_width = max_width;
			var new_height = (new_width * ratio);
			
			//Shrink the image and add link to full-sized image
			$(this).height(new_height).width(new_width);
			$(this).hover(function(){
				$(this).attr("title", "This image has been scaled down.  Click to view the original image.")
				$(this).css("cursor","pointer");
				});
			$(this).click(function(){
				window.location = $(this).attr("src");
				});
		} //ends if statement
	} //ends each function
	);
	var max_width = 258; 	//Sets the max width, in pixels, for every image
	var selector = '#img3 img'; //selector for div.
	
	$(selector).each(function(){
		var width = $(this).width();
		var height = $(this).height();
		if (width > max_width) {
			//Set variables	for manipulation
			var ratio = (height / width );
			var new_width = max_width;
			var new_height = (new_width * ratio);
			
			//Shrink the image and add link to full-sized image
			$(this).height(new_height).width(new_width);
			$(this).hover(function(){
				$(this).attr("title", "This image has been scaled down.  Click to view the original image.")
				$(this).css("cursor","pointer");
				});
			$(this).click(function(){
				window.location = $(this).attr("src");
				});
		} //ends if statement
	} //ends each function
	);

});
