// Pacific Union College
// Written by Nic Hubbard
// nic@zedsaid.com

$(document).ready(function() {
	
	// Show extra info
	$('span.name a').click(function() {
		// Slide up all
		//$('span.name').parent().next().slideUp('slow');
		
		var obj = $(this).parent('.name').parent().next();
		var sel = $(this);
		if ($(this).hasClass('open')) {
			obj.slideUp('slow', function() {
				sel.removeClass('open');
			});
		} else {
			$(this).addClass('open');
			obj.slideDown('slow');
		}
		
		return false;
	});
	
	
	// Make our own lightbox effect
	$('a.zedbox').click(function() {
		// Remove
		if ($('#zedbox').length > 0) $('#zedbox').remove();
		
		var loc = $(this).attr('href');						 
		$('body').prepend('<div id="zedbox-blanket"></div>');
		$('body').prepend('<div id="zedbox" style="background-image: url('+loc+');"><div class="close"></div></div>');
		
		$('#zedbox-blanket, #zedbox div.close').click(function() {
			$('#zedbox-blanket').remove();								
			$('#zedbox').fadeOut('fast');								
		});
		return false;			 
	});//end click
	
});

/**
* Checks to see if a variable is set
*
* @param string		obj		The variable we check
*
* @version $Revision: 0.1
*/
function isset(obj)
{
	// Check to see if a variable or array item is set
	if (typeof(obj) == 'undefined') {
		return false;
	} else {
		return true;
	}

}//end isset
