jQuery(document).ready(function() {
	$('iframe').hide();					
	var moveClick = $('#thumbsconstraints div span');

	$(moveClick).mouseover(function(){
		var attris = $(this).attr('id'); //get id of span - this should be the same as the movie name
		
		var objTitle = {origins: "Origins", BombedDuringWWII: "Bombed During WWII", Lakers19Wkts: "Lakers 19 Wkts", GilletteCupSemi1971: "Gillette Cup Semi 1971", Greenidge2x100s1976: "Greenidge 2 x 100\'s 1976", BothamhookingLillee1981: "Botham hooking Lillee 1981", VivRichards189: "Viv Richards 189", BalloftheCentury: "Ball of the Century", CorkHattrick1995: "Cork Hat-trick 1995", Stewarts100: "Stewart's 100", Ashes05: "Ashes \'05"}
	
		$('iframe').hide();	
		$('#imgMoviePlaceHolder').show();
		$('#imgMoviePlaceHolder').attr('src', "images/" + attris + ".jpg");	
		
		$.each(objTitle, function(key, val){
			if (attris == key){
				//console.log("the key matches" + val);
				$('#movieTitle').html("<span>" + val +"</span>");
				}					  
			});
		
	$(this).click(function(e){
		$('iframe').show();
		//console.log("movie name= " + attris);
		$('iframe').attr('src','movies/' + attris + '.html');
		$('#imgMoviePlaceHolder').hide();
		 e.stopPropagation();
		return false;
		
	})
	//show/hide the titel bar on mouse over
	$('#thumbsconstraints').bind("mouseover",function(){
      $('#movieTitle').show();
    }).bind("mouseout", function(){
		$('#movieTitle').hide();
	});
	
	
})/*.bind("click", function(attris){
		$('iframe').show();
		console.log("movie name= " + attris);
		$('iframe').attr('src','movies/' + attris + '.html');
		$('#imgMoviePlaceHolder').hide();
		return false;
		
		});
	*/
	
	/*if (typeof window.addEventListener === 'function') {
		
		moveClick.addEventListener('click', function(){alert('Boo!')}, false);
	moveClick.addEventListener('click', console.log, false);
	// feature is supported, let's use it
	alert('addEventListener');
	} else {
		alert('different listener')
	// hmm, this feature is not supported, will have to
	// think of another way
	}
*/
/*
function replaceFlashMovie(mName){
	
	var inHtmFlashObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="302" height="207" id="FlashID" title=\'"mName"\'>';
	inHtmFlashObj += '<param name="movie" value=\'"movies/" + mName + ".swf"\' />'
	inHtmFlashObj += '<param name="quality" value="high" />'
	inHtmFlashObj += '<param name="wmode" value="opaque" />'
	inHtmFlashObj += '<param name="swfversion" value="6.0.65.0" />'
	inHtmFlashObj += '<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->'
	inHtmFlashObj += '<param name="expressinstall" value="Scripts/expressInstall.swf" />'
	inHtmFlashObj += '<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->'
	inHtmFlashObj += '<!--[if !IE]>-->'
	inHtmFlashObj += '<object type="application/x-shockwave-flash" data="movies/movietwo.swf" width="302" height="207">'
	inHtmFlashObj += '<!--<![endif]-->'
	inHtmFlashObj += '<param name="quality" value="high" />'
	inHtmFlashObj += '<param name="wmode" value="opaque" />'
	inHtmFlashObj += '<param name="swfversion" value="6.0.65.0" />'
	inHtmFlashObj += '<param name="expressinstall" value="Scripts/expressInstall.swf" />'
	inHtmFlashObj += '<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->'
	inHtmFlashObj += '<div>'
	inHtmFlashObj += '<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>'
	inHtmFlashObj += '<p><a href="http://www.adobe.com/go/getflashplayer">'
	inHtmFlashObj += '<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" />'
	inHtmFlashObj += '</a></p></div>'
	inHtmFlashObj += '<!--[if !IE]>-->'
	inHtmFlashObj += '</object>'
	inHtmFlashObj += '<!--<![endif]-->'
	inHtmFlashObj += '</object>'
	
	$('#movie-clip').append($(inHtmFlashObj));
	
}
*/
});


