/*

	jQuery Scroller plugin
	Copyright (c) 2010 Max Vergelli

	For support and tutorials visit
	http://maxvergelli.wordpress.com/

	License: GNU Lesser General Public License (LGPL) 
	at http://opensource.org/licenses/lgpl-2.1.php

	This plugin is free software;  you can redistribute it  and/or  modify  it 
	under the terms of the GNU Lesser General Public License as  published  by 
	the Free Software Foundation;  either version 2.1 of the License,  or  (at 
	your option) any later version.
	This software is distributed in the hope  that  it  will  be  useful,  but 
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
	or FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU Lesser  General  Public 
	License for more details.
	You should have received a copy of  the  GNU Lesser General Public License 
	along with this library;  if not,  write to the  Free Software Foundation, 
	Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

	THIS COMMENT AND COPYRIGHT NOTICE MUST BE RETAINED IN THE CODE AS IS FOR LEGAL USE

*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.N.1k=6(){5.8().9();5.8().r(\'7\',[\'R\'])};$.N.1l=6(){5.8().9()};$.N.1m=6(a){5.8().9();5.8().V(\'7\');a=$.W(5.X(),a);5.Y(a)};$.N.1n=6(){5.8().9();5.8().w({s:0,t:0});5.8().V(\'7\')};$.N.Y=6(h){4 x={y:5};h=$.W({S:Z,10:\'11\',12:\'B\',P:\'1o\',13:\'T\',14:\'1p\',15:\'O\',16:\'O\',U:\'1q\'},h);4 i=z h.S==\'17\'?3(h.S):Z;4 j=h.10.E();4 k=h.12.E();4 l=z h.P==\'17\'&&h.P>0?3(h.P):-1;4 m=h.13.E();4 n=h.14.E();4 o=h.15.E();4 p=h.16.E();4 q=h.U.E();x.y.X(h);18();6 18(){x.y.w(\'U\',q);2(j==\'11\'){2(k!=\'B\'&&k!=\'t\'){k=\'B\'};19()}u{2(k!=\'F\'&&k!=\'s\'){k=\'F\'};1a()};2(n==\'O\'){x.y.1b(6(){$(5).8().9();$(5).8().r(\'7\',[\'R\'])})}u{x.y.1b(6(){$(5).8().9()})};2(o==\'O\'){x.y.1c(6(){$(5).8().9();$(5).8().r(\'7\',[\'R\'])})}u{x.y.1c(6(){$(5).8().9()})};2(p!=\'O\'){x.y.8().9()}};6 1a(){x.y.8().1d(\'7\',6(a,c){4 b=$(5);4 d=3(b.G().H());4 e=3(b.H());4 f=3(b.A().s);4 v=i>0&&i<C?(C-i)*C:1e;4 g=3(v*e/C)+v;2(m==\'Q\'){I(k){J\'F\':2(z c==\'D\'){b.w({s:d-e})};d=f-(e+d);K;L:2(z c==\'D\'){b.w({s:0})};d+=f+e}}u{I(k){J\'F\':2(z c==\'D\'){b.w({s:d});d=-e}u{d=f-(e+d)};K;L:2(z c==\'D\'){b.w({s:-e})}u{d+=f+e}}};2(l<0||l>0){2(l>0){l--};b.1f({s:d},{1g:g,1h:\'T\',1i:6(){b.r(\'7\')},1j:6(){I(m){J\'Q\':2(k==\'F\'){2(3(b.A().s)<=0){k=\'s\';b.9();b.r(\'7\')}}u{2(3(b.A().s)+3(b.H())>=3(b.G().H())){k=\'F\';b.9();b.r(\'7\')}};K;L:2(k==\'F\'){2(3(b.A().s)<-3(b.H())){b.9();b.r(\'7\')}}u{2(3(b.A().s)>3(b.G().H())){b.9();b.r(\'7\')}}}}})}}).r(\'7\')};6 19(){x.y.8().1d(\'7\',6(a,c){4 b=$(5);4 d=3(b.G().M());4 e=3(b.M());4 f=3(b.A().t);4 v=i>0&&i<C?(C-i)*C:1e;4 g=3(v*e/C)+v;2(m==\'Q\'){I(k){J\'B\':2(z c==\'D\'){b.w({t:d-e})};d=f-(e+d);K;L:2(z c==\'D\'){b.w({t:0})};d+=f+e}}u{I(k){J\'B\':2(z c==\'D\'){b.w({t:d});d=-e}u{d=f-(e+d)};K;L:2(z c==\'D\'){b.w({t:-e})}u{d+=f+e}}};2(l<0||l>0){2(l>0){l--};b.1f({t:d},{1g:g,1h:\'T\',1i:6(){b.r(\'7\')},1j:6(){I(m){J\'Q\':2(k==\'B\'){2(3(b.A().t)<=0){k=\'t\';b.9();b.r(\'7\')}}u{2(3(b.A().t)+3(b.M())>=3(b.G().M())){k=\'B\';b.9();b.r(\'7\')}};K;L:2(k==\'B\'){2(3(b.A().t)<-3(b.M())){b.9();b.r(\'7\')}}u{2(3(b.A().t)>3(b.G().M())){b.9();b.r(\'7\')}}}}})}}).r(\'7\')};1r 5}})(1s);',62,91,'||if|parseInt|var|this|function|marquee|children|stop||||||||||||||||||trigger|top|left|else||css|_|me|typeof|position|right|100|undefined|toLowerCase|bottom|parent|height|switch|case|break|default|width|fn|play|loop|pingpong|resume|velocity|linear|cursor|unbind|extend|data|SetScroller|50|direction|horizontal|startfrom|movetype|onmouseover|onmouseout|onstartup|number|main|scrollHorizontal|scrollVertical|mouseover|mouseout|bind|5000|animate|duration|easing|complete|step|PlayScroller|PauseScroller|ResetScroller|RemoveScroller|infinite|pause|pointer|return|jQuery'.split('|'),0,{}))
$(document).ready(function() {

	//create scroller for each element with "horizontal_scroller" class...
	$('.horizontal_scroller').SetScroller({	velocity: 	 60,
											direction: 	 'horizontal',
											startfrom: 	 'right',
											loop:		 'infinite',
											movetype: 	 'linear',
											onmouseover: 'pause',
											onmouseout:  'play',
											onstartup: 	 'play',
											cursor: 	 'pointer'
										});	
										
	$('.horizontal_scroller_2').SetScroller({	velocity: 	 58,
											direction: 	 'horizontal',
											startfrom: 	 'left',
											loop:		 'infinite',
											movetype: 	 'linear',
											onmouseover: 'pause',
											onmouseout:  'play',
											onstartup: 	 'play',
											cursor: 	 'pointer'
										});	
										
	$('.horizontal_scroller_3').SetScroller({	velocity: 	 58,
											direction: 	 'vertical',
											startfrom: 	 'left',
											loop:		 'infinite',
											movetype: 	 'linear',
											onmouseover: 'pause',
											onmouseout:  'play',
											onstartup: 	 'play',
											cursor: 	 'pointer'
										});
	/*
		All possible values for options...
		
		velocity: 		from 1 to 99 								[default is 50]						
		direction: 		'horizontal' or 'vertical' 					[default is 'horizontal']
		startfrom: 		'left' or 'right' for horizontal direction 	[default is 'right']
						'top' or 'bottom' for vertical direction	[default is 'bottom']
		loop:			from 1 to n+, or set 'infinite'				[default is 'infinite']
		movetype:		'linear' or 'pingpong'						[default is 'linear']
		onmouseover:	'play' or 'pause'							[default is 'pause']
		onmouseout:		'play' or 'pause'							[default is 'play']
		onstartup: 		'play' or 'pause'							[default is 'play']
		cursor: 		'pointer' or any other CSS style			[default is 'pointer']
	*/

	//how to overwrite options after setup and without deleting the other settings...
	$('#no_mouse_events').ResetScroller({	onmouseover: 'play', onmouseout: 'play'   });
	$('#scrollercontrol').ResetScroller({	velocity: 80, startfrom: 'left'   });

	//if you need to remove the scrolling animation, uncomment the following line...
	//$('#scrollercontrol').RemoveScroller();

	//how to play or stop scrolling animation outside the scroller... 
	$('#play_scrollercontrol').mouseover(function(){   $('#scrollercontrol').PlayScroller();   });
	$('#stop_scrollercontrol').mouseover(function(){   $('#scrollercontrol').PauseScroller();  });		

	//create a vertical scroller...	
	$('.vertical_scroller').SetScroller({	velocity: 80, direction: 'vertical'  });		
	$('.vertical_scroller_2').SetScroller({	velocity: 80, direction: 'vertical'  });		
	$('.vertical_scroller_3').SetScroller({	velocity: 80, direction: 'vertical'  });		
	
	//"$('#soccer_ball_container')" inherits scrolling options from "$('.horizontal_scroller')",
	// then I reset new options; besides, "$('#soccer_ball_container')" will wraps and scrolls the bouncing animation...
	$('#soccer_ball_container').ResetScroller({	 velocity: 85, movetype: 'pingpong', onmouseover: 'play', onmouseout: 'play'  });
	$('#soccer_ball_container_2').ResetScroller({	 velocity: 80, movetype: 'pingpong', onmouseover: 'play', onmouseout: 'play'  });
	$('#soccer_ball_container_3').ResetScroller({	 velocity: 80, movetype: 'pingpong', onmouseover: 'play', onmouseout: 'play'  });

	//create soccer ball bouncing animation...
	$('#soccer_ball').bind('bouncer', function(){
			$(this).animate({top:10}, 100, 'linear').animate({top:5}, 100, 'linear', function(){$('#soccer_ball').trigger('bouncer');});			
	}).trigger('bouncer');	
	
	$('#soccer_ball_2').bind('bouncer', function(){
			$(this).animate({top:10}, 100, 'linear').animate({top:5}, 100, 'linear', function(){$('#soccer_ball_2').trigger('bouncer');});			
	}).trigger('bouncer');	
	
	$('#soccer_ball_3').bind('bouncer', function(){
			$(this).animate({top:10}, 100, 'linear').animate({top:5}, 100, 'linear', function(){$('#soccer_ball_3').trigger('bouncer');});			
	}).trigger('bouncer');

});
