$(document).ready(function() {
	$('#bannerOne').find('img').hover(function () {
		$(this).css('cursor', 'pointer');
    }, function () {
		$(this).css('cursor', 'default');
	});
	
	$('#bannerOne').find('img').click(function () {
		var alt = $(this).attr('alt');
		var mediaplayerExists = $('#mediaplayer').length;
		if (mediaplayerExists) {
			var mediaplayerState = jwplayer('mediaplayer').getState();
			if (mediaplayerState == 'PLAYING') {
				jwplayer('mediaplayer').pause(true);
			}
		}
		jwplayer('audioplayer').setup({
			flashplayer: '/flash/player.swf',
			file: alt,
			autoplay: true,
			width: 1,
			height: 1,
			events: {
				onComplete: function() {
					if (mediaplayerExists) {
						setTimeout(function() {
							if (mediaplayerState == 'PLAYING') {
								jwplayer('mediaplayer').pause(false);
							}
						}, 1000);
					}
				}
			}
		});
	});
});

