	jQuery(function( $ ){
			/**
			 * Demo binding and preparation, no need to read this part
			 */
				//borrowed from jQuery easing plugin
				//http://gsgd.co.uk/sandbox/jquery.easing.php
				$.easing.elasout = function(x, t, b, c, d) {
					var s=1.70158;var p=0;var a=c;
					if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
					if (a < Math.abs(c)) { a=c; var s=p/4; }
					else var s = p/(2*Math.PI) * Math.asin (c/a);
					return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
				};
				$('a.back').click(function(){
					$(this).parents('div.pane').scrollTo( 0, 800, { queue:true } );
					$(this).parents('div.section').find('span.message').text( this.title );
					return false;
				});
				//just for the example, to stop the click on the links.
				$('span.links').click(function(e){
					e.preventDefault();
					var link = e.target;
					link.blur();
					if( link.title )
						$(this).parent().find('span.message').text(link.title);
				});
			
			//by default, the scroll is only done vertically ('y'), change it to both.
			$.scrollTo.defaults.axis = 'xy'; 			
			//this one is important, many browsers don't reset scroll on refreshes
			$('div.pane').scrollTo( 0 );//reset all scrollable panes to (0,0)
//turned off 1 21 09 $.scrollTo( 0 );//reset the screen to (0,0)
			
			//TOC, shows how to scroll the whole window
			$('#toc a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
				$.scrollTo( this.hash, 1500, { easing:'elasout' });
				$(this.hash).find('span.message').text( this.title );
				return false;
			});
			
			//Target examples bindings
			var $paneTarget = $('#pane-target');			
			
			  $(document).ready(function() {
 
 	 // hides the slickbox as soon as the DOM is ready
	 // (a little sooner than page load)
			$paneTarget.stop().scrollTo( { top:990,left:1369} , 800 );
//alert("hi");
}); 

			
			$('#relative-east').click(function(){
				$paneTarget.stop().scrollTo( '+=300', 500, {axis:'x'} );
			});
			$('#relative-west').click(function(){
				$paneTarget.stop().scrollTo( '-=300', 500, {axis:'x'} );
			});
			$('#relative-north').click(function(){
				$paneTarget.stop().scrollTo( '-=300', 500, {axis:'y'} );
			});
			$('#relative-south').click(function(){
				$paneTarget.stop().scrollTo( '+=300', 500, {axis:'y'} );
			});
			$('#JumpAgawam').click(function(){
				$paneTarget.stop().scrollTo( { top:1700,left:1800} , 800 );
			});
$('#JumpBlandford').click(function(){
$paneTarget.stop().scrollTo( { top:900,left:223} , 800 );
			});
$('#JumpBrimfield').click(function(){
$paneTarget.stop().scrollTo( { top:1290,left:4500} , 800 );
			});
$('#JumpChester').click(function(){
$paneTarget.stop().scrollTo( { top:28,left:40} , 800 );
			});
$('#JumpChicopee').click(function(){
$paneTarget.stop().scrollTo( { top:950,left:2238} , 800 );
			});
$('#JumpEastLongmeadow').click(function(){
$paneTarget.stop().scrollTo( { top:1750,left:2600} , 800 );
			});
$('#JumpGranville').click(function(){
$paneTarget.stop().scrollTo( { top:1610,left:513} , 800 );
			});
$('#JumpHampden').click(function(){
$paneTarget.stop().scrollTo( { top:1780,left:3015} , 800 );
			});
$('#JumpHolland').click(function(){
$paneTarget.stop().scrollTo( { top:1800,left:4500} , 800 );
			});
$('#JumpHolyoke').click(function(){
$paneTarget.stop().scrollTo( { top:750,left:1850} , 800 );
			});
$('#JumpLongmeadow').click(function(){
$paneTarget.stop().scrollTo( { top:1900,left:2230} , 800 );
			});
$('#JumpLudlow').click(function(){
$paneTarget.stop().scrollTo( { top:900,left:2800} , 800 );
			});
$('#JumpMonson').click(function(){
$paneTarget.stop().scrollTo( { top:1600,left:3500} , 800 );
			});
$('#JumpMontgomery').click(function(){
$paneTarget.stop().scrollTo( { top:700,left:1000} , 800 );
			});
$('#JumpPalmer').click(function(){
$paneTarget.stop().scrollTo( { top:900,left:3568} , 800 );
			});
$('#JumpRussell').click(function(){
$paneTarget.stop().scrollTo( { top:950,left:900} , 800 );
			});
$('#JumpSouthwick').click(function(){
$paneTarget.stop().scrollTo( { top:1750,left:1160} , 800 );
			});
$('#JumpSpringfield').click(function(){
$paneTarget.stop().scrollTo( { top:1450,left:2350} , 800 );
			});
$('#JumpTolland').click(function(){
$paneTarget.stop().scrollTo( { top:1650,left:0} , 800 );
			});
$('#JumpWales').click(function(){
$paneTarget.stop().scrollTo( { top:1780,left:3980} , 800 );
			});
$('#JumpWestSpringfield').click(function(){
$paneTarget.stop().scrollTo( { top:1380,left:1800} , 800 );
			});
$('#JumpWestfield').click(function(){
$paneTarget.stop().scrollTo( { top:1250,left:1250} , 800 );
			});
$('#JumpWilbraham').click(function(){
$paneTarget.stop().scrollTo( { top:1400,left:2930} , 800 );
			});
$(window).load(function(){
$paneTarget.stop().scrollTo( { top:1450,left:2350} , 800 );
});


			$('#relative-position-hash').click(function(){				
				$paneTarget.stop().scrollTo( {top:'-=100px',left:'+=100'}, 500 );
			});
			
			//options examples bindings, they will all scroll to the same place, with different options
			function reset_o(){//before each animation, reset to (0,0), skip this.
				$paneOptions.stop().stop();
				$paneOptions[0].scrollLeft = $paneOptions[0].scrollTop = 0;
			};
			var $paneOptions = $('#pane-options');


var scrollX = null; // set if dragging, null if not dragging
var scrollY = null;
var mouseX = null;
var mouseY = null;
$paneTarget.mousedown(function() {
    var pane = document.getElementById('pane-target');
    scrollX = pane.scrollLeft;
    scrollY = pane.scrollTop;
    return false;
}).mouseup(function() {
    scrollX = null;
    mouseX = null;
}).mouseout(function() {
    scrollX = null;
    mouseX = null;
}).mousemove(function(e) {
    if(scrollX != null) {
        if(mouseX == null) {
            mouseX = e.pageX;
            mouseY = e.pageY;
        }
        $paneTarget.stop();
        var pane = document.getElementById('pane-target');
        pane.scrollLeft = scrollX+(mouseX-e.pageX);
        pane.scrollTop  = scrollY+(mouseY-e.pageY);
    }
    return false;
});
			
			});