$(function() {
	$('.nav_link').mouseover(function() {
		$(this).css('opacity',0.75);
		$('body').css('cursor','hand');
		$('body').css('cursor','pointer');
	});
	$('.nav_link').mouseout(function() {
		if ($(this).attr('class')!='nav_link active') $(this).css('opacity',1);
		$('body').css('cursor','default'); 
	});
	$('#logo').mouseover(function() {
		$('body').css('cursor','hand');
		$('body').css('cursor','pointer');
	});
	$('#logo').mouseout(function() {
		$('body').css('cursor','default'); 
	});
	$('#nav_link1').click(function() {
		document.location.href='/photography_asia.php';
		return false;
	});
	$('#nav_link2').click(function() {
		document.location.href='/illustration_childrens_illustration.php';
		return false;
	});
	$('#nav_link3').click(function() {
		document.location.href='/writing_la_cordonnier.html';
		return false;
	});
	$('#nav_link4').click(function() {
		document.location.href='/about.html';
		return false;
	});
	$('#nav_link5').click(function() {
		document.location.href='/contact.php';
		return false;
	});
	$('#logo').click(function() {
		document.location.href='/index.html';
		return false;
	});
	$('.gallery_select').change(function() {
		if ($(this).val()) document.location.href='/'+$(this).val()+'.php';
		return false;
	});
	$('#writings_select').change(function() {
		if ($(this).val()) document.location.href='/'+$(this).val()+'.html';
		return false;
	});
});

function initGallery() {
$('ul.gallery').show();
$('ul.gallery').galleria({
	history   : true,
	clickNext : true,
	insert    : '#gallery_image',
	onImage   : function(image,caption,thumb) {
		var tmp=caption.html().replace(/&gt;/g,'>');
		tmp=tmp.replace(/&lt;/g,'<');
		if (tmp) caption.html('<table border="0" cellpadding="0" cellspacing="8" width="90%"><tr><td align="center">'+tmp+'</td></tr></table>');
		image.css('display','none').fadeIn(1000);
		caption.css('display','none').fadeIn(1000);
		var _li = thumb.parents('li');
		_li.siblings().children('img.selected').fadeTo(500,0.3);
		thumb.fadeTo('fast',1).addClass('selected');
		image.attr('title','Next image >>');
	},
	onThumb : function(thumb) {
		var _li = thumb.parents('li');
		var _fadeTo = _li.is('.active') ? '1' : '0.3';
		thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
		thumb.hover(
			function() { thumb.fadeTo('fast',1); },
			function() { _li.not('.active').children('img').fadeTo('fast',0.3); }
		)
	}
});
}