jQuery(function( $ ){

	$.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;
			};
			
	$.easing.easeout = function(x, t, b, c, d) {
				if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
						return -c/2 * ((t-=2)*t*t*t - 2) + b;
			};
	
	
	//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)
	$.scrollTo( 0 );//reset the screen to (0,0)
	

	//Target examples bindings
	var $paneTarget = $('#pane-target');			



	$('#frame1').click(function(){
		var $target = $paneTarget.find('li#targettwo');
		$paneTarget.stop().scrollTo( $target , 800, {easing:'easeout'} );
	});

	$('#frame2').click(function(){
		var $target = $paneTarget.find('li#targetthree');
		$paneTarget.stop().scrollTo( $target , 800, {easing:'easeout'} );
	});
	$('#frame3').click(function(){
		var $target = $paneTarget.find('li#targetfour');
		$paneTarget.stop().scrollTo( $target , 800, {easing:'easeout'} );
	});
	$('#frame4').click(function(){
		var $target = $paneTarget.find('li#targetfive');
		$paneTarget.stop().scrollTo( $target , 800, {easing:'easeout'} );
	});
	$('#frame5').click(function(){
		var $target = $paneTarget.find('li#targetone');
		$paneTarget.stop().scrollTo( $target , 800, {easing:'easeout'} );
	});


	 $(function () {
	        var img = new Image();
	        $(img).load(function () {
	            //$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
	            $(this).hide();
	            $('#panel1').removeClass('loading').append(this);
	            $(this).fadeIn(300);
	        }).error(function () {
	            // notify the user that the image could not be loaded
	        }).attr('src', 'http://www.revson.columbia.edu/images/uploads/home_banner.jpg');
	    });




});