$(document).ready(function() {
	/* IMAGE */
	$("img.rollover").hover(
		function() { $(this).attr("src", $(this).attr("src").split("_k.").join("_o.")); },
		function() { $(this).attr("src", $(this).attr("src").split("_o.").join("_k.")); }
	);

	
	$(".fadeimg").hover(
		function() { $(this).stop().animate({"opacity": "0"}, 300); },
		function() { $(this).stop().animate({"opacity": "1"}, 300); }
	);

	/* THE FOLLOWING CODE IS ONLY USED FOR THIS VERSION WEBSITE */
	/* logo rollover effect */
	/*
	$("#logo a").prepend('<div id="logo-mask"></div>').hover(
		function() { $("#logo-mask").css("visibility","visible")},
		function() { $("#logo-mask").css("visibility","hidden")}
	);
	*/
	
	/* place color image under black white one */
	$(".thumb img").each(function() {
		img_color = $(this).attr("src").split("_k.").join("_o.");
		img_color_alt = $(this).attr("alt");
		$(this).parent().append('<img src="'+img_color+'" width="220" height="150" alt="'+img_color_alt+'" />');
	});
	
	
	/* SCROLL TO TOP */
	/* http://www.mattvarone.com/web-design/uitotop-jquery-plugin/ */
	$().UItoTop({ easingType: 'easeOutQuart' });
	
	/* FANCYBOX SETTINGS */
	$(".fancygroup").fancybox({
		'transitionIn'		: 'elastic',
		'easingIn'			: 'easeOutBack',
		'transitionOut'		: 'fade',
		'padding'			: 0,
		'titleShow'			: false,
		'enableEscapeButton': true,
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
	/*
	$(".fancypage").fancybox({
		//'width'				: 600,
		//'height'			: 400,
        //'autoScale'     	: false,
		//'easingIn'			: 'easeOutBack',
		//'transitionOut'		: 'fade',
		//'padding'			: 0,
		'type'				: 'iframe'
	});
	*/
	

});

