$(document).ready(function(){

		var pressImages = new Array();
		pressImages[0] = "/content/files/another.jpg";
		pressImages[1] = "/content/files/acne-paper.jpg";
		pressImages[2] = "/content/files/dazed.jpg";
		pressImages[3] = "/content/files/elpais.jpg";
		pressImages[4] = "/content/files/elpais2.jpg";
		pressImages[5] = "/content/files/eveningstandard.jpg";
		pressImages[6] = "/content/files/fashionquarterly.jpg";
		pressImages[7] = "/content/files/somos.jpg";
		pressImages[8] = "/content/files/stylecom.jpg";
		pressImages[9] = "/content/files/times.jpg";

		for(var i = 0; i<pressImages.length; i++){
				jQuery("<img>").attr("src", pressImages[i]);
		}

		var img = new Image();
		loadImg("another");
				
		// when clicking the individual films load the corresponding player
		$('#press a').mousedown(function() {
				var currFilmIndex = $(this).attr("href").substring(1);
				loadImg(currFilmIndex);
		});
		
		function loadImg(whichImg){
			$(img).load(function () {
				//$(this).css('display', 'none'); // .hide() doesn't work in Safari when the element isn't on the DOM already
				$(this).hide();
				$('#loader').removeClass('loading').append(this);
				$(this).fadeIn();
			}).error(function () {
			}).attr('src', '/content/files/'+whichImg+'.jpg');
		}    
    
});