jQuery(document).ready(function($) {
	/* 
	$('#thumbs a[title]').each(function() {
        $this = $(this);
        $.data(this, 'title', $this.attr('title'));
        $this.removeAttr('title');
        $this.attr('title', 'Click to view larger.');
    });
    */

	$("#thumbs a").each(function() {
        $(this).data('title', $(this).attr('title'));
        $(this).removeAttr('title');
        $(this).attr('title', 'Click to view larger.');
    });

	$("a[rel='gallery']").colorbox({
		transition: 'elastic',
		scalePhotos: true,
		preloading: true,
		maxWidth: '85%',
		maxHeight: '85%',
		initialWidth: '50%',
		initialHeight: '50%',
		opacity: 0.85,
		current: "Slide {current} of {total}",
		previous: "",
		next: "",
		close: "Close",
		speed: 750
	});
	
	$("#thumbs").hover(function() {
		$("#clientName").animate({ opacity: 1.0 }, 0).stop();
	}, function() {
		$("#clientName").animate({ opacity: 0.0 }, 500, function() { $(this).text(""); });
	});
	
	$("#thumbs a").mouseenter(function() {
		var thumbTitle = $(this).data("title");
		var clientName = thumbTitle.split(">");
		var nameToShow = clientName[2].split("<");
		$("#clientName").html("<strong>Client </strong>" + nameToShow[0]);
	}).mouseleave(function() {
		var nameToShow = "";
	});
});