/*
 * Interactive elements functionality for Purcell website
 * Date: 28/01/09
*/

$(document).ready(function() {

	$('.tab ul').hide();
		$('.tab > a').click(function() {
		if ($(this).next('ul').css('display') == 'none') {
			$('.tab').removeClass('active');
			$(this).parent('li').addClass("active");
			$('.tab ul').hide();
			$(this).next('ul').slideDown();
			return false;
		}
		return false;
	});
	
//	var contentHeight = $('#content').height();
//	if(contentHeight < 460){
//			$('#content').height(460);
//	}
	
	
	$('.personInfo').hide();
	$('.personName a').click(function(){
		var link = '.' + $(this).attr('id');
		if ($(link).css('display') == 'none') {
			
			$('.personInfo').slideUp('fast');
			
			$(link).slideDown();
			return false;
		}
		return false;
	});
	
	$('.event_info').css('display', 'none');
	$('.event_name a').click(function(){
		var link = '.' + $(this).attr('id');
		if ($(link).css('display') == 'none') {
			$('.event_info').slideUp('fast');
			
			$(link).slideDown();
			return false;
		}
		return false;
	});
	
	$('#content table tr:even').css('background', '#e5d9b8');
   
   	$('.entry_description a[href$=.pdf]').prepend("<img style='float: left; ' src='images/pdf_logo.gif' alt='pdf logo' />");
   	$('.entry_description a[href$=.PDF]').prepend("<img style='float: left; ' src='images/pdf_logo.gif' alt='pdf logo' />");
   
 });