jQuery.noConflict();

jQuery(document).ready(function() {
	//slide down menus on fellow sidebar module
	jQuery("ul.pastFellows li ul").slideUp();
	jQuery("ul.pastFellows li a.toggle").parent().addClass('closed');
	jQuery("ul.pastFellows li a.toggle").click(function() {
		toggleList(jQuery(this));
	});

	//toggle for slide open h3s
	jQuery("#categorizedNewsletters ul").hide();
	jQuery("#categorizedNewsletters h3 a").click(function() {
		jQuery(this).parent().siblings('ul').toggle();
		jQuery(this).parent().toggleClass("open");
	});
	
	//scorecard comparisons
	jQuery('.controls div.comparisons').hide();
	jQuery('.controls label.compare_list').click(function(){
		jQuery('.controls div.comparisons').slideToggle('normal');
		jQuery(this).toggleClass('opened');
	});
	
	//Lightbox functionality
	jQuery("a.lightbox").fancybox({ 
		'zoomSpeedIn': 300, 
		'zoomSpeedOut': 300, 
		'imageScale': true,
		'overlayShow': true,
		'centerOnScroll': true,
		'zoomOpacity': 300,
		'overlayOpacity': 0,
		'frameWidth':600,
		'frameHeight':800
	}); 
			
	//citation rollover
	jQuery(".citation_box").hide();
	jQuery("li.citation").hover(function() {
			jQuery(this).children('.citation_box').slideDown("fast");
		},
		function() {
			jQuery(this).children('.citation_box').slideUp("fast");
		}
	);	
	
	//text resizer
	jQuery("a.resize").click(function(){ 
		//the title and foot sections should have the same base font size, group them
		var $titleText = jQuery('div.page_title'); 
		var $footText = jQuery('div.text_foot'); 
		var titlefootSize = $titleText.css('font-size'); 
		var tnum = parseFloat(titlefootSize, 10); // parse the number value out of the font size value, set as a var called 'num'
		var tunit = titlefootSize.slice(-2); //this value is usually 'px'
		//the text and citation sections should have the same font size, group them
		var $bodyText = jQuery('div.text'); 
		var $citationText = jQuery('div.citation'); 
		var bodycitationSize = $bodyText.css('font-size'); 
		var bnum = parseFloat(bodycitationSize, 10); // parse the number value out of the font size value, set as a var called 'num'
		var bunit = bodycitationSize.slice(-2); //this value is usually 'px'
		if (this.id == 'large_text'){ 
			tnum = 17; 
			bnum = 20;
		}  else if (this.id == 'normal_text'){//these are hardcoded based on current css, may need to be changed if styles are changed
			tnum = 13; 
			bnum = 16;
		} else if (this.id == 'small_text'){
			tnum = 10;
			bnum = 12;
		}
		$titleText.css('font-size', tnum + tunit); 
		$footText.css('font-size', tnum + tunit); 
		$bodyText.css('font-size', bnum + bunit); 
		$citationText.css('font-size', bnum + bunit); 
		   return false;
	});

});


function toggleList(element)
{
  var list = element.siblings("ul");
  var p = element.parent();
  if(list) 
  {
    if(p.hasClass('closed'))
    {
      p.removeClass('closed');
      p.addClass('opened');
      list.slideDown();
    }else{
      p.removeClass('opened');
      p.addClass('closed');
      list.slideUp();
    }
  }
}



	

	


