
$(document).ready(function(){

//determine what the 1st image is for the photo gallery
// by checking which thumbnail is first
var default_newImgSrc	 	=  $("img", "#ird1").attr("src");
var default_imgFileName	 	=  default_newImgSrc.substring(20);

//get the larger image and set it to the background of the picture viewer
$(".viewframe").css("background-image", "url(galleryimages/"+default_imgFileName+")");
	
// set the click event to swap out the main view image depending
// on which thumb is clicked
$(".items > div").click(function(){


	
	var newImgSrc	 	=  $("img", this).attr("src");

	var imgFileName	 	=  newImgSrc.substring(20);

	$(".viewframe").css("background-image", "url(galleryimages/"+imgFileName+")");
	
});
	

// initialize the scrolling for thumbnails
$("div.scrollable").scrollable();

});
