$(function()
{
	$('ul.jcarousel-skin-tango').galleria({
		insert: '.frame_outer .galleria_insert',
		onImage: function(image, caption, thumb)
		{
			$('div.frame_outer div.ml').add('div.frame_outer div.mr').add('div.frame_outer div.center').height($('div.frame_outer div.center img').height());
			$('p.photo_descr').text(photo_descriptions[thumb.attr('title')]);

			$('.galleria_insert img').rightClick(function(){
				alert('Copyright © 2009 Dirk Rozich.  All Rights Reserved.');
				return false;
			});
			                                            
			var caption_segments = caption.html().split(":");
			caption_segments.splice(0, 1);
			caption.html(caption_segments.join(":"));
			
			/* expand tooltip functionality -- keep
			try { $('div.center').tooltip().get().remove();	} catch (e) { /* don't care if it throws an err  }
			$('div.center').tooltip().create({
				content: function()
				{
					return "<a class='viewlarge_link' href='javascript: void(0)'>View Large</a>";
				},
				relativeLeft: -53,
				relativeTop: -25,
				css: {
					background: 'black',
					color: 'white',
					fontSize: '11px',
					padding: '4px',
					"-webkit-border-top-left-radius": '10px',
					"-moz-border-radius-topleft": '8px'					
				},
				transition: 'drop',
				transitionDuration: 300
			});*/
		},
		onThumb: function(thumb)
		{
			if (thumb[0] == $('#gallery_carousel li:eq(0) img')[0])
			{
				$('#gallery_carousel li:eq(0) img').trigger('click');
				$('div.frame_outer').css('display', 'inline-block');
			}
		},	
		clickable: true,
		history: false
	});
	
	$('#gallery_carousel').jcarousel({
		vertical: true,
		scroll: 6
	});
	
	$('#gallery_carousel li').rightClick(function(){
		alert('Copyright © 2009 Dirk Rozich.  All Rights Reserved.');
		return false;
	});
	
});

var photo_descriptions = {};