jQuery(document).ready(function () {

	$('#artEvaluations').click(function() {
		window.location='evaluations.php';
	});
	
	if (featuredListings.length >= 1) {

		var featuredListingLink = $('#featuredListingBlock a'),
			featuredListimgImage = $('#featuredListingBlock a img'),
			featuredListingTitle = $('#featuredListingBlock a h1'),
			featuredListingArtist = $('#featuredListingBlock h2'),
			featuredListingComposition = $('#featuredListingBlock h3');

		$.each(featuredListings, function() {
			$('<img/>')[0].src = '/library/newdetails/'+this['filename'];
		});
				
		$.each(featuredListings, function() {

			var newID			= this['ID'],
				newTitle		= this['title'],
				newArtist		= this['artistname'],
				newFilename		= this['filename'],
				newComposition	= this['composition'];
				
			featuredListingLink.fadeOut(300, function() {
				featuredListingLink.attr('href','/painting.php?id='+newID);
				featuredListimgImage.attr('src','/library/newdetails/'+newFilename);
				featuredListingTitle.html(newTitle);
				featuredListingArtist.html(newArtist);
				featuredListingComposition.html(newComposition);
			}).fadeIn(600).delay(4200);

		});
	}

});


