
VideoPlayer = {};

VideoPlayer.Init = function() {
	
	this.Player = document.getElementById("myFlash");
	
	this.Title = $("#video .videotitle");
	
	this.Summaries = $("#video .summary .text")
}

VideoPlayer.LoadVideo = function(id, title) {

	var p = this.Player;
	var t = this.Title;
	var s = this.Summaries;
	var run = false;
	
	if(!p)
		return true;

	window.setTimeout(function() {
		
		t.stop();
		
		s.fadeTo(300, 0);
		$(t).fadeTo(300, 0, 
			function() {
				if(!run) {
					p.SetVariable("player:jsPlay", id);	
					t.text(title);
					s.css("display", "none");
					sm = $(s.get(id));
					sm.css("display", "block");
					$(sm).fadeTo(300, 1);
					$(t).fadeTo(300, 1);
					run = true;
				}
			}
		);
			
	}, 100);
	
	// Disables Click Event
	return false;

};

$(document).ready(function() { VideoPlayer.Init(); });