



//UN.animation
  $(document).ready(function()
	{
    $("#un_anim_right").click(function()
		 {
      $(".block").animate({"left": "+=50px"}, "slow");
     });

    $("#un_anim_left").click(function()
		{
      $(".block").animate({"left": "-=50px"}, "slow");
     });
		$("#un_anim_top").click(function()
		{
      $(".block").animate({"top": "-=50px"}, "slow");
    });
		$("#un_anim_down").click(function()
		{
      $(".block").animate({"top": "+=150px"}, "fast");
    });
		$("#un_anim_hide").click(function()
		{ 
				 $(".block").animate({"opacity": "0.2"}, 1400);
		});
		$("#un_anim_show").click(function()
		{ 
				 $(".block").animate({"opacity": "1"}, 1400);
		});
		$("#un_anim_grow").click(function()
		{ 
				 $(".block").animate({"width": "180"}, 1400);
				 $(".block").animate({"height": "180"}, 400);
		});
		$("#un_anim_hover").hover(
     function () 
			{
        $("#un_anim_hover").animate({"opacity": "0"}, 800);
     }, 
     function () 
			{
        $("#un_anim_hover").animate({"opacity": "1"}, 800);
     });
		 
		 
		$("#copylife").hover(
     function () 
			{
        $("#copylife").animate({"opacity": "1"}, 800);
     }, 
     function () 
			{
        $("#copylife").animate({"opacity": "0"}, 800);
     });
		 
		 
		 
		 $("#FonasA").hover(
     function () 
			{
        $("#FonasA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FonasA").animate({"opacity": "0"}, 300);
     });
		 
		 $("#FrozsylkiA").hover(
     function () 
			{
        $("#FrozsylkiA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FrozsylkiA").animate({"opacity": "0"}, 300);
     });
		 
		 $("#FbanneryA").hover(
     function () 
			{
        $("#FbanneryA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FbanneryA").animate({"opacity": "0"}, 300);
     });
			
		 $("#FboxyA").hover(
     function () 
			{
        $("#FboxyA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FboxyA").animate({"opacity": "0"}, 300);
     });
		 
		 $("#FfaqA").hover(
     function () 
			{
        $("#FfaqA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FfaqA").animate({"opacity": "0"}, 300);
     });
		 
		 $("#FrealizacjeA").hover(
     function () 
			{
        $("#FrealizacjeA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FrealizacjeA").animate({"opacity": "0"}, 300);
     });
		 
		 $("#FkontaktA").hover(
     function () 
			{
        $("#FkontaktA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $("#FkontaktA").animate({"opacity": "0"}, 300);
     });
		 
		 
		$(".winduxA").hover(
     function () 
			{
        $(".winduxA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".winduxA").animate({"opacity": "0"}, 300);
     });
		 
		 
		$(".crockylogA").hover(
		 function () 
			{
        $(".crockylogA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".crockylogA").animate({"opacity": "0"}, 300);
     });
		
		
		
		 $(".YhomeA").hover(
     function () 
			{
        $(".YhomeA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YhomeA").animate({"opacity": "0"}, 300);
     });
		
		 $(".YonasA").hover(
     function () 
			{
        $(".YonasA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YonasA").animate({"opacity": "0"}, 300);
     });
		 
		 $(".YrozsylkiA").hover(
     function () 
			{
        $(".YrozsylkiA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YrozsylkiA").animate({"opacity": "0"}, 300);
     });
		 
		 $(".YbanneryA").hover(
     function () 
			{
        $(".YbanneryA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YbanneryA").animate({"opacity": "0"}, 300);
     });
			
		 $(".YboxyA").hover(
     function () 
			{
        $(".YboxyA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YboxyA").animate({"opacity": "0"}, 300);
     });
		 
		 $(".YfaqA").hover(
     function () 
			{
        $(".YfaqA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YfaqA").animate({"opacity": "0"}, 300);
     });
		 
		 $(".YrealizacjeA").hover(
     function () 
			{
        $(".YrealizacjeA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YrealizacjeA").animate({"opacity": "0"}, 300);
     });
		 
		 $(".YkontaktA").hover(
     function () 
			{
        $(".YkontaktA").animate({"opacity": "1"}, 300);
     }, 
     function () 
			{
        $(".YkontaktA").animate({"opacity": "0"}, 300);
     });

		
		$(window).resize(function() { set_sizes();});
  });

	
	
	
	
	
	
	
	
	
	
	function isIE()
	{
		var IE=v=false,n;try{n=navigator.appVersion;IE=(n.indexOf('MSIE')!=-1)}catch(e){}
		if(IE)v=n.substr(n.indexOf('MSIE')+5,1);return parseInt(v);
	}


	
	function set_sizes()
	{
	
	
		var spwll=700;//Space Wall 
		var pgwd=1000;//page Width id
		var tmpx=0;
		var bname=navigator.appName;
		if (bname=="Microsoft Internet Explorer") var its_wide=screen.width;
		else its_wide=window.innerWidth;
		if (bname=="Microsoft Internet Explorer") var its_huge=screen.height;
		else its_huge=window.innerHeight;
		
		
		//alert(its_wide);
		its_wide=its_wide-20;
		its_huge=its_huge-20;
		
		
		
		
		//IE BUGS FIX:]
		if (isIE()<7) its_huge=screen.height-100;
		if (isIE()>=7)  its_huge=screen.height-130;
		
		if (isIE())
		{

			
			
			$("#FonasA").css({ 'opacity' : "0"});
			$("#FrozsylkiA").css({ 'opacity' : "0"});
			$("#FbanneryA").css({ 'opacity' : "0"});
			$("#FboxyA").css({ 'opacity' : "0"});
			$("#FfaqA").css({ 'opacity' : "0"});
			$("#FrealizacjeA").css({ 'opacity' : "0"});
			$("#FkontaktA").css({ 'opacity' : "0"});
			
			$(".YhomeA").css({ 'opacity' : "0"});
			$(".YonasA").css({ 'opacity' : "0"});
			$(".YrozsylkiA").css({ 'opacity' : "0"});
			$(".YbanneryA").css({ 'opacity' : "0"});
			$(".YboxyA").css({ 'opacity' : "0"});
			$(".YfaqA").css({ 'opacity' : "0"});
			$(".YrealizacjeA").css({ 'opacity' : "0"});
			$(".YkontaktA").css({ 'opacity' : "0"});
			
			$(".winduxA").css({ 'opacity' : "0"});
			$(".crockylogA").css({ 'opacity' : "0"});
		}
		
		if ((isIE()>=7))
		{
			
			$("#FonasA").css({ 'margin-top' : '-16px'});
			$("#FrozsylkiA").css({ 'margin-top' : '-16px'});
			$("#FbanneryA").css({ 'margin-top' : '-16px'});
			$("#FboxyA").css({ 'margin-top' : '-16px'});
			$("#FfaqA").css({ 'margin-top' : '-16px'});
			$("#FrealizacjeA").css({ 'margin-top' : '-16px'});
			$("#FkontaktA").css({ 'margin-top' : '-16px'});
			
			$(".YhomeA").css({ 'margin-top' : '-16px'});
			$(".YonasA").css({ 'margin-top' : '-16px'});
			$(".YrozsylkiA").css({ 'margin-top' : '-16px'});
			$(".YbanneryA").css({ 'margin-top' : '-16px'});
			$(".YboxyA").css({ 'margin-top' : '-16px'});
			$(".YfaqA").css({ 'margin-top' : '-16px'});
			$(".YrealizacjeA").css({ 'margin-top' : '-16px'});
			$(".YkontaktA").css({ 'margin-top' : '-16px'});
			
			$(".YhomeAA").css({ 'margin-top' : '-16px'});
			$(".YonasAA").css({ 'margin-top' : '-16px'});
			$(".YrozsylkiAA").css({ 'margin-top' : '-16px'});
			$(".YbanneryAA").css({ 'margin-top' : '-16px'});
			$(".YboxyAA").css({ 'margin-top' : '-16px'});
			$(".YfaqAA").css({ 'margin-top' : '-16px'});
			$(".YrealizacjeAA").css({ 'margin-top' : '-16px'});
			$(".YkontaktAA").css({ 'margin-top' : '-16px'});
			
			$(".winduxA").css({ 'margin-top' : '-16px'});
			$(".crockylogA").css({ 'margin-top' : '-16px'});
			

			
			
		}
		
		
		
		
		
		
		$(".wide_sliding_box").css({ 'height' : its_huge});
		var white_growing_bar_size=its_huge-300;
		$(".white_growing_bar").css({ 'height' : white_growing_bar_size});

		$(".static_box").css({ 'height' : its_huge});
		$(".static_box").css({ 'width' : its_wide});
		
		tmpx=0; $("#home").css({ 'left' : tmpx});//home left
		tmpx=(spwll*1)+(pgwd*1); $("#onas").css({ 'left' : tmpx});
		tmpx=(spwll*2)+(pgwd*2); $("#roz_mail").css({ 'left' : tmpx});
		tmpx=(spwll*3)+(pgwd*3); $("#bannery").css({ 'left' : tmpx});
		tmpx=(spwll*4)+(pgwd*4); $("#boxy").css({ 'left' : tmpx});
		tmpx=(spwll*5)+(pgwd*5); $("#realizacje").css({ 'left' : tmpx});
		tmpx=(spwll*6)+(pgwd*6); $("#faq").css({ 'left' : tmpx});
		tmpx=(spwll*7)+(pgwd*7); $("#kontakt").css({ 'left' : tmpx});
			
	
		
		//First Page Sets
		var Fmenu_top=(its_huge/2)-180;
		if (Fmenu_top<200) Fmenu_top=200;
		$("#Fmenu").css({ 'top' : Fmenu_top});
		$("#Fmenu").css({ 'left' : -310});
		$("#Flogo").css({ 'top' : -280});
		$("#Flogopl").css({ 'left' : -280});
		$("#Fsemple").css({ 'left' : its_wide});
		$(".windux").css({ 'top' : its_huge+500});
		$(".winduxF").css({ 'top' : its_huge+500});
		$(".windux").css({ 'left' : '320px'});
		$(".winduxF").css({ 'left' : '420px'});
		$("#Fcont_set").css({ 'left' : its_wide+500});
		
		
		
		
		//BOX RESET:
		$('#pane1').jScrollPaneRemove(); $('#pane1').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane2').jScrollPaneRemove(); $('#pane2').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane3').jScrollPaneRemove(); $('#pane3').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane4').jScrollPaneRemove(); $('#pane4').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane5').jScrollPaneRemove(); $('#pane5').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane6').jScrollPaneRemove(); $('#pane6').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane7').jScrollPaneRemove(); $('#pane7').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		$('#pane8').jScrollPaneRemove(); $('#pane8').jScrollPane({scrollbarWidth:28, scrollbarMargin:10});
		
		
		
		if (its_huge<720)//jesli mala strona
		{
			$("#Fmenu").css({ 'height' : 28});
			$("#Fmenu").css({ 'width' : its_wide+100});
			$("#Fmenu").css({ 'background' : '#202020'});
			$("#Fmenu").css({ 'top' : '150px'});
			$("#Fmenu").css({ 'position' : 'absolute'});
			
			$("#Fonas").css({ 'margin-top' : '0px'});
			$("#Fonas").css({ 'left' : '80px'});
			$("#Fonas").css({ 'position' : 'absolute'});
			$("#Fonas").css({ 'top' : '0px'});
			
			$("#Frozsylki").css({ 'margin-top' : '0px'});
			$("#Frozsylki").css({ 'left' : '154px'});
			$("#Frozsylki").css({ 'position' : 'absolute'});
			$("#Frozsylki").css({ 'top' : '0px'});
			
			$("#Fbannery").css({ 'margin-top' : '0px'});
			$("#Fbannery").css({ 'left' : '338px'});
			$("#Fbannery").css({ 'position' : 'absolute'});
			$("#Fbannery").css({ 'top' : '0px'});
			
			$("#Fboxy").css({ 'margin-top' : '0px'});
			$("#Fboxy").css({ 'left' : '437px'});
			$("#Fboxy").css({ 'position' : 'absolute'});
			$("#Fboxy").css({ 'top' : '0px'});
			
			$("#Frealizacje").css({ 'margin-top' : '0px'});
			$("#Frealizacje").css({ 'left' : '504px'});
			$("#Frealizacje").css({ 'position' : 'absolute'});
			$("#Frealizacje").css({ 'top' : '0px'});
			
			$("#Ffaq").css({ 'margin-top' : '0px'});
			$("#Ffaq").css({ 'left' : '610px'});
			$("#Ffaq").css({ 'position' : 'absolute'});
			$("#Ffaq").css({ 'top' : '0px'});
			
			$("#Fkontakt").css({ 'margin-top' : '0px'});
			$("#Fkontakt").css({ 'left' : '663px'});
			$("#Fkontakt").css({ 'position' : 'absolute'});
			$("#Fkontakt").css({ 'top' : '0px'});
		}
		else
		{
			$("#Fmenu").css({ 'height' : 310});
			$("#Fmenu").css({ 'width' : 183});
			$("#Fmenu").css({ 'background' : '#ffffff'});
			$("#Fmenu").css({ 'top' : '180px'});
			$("#Fmenu").css({ 'position' : 'relative'});
			
			$("#Fonas").css({ 'left' : '0px'});
			$("#Fonas").css({ 'position' : 'relative'});
			$("#Fonas").css({ 'margin-top' : '18px'});
			
			$("#Frozsylki").css({ 'left' : '0px'});
			$("#Frozsylki").css({ 'position' : 'relative'});
			$("#Frozsylki").css({ 'margin-top' : '18px'});
			
			$("#Fbannery").css({ 'left' : '0px'});
			$("#Fbannery").css({ 'position' : 'relative'});
			$("#Fbannery").css({ 'margin-top' : '18px'});
			
			$("#Fboxy").css({ 'left' : '0px'});
			$("#Fboxy").css({ 'position' : 'relative'});
			$("#Fboxy").css({ 'margin-top' : '18px'});
			
			$("#Frealizacje").css({ 'left' : '0px'});
			$("#Frealizacje").css({ 'position' : 'relative'});
			$("#Frealizacje").css({ 'margin-top' : '18px'});
			
			$("#Ffaq").css({ 'left' : '0px'});
			$("#Ffaq").css({ 'position' : 'relative'});
			$("#Ffaq").css({ 'margin-top' : '18px'});
			
			$("#Fkontakt").css({ 'left' : '0px'});
			$("#Fkontakt").css({ 'position' : 'relative'});
			$("#Fkontakt").css({ 'margin-top' : '18px'});
			var Fmenu_top=(its_huge/2)-180;
			if (Fmenu_top<200) Fmenu_top=200;
			$("#Fmenu").css({ 'top' : Fmenu_top});
			$("#Fmenu").css({ 'left' : -310});
		}
		
		
		//First page Animations

		
		if ((!isIE())||(!isIE()<7))
		{
			$("#curtain").css({ 'display' : 'none'});
			$("#Fmenu").animate({"left": "0"}, 1400);
			$("#Flogo").animate({"top": "3"}, 1400);
			$("#Flogopl").animate({"left": "5"}, 1400);
			$("#Fsemple").animate({"left": "353"}, 1400);
			$(".windux").css({ 'top' : its_huge-145});
			$(".winduxF").animate({"top": its_huge-145}, 1400);
			$("#Fcont_set").animate({"left": "230"}, 1400);
		}
		if (isIE()<7)
		{
			$("#curtain").css({ 'display' : 'none'});
			$("#Fmenu").css({ 'left' : 0});
			$("#Flogo").css({ 'top' : 3});
			$("#Flogopl").css({ 'left' : 5});
			$("#Fsemple").css({ 'left' : 353});
			$(".windux").css({ 'top' : its_huge-145});
			$(".winduxF").css({ 'top' : its_huge-145});
			$("#Fcont_set").css({ 'left' : 230});
		}
		
		
	}

	//jscript('var tfg=$("#roz_mail").position().left; setTimeout("$().scrollTo(\'#roz_mail\',2000);",2000);'); 
	function goa(gotoax)
	{
		var bname=navigator.appName;
		if (bname=="Microsoft Internet Explorer") var its_wide=screen.width;
		else its_wide=window.innerWidth;
		var tmpx=0;
		var tmpxq=0;
		var timeq="";
		
		if(gotoax=="o") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(4400-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},2000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="m") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(7000-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},2000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="b") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(9600-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},3000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="x") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(12200-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},3000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="r") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(14800-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},3000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="q") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(17400-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},4000);";
			setTimeout(timeq,2000);
		}
		if(gotoax=="k") 
		{ 
			tmpxq=its_wide-1000;
			tmpxq=(tmpxq/2)+50;
			tmpx=(20000-tmpxq);
			timeq="$.scrollTo({ top:0, left:"+tmpx+"},4000);";
			setTimeout(timeq,2000);
		}
	}
	
	
	
	
	function logo_anim()
	{
		$("#lgs").animate({opacity: 1}, 2500);
	}

	function admin_anim()
	{
		$("#content_in").animate({"opacity": "1"}, 2000);
	}
	
	function admin_show()
	{
		$('#content_in').css("opacity", "1");
	}
	
	function prefnt_size(s_tmp)
	{
		$('#pre_font').css("font-size", s_tmp);
	}
	
	function prefnt_family(s_tmp)
	{
		$('#pre_font').css("font-family", s_tmp);
	}
	
	function prefnt_color(s_tmp)
	{
		$('#pre_font').css("color", s_tmp);
	}
	
	function confrim_del(s_tmp,where_go)
	{
		var answer=confirm(s_tmp);
		if (answer) window.location.href=where_go;
	}
	
	function confrim_del_wback(s_tmp,where_go)
	{
		var answer=confirm(s_tmp);
		if (answer) window.location.href=where_go;
		else history.back();
	}


	

	
	
	
	
	
	
	

	
	
	
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);





