	var posLeft;
	var posTop;
	var vidID;
	var videoWidth = "1";
	var videoHeight = "1";
	var marginPlayer = 65;
	var appenDix = "";
	
	function hidePlayer() {
		var videoContainer = "";
		document.getElementById("startPlayer").innerHTML = videoContainer;
		
	};
	
	function playHighQuality(vidID, videoWidth, videoHeight) {
	
		var appenDix = "&fs=1&ap=%2526fmt%3D18";
		var posLeft = document.documentElement.clientWidth * 0.5 - (videoWidth + marginPlayer) * 0.5;
		var posTop = document.documentElement.clientHeight * 0.5 - (videoHeight + marginPlayer) * 0.5;
		var outerVideoWidth = videoWidth + marginPlayer;
		var outerVideoHeight = videoHeight + marginPlayer;		
		var videoContainer = "<div id=\"videoPlayerDivWindow\" style=\"z-index: 2; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background:url(images/opak.png) repeat;\"><\/div><div id=\"videoPlayerDiv\" style=\"position: fixed; z-index: 3; top: " + posTop + "px; left: " + posLeft + "px; width: " + outerVideoWidth + "px; height: " + outerVideoHeight + "px\"><table id=\"videoPlayerTable\" style=\"z-index: 4; margin: 0px; padding: 0px; border: none\" cellpadding=\"0\" cellspacing=\"0\"><tr><td style=\"width: 25px; height: 25px; background-image: url(images/VideoPlayer_01.png)\"><\/td><td id=\"videoPlayerCellTop\" style=\"height: 25px; width: " + videoWidth + "px; background-image: url(images/VideoPlayer_02.png); align:left\"><a href=\"javascript:hidePlayer()\" id=\"videoLink\" style=\"text-align:left; color:white; background:none\">close<\/a><\/td><td style=\"width: 40px; height: 25px; background-image: url(images/VideoPlayer_03.png)\"><\/td><\/tr><tr><td id=\"videoPlayerCellLeft\" style=\"width: 25px; height: " + videoHeight + "px; background-image: url(images/VideoPlayer_04.png)\"><\/td><td id=\"videoPlayerCellMain\" style=\"background-image: url(images/VideoPlayer_05.png); width: " + videoWidth + "px; height: " + videoHeight + "px\"><object width=\"" + videoWidth + "\" height=\"" + videoHeight + "\"><param name=\"movie\" value = \"http://www.youtube.com/v/" + vidID + appenDix + "\" width=\"" + videoWidth + "\" height=\"" + videoHeight + "\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowscriptaccess\" value=\"always\"><\/param><embed src=\"http://www.youtube.com/v/" + vidID + appenDix + "\" type=\"application/x-shockwave-flash\" width=\"" + videoWidth + "\" height=\"" + videoHeight + "\" allowscriptaccess=\"always\" allowfullscreen=\"true\"><\/embed><\/object><\/td><td id=\"videoPlayerCellRight\" style=\"width: 40px; height: " + videoHeight + "px; background-image: url(images/VideoPlayer_06.png)\"><\/td><\/tr><tr><td style=\"width: 25px; height: 40px; background-image: url(images/VideoPlayer_07.png)\"><\/td><td id=\"videoPlayerCellBottom\" style=\"height: 40px; width: " + videoWidth + "px; background-image: url(images/VideoPlayer_08.png); vertical-align: top; text-align: right\"><a href=\"javascript:openPlayer('" + vidID + "', " + videoWidth + ", " + videoHeight + ")\" id=\"videoLink\" style=\"text-align:right; color:white; background:none\">Play in Low Quality<\/a><\/td><td style=\"width: 40px; height: 40px; background-image: url(images/VideoPlayer_09.png)\"><\/td><\/tr><\/table><\/div>";
		document.getElementById("startPlayer").innerHTML = videoContainer;
		
		
	};

	function openPlayer(vidID, videoWidth, videoHeight) {
		
		var appenDix = "&fs=1";
		var posLeft = document.documentElement.clientWidth * 0.5 - (videoWidth + marginPlayer) * 0.5;
		var posTop = document.documentElement.clientHeight * 0.5 - (videoHeight + marginPlayer) * 0.5;
		var outerVideoWidth = videoWidth + marginPlayer;
		var outerVideoHeight = videoHeight + marginPlayer;		
		var videoContainer = "<div id=\"videoPlayerDivWindow\" style=\"z-index: 2; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background:url(images/opak.png) repeat;\"><\/div><div id=\"videoPlayerDiv\" style=\"position: fixed; z-index: 3; top: " + posTop + "px; left: " + posLeft + "px; width: " + outerVideoWidth + "px; height: " + outerVideoHeight + "px\"><table id=\"videoPlayerTable\" style=\"z-index: 4; margin: 0px; padding: 0px; border: none\" cellpadding=\"0\" cellspacing=\"0\"><tr><td style=\"width: 25px; height: 25px; background-image: url(images/VideoPlayer_01.png)\"><\/td><td id=\"videoPlayerCellTop\" style=\"height: 25px; width: " + videoWidth + "px; background-image: url(images/VideoPlayer_02.png); align:left\"><a href=\"javascript:hidePlayer()\" id=\"videoLink\" style=\"text-align:left; color:white; background:none\">close<\/a><\/td><td style=\"width: 40px; height: 25px; background-image: url(images/VideoPlayer_03.png)\"><\/td><\/tr><tr><td id=\"videoPlayerCellLeft\" style=\"width: 25px; height: " + videoHeight + "px; background-image: url(images/VideoPlayer_04.png)\"><\/td><td id=\"videoPlayerCellMain\" style=\"background-image: url(images/VideoPlayer_05.png); width: " + videoWidth + "px; height: " + videoHeight + "px\"><object width=\"" + videoWidth + "\" height=\"" + videoHeight + "\"><param name=\"movie\" value = \"http://www.youtube.com/v/" + vidID + appenDix + "\" width=\"" + videoWidth + "\" height=\"" + videoHeight + "\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowscriptaccess\" value=\"always\"><\/param><embed src=\"http://www.youtube.com/v/" + vidID + appenDix + "\" type=\"application/x-shockwave-flash\" width=\"" + videoWidth + "\" height=\"" + videoHeight + "\" allowscriptaccess=\"always\" allowfullscreen=\"true\"><\/embed><\/object><\/td><td id=\"videoPlayerCellRight\" style=\"width: 40px; height: " + videoHeight + "px; background-image: url(images/VideoPlayer_06.png)\"><\/td><\/tr><tr><td style=\"width: 25px; height: 40px; background-image: url(images/VideoPlayer_07.png)\"><\/td><td id=\"videoPlayerCellBottom\" style=\"height: 40px; width: " + videoWidth + "px; background-image: url(images/VideoPlayer_08.png); vertical-align: top; text-align: right\"><a href=\"javascript:playHighQuality('" + vidID + "', " + videoWidth + ", " + videoHeight + ")\" id=\"videoLink\" style=\"text-align:right; color:white; background:none\">Play in High Quality<\/a><\/td><td style=\"width: 40px; height: 40px; background-image: url(images/VideoPlayer_09.png)\"><\/td><\/tr><\/table><\/div>";
		document.getElementById("startPlayer").innerHTML = videoContainer;
	};


