$(document).ready(function(){ 
    	
		$("ul.sf-menu").supersubs().superfish({ 
         //pathClass:  'current',
		 delay: 200,
		 dropShadows: false
        });  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason.  
		
		//Tab Panel
		//$(".article_video_playlist a").click(function(){ 
		$(".article_video_playlist_listings a").click(function(){ 
    	// capture the url to load from the href
    	var urlLoad = $(this).attr("href");
		$("#article_video").load(urlLoad);
    	// just make sure the page does not reload 
    	return false; 
  		}); 

		$(".tabbed_box li a").click(function(){		
			clearInterval(autoRotate);
			currentTab = -2;
			
	    	var urlLoad = $(this).attr("href");
			var urlLoadclean = urlLoad.replace("/news/article/","/site/main_tab/");
			
			ajaxLoad($(this));		
		 
			if(urlLoadclean.indexOf("news") == -1) {
				return false;
			}
		})
	
		//Load the tabs
		$(".tabbed_content").load("/site/main_tab/");
		
		//Lightbox script
		$(".lightbox").lightbox();
		
		//Add some css when hover over news_snippet
		$(".news_snippet").hover(function(){
		//$(this).css({'background-color' : 'yellow', 'font-weight' : 'bolder'});
  		});
		
		//Ajaxify this!
		//$('.ajaxify').ajaxify();
		$('.ajaxify').ajaxify({
        animateOut:{height:'0%'},
        animateOutSpeed:300,
        animateIn:{height:'100%'},
        animateInSpeed:300,
		loading_img:'/images/loading.gif'
		});
		
		$('.tagToload').ajaxify({
   		tagToload: '.news_body',
		animateOut:{height:'0%'},
        animateOutSpeed:300,
        animateIn:{height:'100%'},
        animateInSpeed:300,
		loading_img:'/images/loading.gif'
		});
		
		//$('#paginate a').ajaxify({
   		//tagToload: '.news_body',
		//animateOut:{height:'0%'},
        //animateOutSpeed:300,
        //animateIn:{height:'100%'},
        //animateInSpeed:300,
		//loading_img:'/images/loading.gif',
		////target:'#news_listing'
		//});

});