 jQuery(function(){
    jQuery('#video-list .list').jScrollPane({
      dragMaxHeight: 51,
      showArrows: true,
      scrollbarWidth: 11
    });
    
    jQuery('#banners .wrap').serialScroll({
    		items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
    		prev:'.pagination li.first a',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
    		next:'.pagination li.last a',// Selector to the 'next' button (absolute too)
    		axis:'xy',// The default is 'y' scroll on both ways
    		navigation:'.pagination li a',
    		duration:1000,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
    		force:true, // Force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
    		start: 0, // On which element (index) to begin ( 0 is the default, redundant in this case )		
    		step:3, // How many items to scroll each time ( 1 is the default, no need to specify )
    		
    		onBefore:function( e, elem, jQuerypane, jQueryitems, pos ){
        			/**
        			 * 'this' is the triggered element 
        			 * e is the event object
        			 * elem is the element we'll be scrolling to
        			 * jQuerypane is the element being scrolled
        			 * jQueryitems is the items collection at this moment
        			 * pos is the position of elem in the collection
        			 * if it returns false, the event will be ignored
        			 */
        			 //those arguments with a jQuery are jqueryfied, elem isn't.
        			e.preventDefault();
        			if( this.blur )
        				this.blur();
        		}
    	});
  	});
		
		jQuery(document).ready(function () {
			jQuery('.event_date').each(function (i) {
				jQuery(this).text(jQuery(this).text().replace(/\s/g, '.'));
			});
			jQuery('#videoSelect').change(function() {
				location=jQuery('#videoSelect option:selected').val();
			});
			jQuery('#video-list ul.list > li').each(function (i) {
				jQuery(this).click(function() {
					location=jQuery(this).children('a').attr('href');
				});
			});
		});