$(document).ready(function(){
	
	// PHOTO GALLERY
	//	if($('a.photo-prev').length && $('a.photo-next').length){
		
		$('a.photo-prev,a.photo-next').live('click', function(){
			
			var theRel = $(this).attr('rel');
			var theData = 'method=photo.getPrevNext&' + theRel; 
			
			if(theRel.length){
			
				$.ajax({
					type: 'GET',
					url: '/_api/index.cfm',
					cache: false,			   
					data: theData,
					dataType: 'script',		   
					success: function(data){
						setPrevNext();		
					}
				});		

			};
							
			return false;		
		
		});
		
		$('#photo-info').hover(function(){
			$(this).stop().animate({top:'103px'},{queue:false,duration:300});
		}, function() {
			$(this).stop().animate({top:'323px'},{queue:false,duration:300});
		});
	//	};	

	$('.help').colorbox({transition:"none", width:"750px", height:"550px"});
	
	// make fieldsets expandable
	$('fieldset.expandable legend').click(function(){
		$(this).parent().parent().children('ul').toggle();
	});
	
	// make expandable fieldset stuff hidden by default{
	$('fieldset.expandable ul').hide();	
				
	
});
