// image loader

jQuery(function() {
	jQuery('#loader img').hide().load(function() {
		jQuery('#loader').removeClass('loading');
		jQuery(this).fadeIn('fast');
	});

	// This makes it work, even when the image is cached
	var src = jQuery('#loader img').attr('src'); // Stores original src from HTML as a variable
	jQuery('#loader img').attr('src', '') // Set's source to empty string
	jQuery('#loader img').attr('src', src) // Sets it back to the old value

	// BELOW IS AN ALTERNATIVE WAY TO MAKE IT WORK FOR CACHED IMAGES
	jQuery('#loader img').hide();
	jQuery(window).load( function() {
		jQuery('#loader').removeClass('loading');
		jQuery('#loader img').fadeIn('fast');
	});
});


