$(document).ready(function() {

	var player = document.getElementById("video");
	
	var show = function(){
	
		var div = $(".wrap");
		
		$("#intro").hide();
		
		div.prepend('<div id="closebutton" style="color:white; text-align:right; font-weight:bold; cursor:pointer">X</div>');
		
		div.css("position", "relative");
		$("#video").css("border", "4px solid white");
		
		div.animate({
			width: 		"853px",
			height:		"480px",
			margin:		"-160px 0 0 -10px"
		}, "normal", "swing", function(){
			
		});
		
		$("#video").unbind('click', show);
		$("#video_text").unbind('click', show)
		
		$("#closebutton").bind('click', hide);
		
		player.sendEvent("PLAY", "true");
	
	};
	
	var hide = function(){
	
		var div = $(".wrap");
		
		$("#closebutton").remove();
		
		div.animate({
			width: 		"533px",
			height:		"300px",
			margin:		"1px 30px 0 0"
		}, "normal", "swing", function(){
			$("#video").css("border", "");
			$("#intro").show();
		});
		
		player.sendEvent("PLAY", "false");
		
		$("#video").bind('click', show);
		$("#video_text").bind('click', show);
	
	};
	
	$("#video").bind('click', show);
	$("#video_text").bind('click', show);
	
	$("p.more").each(function(){
		$(this).hide();
	});
	
	$("a.more").click(function(){
		var more = $(this).siblings(".more");
		if( more.is(":hidden") ){
			more.slideDown();
			$(this).html("less...");
		} else {
			more.slideUp();
			$(this).html("more...");
		}
	});
});