// JavaScript Document



$(document).ready(function(){
	//$('#stage').cycle();
	$('#console').hide();
	function getVideo(videoID){
		newHtml = '<div style="margin: 0;"><object width="360" height="296"><param name="movie" value="http://www.youtube.com/v/'+ videoID +'&hl=en&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01&autoplay=1"></param><param name="allowFullScreen" value="true"</param><embed src="http://www.youtube.com/v/'+ videoID +'&hl=en&fs=1&rel=0&color1=0xBA0B39&color2=0xFFCB08&autoplay=1" type="application/x-shockwave-flash" allowfullscreen="true" width="360" height="296"></embed></object></div>';
		
		$('#stage').html(newHtml);
		
	}
	function getImage(iconID){
		tomb = tombstone[iconID][lang];
		w = tombstone[iconID][2];
		h = tombstone[iconID][3];
		newHtml = '<p class="image"><img src="images/'+iconID+'.jpg" width="'+w+'px" height="'+h+'px" /></p>';
		newHtml += '<p class="tombstone">'+tomb+'</p>';
		//alert(newHtml);
		$('#stage').html(newHtml);	
	}
	
	$('img.movieOff').each(function(){
		$(this).click(function(){
			getVideo($(this).attr('id'));
			$('img.movieOn').each(function(){
				$(this).removeClass('movieOn').addClass('movieOff');					
			});
			$('img.iconOn').each(function(){
				$(this).removeClass('iconOn').addClass('iconOff');					
			});
			$(this).addClass('movieOn');
		});
		$(this).hover(
			function(){
				$(this).addClass('prettyHover');
			},
			function(){
				$(this).removeClass('prettyHover');	
			}
		);
		
	});
	
	$('img.iconOff').each(function(){
		$(this).click(function(){
			iconID = $(this).attr('id');
			getImage(iconID);
			$('img.iconOn').each(function(){
				$(this).removeClass('iconOn').addClass('iconOff');					
			});
			$('img.movieOn').each(function(){
				$(this).removeClass('movieOn').addClass('movieOff');					
			});
			$(this).addClass('iconOn');
		});
		$(this).hover(
			function(){
				$(this).addClass('prettyHover');
			},
			function(){
				$(this).removeClass('prettyHover');	
			}
		);
	});
	

	
	
	
	
});