  
  $(document).ready(function(){
    $("#newstabs > ul").tabs({ fx: { opacity: 'toggle', duration: 'fast'}}).bind('show.ui-tabs', function(e, ui) {
    	$("#newspart_"+ui.panel.id).remove().prependTo("#newscontainer");
    	$("#newspart_"+ui.panel.id).hide();
    	$("#newspart_"+ui.panel.id).slideDown("slow");
   	});
   	
   	$("#newstabs_cat > ul").tabs({ fx: { opacity: 'toggle', duration: 'fast'}}).bind('show.ui-tabs', function(e, ui) {
    	$("#newspart_"+ui.panel.id).remove().prependTo("#newscontainer");
    	$("#newspart_"+ui.panel.id).hide();
    	$("#newspart_"+ui.panel.id).slideDown("slow");
		$(".reload").load('/index/categoryAjax/id/'+(ui.panel.id).substring(4,(ui.panel.id).length), null, function(responseText)
		{
		});
   	});
   	
	$("#newstabs2 > ul").tabs({ fx: { opacity: 'toggle', duration: 'fast' }});
  });
  
  
  $.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 (Math.abs(c) > a) { 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;
		};
		
  $(document).ready(function(){
		
			$('.carusel').serialScroll({
				items:'li', //selector to the items ( relative to the matched elements, '#sections' in this case )
				prev:'.caruselscreen img.prev',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
				next:'.caruselscreen img.next',//selector to the 'next' button (absolute too)
				axis:'xy',//the default is 'y'
//				queue:true,//we scroll on both axes, don't scroll both at the same time.
				event:'click',//on which event to react (click is the default, you probably won't need to specify it)
				stop:false,//each click will stop any previous animations of the target. (false by default)
				lock:true, //ignore events if already animating (true by default)
				duration:500,//length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
				start: 0, //on which element (index) to begin ( 0 is the default, redundant in this case )
				force:false, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
				cycle:0,//cycle endlessly ( constant velocity, true is the default )
				step:1, //how many items to scroll each time ( 1 is the default, no need to specify )
				jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
				lazy:false,//(default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
				interval:5000, //it's the number of milliseconds to automatically go to the next
				onBefore:function( e, elem, $pane, $items, pos ){
					/**
					 * 'this' is the triggered element 
					 * e is the event object
					 * elem is the element we'll be scrolling to
					 * $pane is the element being scrolled
					 * $items 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 $ are jqueryfied, elem isn't.
					e.preventDefault();
					if( this.blur )
						this.blur();
				},
				onAfter:function( elem ){
					//'this' is the element being scrolled ($pane) not jqueryfied
				}
			});
			
			$('.photocarusel').serialScroll({
				items:'li', //selector to the items ( relative to the matched elements, '#sections' in this case )
				prev:'.photocaruselscreen img.photoprev',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
				next:'.photocaruselscreen img.photonext',//selector to the 'next' button (absolute too)
				axis:'xy',//the default is 'y'
//				queue:true,//we scroll on both axes, don't scroll both at the same time.
				event:'click',//on which event to react (click is the default, you probably won't need to specify it)
				stop:false,//each click will stop any previous animations of the target. (false by default)
				lock:true, //ignore events if already animating (true by default)
				duration:500,//length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
				start: 0, //on which element (index) to begin ( 0 is the default, redundant in this case )
				force:true, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
				cycle:0,//cycle endlessly ( constant velocity, true is the default )
				step:1, //how many items to scroll each time ( 1 is the default, no need to specify )
				jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
				lazy:false,//(default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
				interval:0, //it's the number of milliseconds to automatically go to the next
				onBefore:function( e, elem, $pane, $items, pos ){
					/**
					 * 'this' is the triggered element 
					 * e is the event object
					 * elem is the element we'll be scrolling to
					 * $pane is the element being scrolled
					 * $items 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 $ are jqueryfied, elem isn't.
					e.preventDefault();
					if( this.blur )
						this.blur();
				},
				onAfter:function( elem ){
					//'this' is the element being scrolled ($pane) not jqueryfied
				}
			});
			
			$('.videocarusel').serialScroll({
				items:'li', //selector to the items ( relative to the matched elements, '#sections' in this case )
				prev:'.videocaruselscreen img.videoprev',//selector to the 'prev' button (absolute!, meaning it's relative to the document)
				next:'.videocaruselscreen img.videonext',//selector to the 'next' button (absolute too)
				axis:'xy',//the default is 'y'
//				queue:true,//we scroll on both axes, don't scroll both at the same time.
				event:'click',//on which event to react (click is the default, you probably won't need to specify it)
				stop:false,//each click will stop any previous animations of the target. (false by default)
				lock:true, //ignore events if already animating (true by default)
				duration:500,//length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
				start: 0, //on which element (index) to begin ( 0 is the default, redundant in this case )
				force:true, //force a scroll to the element specified by 'start' (some browsers don't reset on refreshes)
				cycle:0,//cycle endlessly ( constant velocity, true is the default )
				step:1, //how many items to scroll each time ( 1 is the default, no need to specify )
				jump:false, //if true, items become clickable (or w/e 'event' is, and when activated, the pane scrolls to them)
				lazy:false,//(default) if true, the plugin looks for the items on each event(allows AJAX or JS content, or reordering)
				interval:0, //it's the number of milliseconds to automatically go to the next
				onBefore:function( e, elem, $pane, $items, pos ){
					/**
					 * 'this' is the triggered element 
					 * e is the event object
					 * elem is the element we'll be scrolling to
					 * $pane is the element being scrolled
					 * $items 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 $ are jqueryfied, elem isn't.
					e.preventDefault();
					if( this.blur )
						this.blur();
				},
				onAfter:function( elem ){
					//'this' is the element being scrolled ($pane) not jqueryfied
				}
			});
			$('.photo_prev_img').css('cursor', 'pointer');
			
			$('.photo_prev_img').click(
				function(){
					$('#photo_v').attr('src', $(this).attr('src')+'_f'); 
				}
			);
			
			
			$('.newsheader').click(function(){
				$.get("/stat/count/id/"+$(this).attr('name')); 
			});
			
			$('.newsbody').click(function(){
				$.get("/stat/count/id/"+$(this).attr('name')); 
			});
			
			$('#logobox').css('cursor', 'pointer');
			$('#logobox').click(function(){
				location.href='/';
			});
			
			$('#newstabs').css('display', 'block');
			$('#newstabs_cat').css('display', 'block');
			$('#newstabs2').css('display', 'block');
			
			
			
		});  