$(document).ready(function(){
	if($.fn.fancybox) { 
	var fbonstart = ($('.fancybox-ie').length != 0) ? function(){if($ 
	('#fbiecssfix').length == 0) $('head').append('<link id="fbiecssfix" rel="stylesheet" type="text/css" media="all" href="js/fancybox/jquery.fancybox-1.3.4-iefix.css" />');
	} : null; 

	$("#yourfancyboxlink").fancybox({'onStart': fbonstart}); 
	} 
	
    $('#slider').nivoSlider({
		        effect: 'fade',
						directionNav: false
		});
		$(".item-thumbnails a").fancybox({
						'showNavArrows' : true, 
						'autoScale'		: false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none',
						'titlePosition' 	: 'over',
						'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
							return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
						}
					});
		$("#thumbs a").not('#thumbs-view-more a').fancybox({
						'showNavArrows' : true, 
						'autoScale'		: false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none'
					});
		$("#slider a").not('.nivo-controlNav a').fancybox({
						'showNavArrows' : true, 
						'autoScale'		: false,
						'transitionIn'		: 'none',
						'transitionOut'		: 'none'
					});
		$('#content .item:odd').addClass('odd');
		$('#nav li:last-child').addClass('last');
		$('.item').hover(
		  function () {
		    $(this).find("div.item-details").show();
		  }, 
		  function () {
		    $(this).find("div.item-details").hide();
		  }
		);

});
