	$(document).ready(function() {
		$('#clipregion').clipregion({
				'itemHeight':720,
				'itemWidth':1000,
				'totalItems':$('ul > li',$('#clipregion')).size(),
				'itemsToShow':1,
				'itemStep':true
			});

		$(".zoomOutCursor").live("click", function(){
			zoomOut();
	    });
		
		 $(".zoomInCursor").live("click", function(){
			var srclen = $(this).attr('src').length-4;
			var imgUrl = $(this).attr('src').substring(0,srclen) + "-big.jpg";
			zoomIn(imgUrl);
	    });	 

		positionIt();
		checkButtons();
		
		$('#footer #previous').click(function() {
			$.clipregion.prev();
			checkButtons();
			positionIt();
		});
		
		$('#footer #next').click(function() {
			$.clipregion.next();
			checkButtons();
			positionIt();
		});
	});
	
	function positionIt() {
		var imgId = "#graphic"+($.clipregion.getIdx()+1);
		var imgW = $(imgId).attr('width');
		if (imgW==0) imgW = '541px';
		$('#mainGraphic').css({ width: imgW }); 
	}
