$(function() {	

// "more info" text show/hide
	$("#mainContentTree.advisoryBoard #pageBody ul.rosterListing").addClass("jQuery-compatible");
	$("ul.rosterListing li span.expandedCopy").before('<a class="readFull">Read full bio</a>').after('<p class="infoLink"><a class="infoClose">close</a></p>');
	
	$("ul.rosterListing li a.readFull, ul.rosterListing li a.infoClose").click(function() {
	
	var infoBox = $(this).parents("ul.rosterListing li").children(".expandedCopy");
	if (parseInt(infoBox.height()) == 0) { 
		infoBox.addClass("offscreenBuffer");
		infoBox.css({
			"height":"auto",
			"display":"block"
		});
		var infoBoxFullHeight = infoBox.height();
		infoBox.css("height", 0);
		infoBox.removeClass("offscreenBuffer");
		targetHeight = infoBoxFullHeight;
		infoBox.siblings("p.infoLink").show();
		infoBox.siblings("a.readFull").hide();
	} else { 
		targetHeight = 0;
		infoBox.siblings("p.infoLink").hide();
		infoBox.siblings("a.readFull").show();
	}

 infoBox.animate({ 
		height: targetHeight
	}, 150, function() {
		if (targetHeight != 0 ) { 
			infoBox.css({
				"height":"auto", 
				"display":"inline" 
			})
		} else {
			infoBox.css({
				"display":"none" 
			})
		}
	} );

	});

	
	// pop up video links
	$("a[rel='detail']").openDOMWindow({  
		width: 563, 
		height: 310,
		eventType: 'click', 
		windowBGColor: '#f4edbf',
		windowSource: 'iframe',
		functionCallOnOpen: function() {
			$("#DOMWindow").append('<p class="windowLink"><a class="windowClose">close</a></p>');			
		}
	});  
	
	// Handle close links
	$().click(function(e){
		var $target = $(e.target);
		if($target.is(".windowClose")){ 
			e.preventDefault();
			$.closeDOMWindow(); 
		}
	});



});


