

//persistent accordion menu
//animatedcollapse.addDiv('science', 'fade=0,speed=200,group=sidebar,hide=1')
//animatedcollapse.addDiv('energy', 'fade=0,speed=200,group=sidebar,persist=1')
//animatedcollapse.addDiv('topic', 'fade=0,speed=200,group=sidebar,hide=1')
//animatedcollapse.addDiv('region', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_6', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_7', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_8', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_9', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_10', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_11', 'fade=0,speed=200,group=sidebar,hide=1')
animatedcollapse.addDiv('group_12', 'fade=0,speed=200,group=sidebar,hide=1')

animatedcollapse.init()


$(document).ready(function(){
		
		
	// Page Flip Subscribe Corner
	$("#pageflip").hover(function() { //On hover...
		$("#pageflip img , .msg_block").stop()
			.animate({ //Animate and expand the image and the msg_block (Width + height)
				width: '307px',
				height: '319px'
			}, 500);
	} , function() {
		$("#pageflip img").stop() //On hover out, go back to original size 50x52
			.animate({
				width: '50px',
				height: '52px'
			}, 220);
		$(".msg_block").stop() //On hover out, go back to original size 50x50
			.animate({
				width: '50px',
				height: '50px'
			}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
	});

	

	//When page loads... Tabs
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
	
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
	
		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
	
	// Click on image to enlarge
	$("img").fullsize();  
		
	// Find a journalist directory
	$("#reporters_sort")
	.tablesorter({sortList: [[0,0]], widgets: ['zebra'], widthFixed: true })  // sort on the first column and third column, order asc
	.tablesorterPager({container: $("#pager") }); 
	
	// Photo gallery slider
	$("#slider").easySlider({
	auto: true,
	continuous: true,
	speed: 800,
	pause: 3000
	});
	
	
	// opens links in new window
	$("a[href^='http']").not("[href*=http://www.newsciencejournalism.net]").not("[href*=http://newsciencejournalism.net]").not("[href^=#]").addClass("external").attr('target','_blank');

	
});



