jQuery(document).ready(function(){

	//Tabs
	//$(".feat ul, ").tabs(".feat_content > div", {effect: 'fade', fadeOutSpeed: 'fast', history: true});
	jQuery(".tab_menu ul").tabs(".tab_menu_content > div", {effect: 'slide'});

	//News Ticker
	jQuery("#newsticker").newsTicker();

	//slider
	
	$('.slideshow').mouseover(function() {
		$('#next_navigation').show();
		$('#prev_navigation').show();
	}).mouseout(function(){
		$('#next_navigation').hide();
		$('#prev_navigation').hide();  
	});
	
	$('.slides_control').mouseover(function() {
		$('#next_navigation').show();
		$('#prev_navigation').show();
	}).mouseout(function(){
		$('#next_navigation').hide();
		$('#prev_navigation').hide();  
	});
	
	$('.navigation').mouseover(function() {
		$('#next_navigation').show();
		$('#prev_navigation').show();
	}).mouseout(function(){
		$('#next_navigation').hide();
		$('#prev_navigation').hide();  
	});
	
	//Scroll to #anchor     
	jQuery(function(){
	  var target = location.hash && $('a[hash='+location.hash+']')[0];
	  if( target )
		  jQuery.scrollTo( target, { speed:400 });
	}); 

	
	//Fade images on hover
	jQuery("img").hover(function(){
		jQuery(this).fadeTo(400, 0.6);
	},function(){
		jQuery(this).fadeTo(400, 1.2);
	});


	//Switch classes
	jQuery("a.switch").toggle(function(){
	  jQuery(this).addClass("swap"); 
	  jQuery("ul.switch").fadeOut("fast", function() {
		  jQuery(this).fadeIn("fast").removeClass("half"); 
		 });
	  }, function () {
	  jQuery(this).removeClass("swap");
	  jQuery("ul.switch").fadeOut("fast", function() {
		  jQuery(this).fadeIn("fast").addClass("half");
		});
	});	
	
	//Superfish menu
	jQuery("ul.sf-menu").supersubs({
				minWidth:    12,
				maxWidth:    27,
				extraWidth:  1
			}).superfish({
				delay: 200,
				speed: 'fast'
			});

	//Tooltip
	jQuery('.tooltip').tipsy({gravity: $.fn.tipsy.autoNS});

	//Lazy Load
	jQuery(".cat_list img, .commentlist img").lazyload({ 
		placeholder: "/wp-content/themes/news24/images/grey.gif", effect: "fadeIn" 
	});

});