$(function() {
	// Open link in new window
	$(".external").attr("target","_blank");
	
	// Place a vintage border on top of the slider on the home page
	$("#slider").prepend("<img src='' alt='Overlay' class='overlay_slider' />");
	
	// Toggle hidden elements
	$("div.hidden_element").hide()
	$("a.bullet").click(function() {
		$("div.hidden_element").slideToggle("slow");
	});
	
	// Animate menu
	$('.main_nav a')
		.css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(0 -52px)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:300, complete:function(){
				$(this).css({backgroundPosition: "0px 0px"})
			}})
		})

				
	// Set the scroll to anchor
	anchor.init()
	
});

anchor = {
	init : function()  {
		$("a.anchorLink").click(function () {	
			elementClick = $(this).attr("href")
			destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100 );
		  	return false;
		})
	}
}





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;
		};
		$('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.
		$('ul.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)
	$.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');			
	
	$('#relative-selector').click(function(){
		$paneTarget.stop().scrollTo( 'li:eq(14)', 800 );
	});
	$('#jquery-object').click(function(){
		var $target = $paneTarget.find('li:eq(3)');
		$paneTarget.stop().scrollTo( $target , 800 );
	});
	$('#dom-element').click(function(){
		var target = $paneTarget.find('ul').get(0).childNodes[20];
		$paneTarget.stop().scrollTo( target, 800 );
	});
	$('#absolute-number').click(function(){
		$paneTarget.stop().scrollTo( 150, 800 );
	});
	$('#absolute-number-hash').click(function(){
		$paneTarget.stop().scrollTo( { top:800,left:700} , 800 );
	});
	$('#absolute-position').click(function(){
		$paneTarget.stop().scrollTo( '520px', 800 );
	});
	$('#absolute-position-hash').click(function(){
		$paneTarget.stop().scrollTo( {top:'110px',left:'290px'}, 800 );
	});
	$('#relative-position').click(function(){
		$paneTarget.stop().scrollTo( '+=100', 500 );
	});
	$('#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');
	
	$('#options-no').click(function(){
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000 );
	});
	$('#options-axis').click(function(){//only scroll horizontally
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { axis:'x' } );
	});
	$('#options-duration').click(function(){//it's the same as specifying it in the 2nd argument
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', { duration: 3000 } );
	});
	$('#options-easing').click(function(){
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 2500, { easing:'elasout' } );
	});
	$('#options-margin').click(function(){//scroll to the "outer" position of the element
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { margin:true } );
	});
	$('#options-offset').click(function(){//same as { top:-50, left:-50 }
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { offset:-50 } );
	});
	$('#options-offset-hash').click(function(){
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { offset:{ top:-5,left:-30 } });
	});
	$('#options-over').click(function(){//same as { top:-50, left:-50 }
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { over:0.5 });
	});
	$('#options-over-hash').click(function(){
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1000, { over:{ top:0.2, left:-0.5 } });
	});
	$('#options-queue').click(function(){//in this case, having 'axis' as 'xy' or 'yx' matters.
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 2000, { queue:true });
	});
	$('#options-onAfter').click(function(){
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 2000, { 
			onAfter:function(){
				$('#options-message').text('Got there!');
			}
		});
	});
	$('#options-onAfterFirst').click(function(){//onAfterFirst exists only when queuing
		reset_o(); $paneOptions.scrollTo( 'li:eq(15)', 1600, { 
			queue:true,
			onAfterFirst:function(){
				$('#options-message').text('Got there horizontally!');
			},
			onAfter:function(){
				$('#options-message').text('Got there vertically!');
			}
		});
	});
});





