﻿var width = 320;
var height = 240;

function Show (URL)
{

var code =  "<EMBED pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/' align=baseline src='" + URL + "'" +
			"PLAYCOUNT='1' LOOP='false' width=" + width + " height=" + height + " type=audio/x-pn-realaudio-plugin autostart=\"true\" ShowStatusBar='0' ShowControls='0' controls=\"ControlPanel\" menu=false wmode=Transparent console=\"Clip1\" border=\"0\">";
var code1 = "<img src='" + URL + "' border='0' width=" + width + " height=" + height + " />";
if (URL.indexOf (".swf") || URL.indexOf (".wmv"))
   GetElement ('TVContent').innerHTML = code;			
else if (URL.indexOf (".gif"))
   GetElement ('TVContent').innerHTML = code1;	
else  GetElement ('TVContent').innerHTML = "Lỗi, mời bạn chọn lại";			
}

function popupWin(url)
		{
		window.open(url, '', 'resizable=yes,width=500,height=450,top=75,left=220,scrollbars=yes');
		}
		
function GetElement(id)
		{
		var itm = null;

		if (document.getElementById)
				{
				itm = document.getElementById(id);
				}

		else if (document.all)
				{
				itm = document.all[id];
				}

		else if (document.layers)
				{
				itm = document.layers[id];
				}

		return itm;
		}
		
function ShowItem(id)
		{
		var itm = null;
		itm = GetElement(id);

		if (!itm)
				{
				}

		else if (itm.style)
				{
				itm.style.display = "";
				}

		else
				{
				itm.visibility = "show";
				}
		}

function HideItem(id)
		{
		var itm = null;
		itm = GetElement(id);

		if (!itm)
				{
				}

		else if (itm.style)
				{
				itm.style.display = "none";
				}

		else
				{
				itm.visibility = "none";
				}
		}