
function ALM_PlayVideo(obj)
{
	function isIE60or55()
	{
		return navigator.appVersion.indexOf("4.0 (compatible; MSIE 6.0") == 0 || navigator.appVersion.indexOf("4.0 (compatible; MSIE 5.5") == 0;
	}
	function getBody()
	{
		return document.getElementsByTagName("body")[0];
	}
	var newElement = document.createElement("div");
	newElement.style.margin = "0px";
	newElement.style.padding = "0px";
	newElement.style.display = "block";
	newElement.style.verticalAlign = "middle";
	newElement.style.textAlign = "center";
	newElement.style.position = "absolute";
	newElement.style.width = "100%";
	newElement.style.height = "100%";
	newElement.style.top = "0px";
	newElement.style.left = "0px";
	newElement.style.zIndex = "9777";
	if (isIE60or55())
	{
		newElement.style.height = getBody().clientHeight;
		newElement.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#D0191819',EndColorStr='#D0191819')"
	}
	else
	{
		newElement.style.backgroundImage = "url('files/player/overlay.png')";
	}

	var t = document.createElement("table")
	var tr = t.insertRow(0);
	var td = tr.insertCell(0);
	var sp = document.createElement("div");

	newElement.appendChild(t);
    getBody().appendChild(newElement);

	t.cellpadding='0';
	t.cellspacing='0';
	t.zIndex = td.zIndex = tr.zIndex = "9778";
	tr.style.width = td.style.width = t.style.width = "100%";
	tr.style.height = td.style.height = t.style.height = "100%";
	tr.style.padding = td.style.padding = t.style.padding = "0px";
	tr.style.margin = td.style.margin = t.style.margin = "0px";
	tr.style.borderWidth = td.style.borderWidth = t.style.borderWidth = "0px";
	tr.style.verticalAlign = td.style.verticalAlign = t.style.verticalAlign = "middle";
	tr.style.textAlign = td.style.textAlign = t.style.textAlign = "center";
    td.style.color = "blue";
	td.appendChild(sp);

	if (obj.getAttribute('type') == "flv")
	{
	    var str = "<embed src='"+ ((obj.getAttribute('player'))?obj.getAttribute('player'):"flvplayer.swf") +"' flashvars='file="+ obj.getAttribute('src') +"' allowfullscreen='true'"
			  +	" bgcolor='#ffffff' "
			  + ((obj.getAttribute('xwidth'))?("width='"+ obj.getAttribute('xwidth') +"' "):"")
			  + ((obj.getAttribute('xheight'))?("height='"+ obj.getAttribute('xheight') +"' "):"")
			  + "name='player' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed><br/>"
		sp.innerHTML = str;
	}
	else
	{
		if (obj.getAttribute('type') == "mov")
		{
            var height = ((obj.getAttribute('xheight'))?(obj.getAttribute('xheight').replace(/\D/g,"")):"100")
            var width = ((obj.getAttribute('xwidth'))?(obj.getAttribute('xwidth').replace(/\D/g,"")):"200")

			var str = "<embed controller='true' src='"+ obj.getAttribute('src') +"' "
					+ "width='" + width+"' "
					+ "height='" + height+"' "
					+ " pluginspage='http://www.apple.com/quicktime/'></embed>";
			sp.innerHTML = str;
		}
		else
		{
			return true;
		}
	}
	sp.setAttribute("style","margin:0px auto 0px");
	sp.style.width = sp.firstChild.clientWidth + "px";

    sp.style.color = obj.getAttribute('closecolor')?obj.getAttribute('closecolor'):"blue";

	sp.style.textAlign = obj.getAttribute('xalign')?obj.getAttribute('xalign'):"right";
	sp.style.padding = obj.getAttribute('xpadding')?obj.getAttribute('xpadding'):"20px";

	//Object.style.border=borderWidth borderStyle borderColor
	sp.style.border = obj.getAttribute('xborder')?obj.getAttribute('xborder'):"0px solid black";

	//Object.style.background=background-color background-image background-repeat background-attachment background-position
	sp.style.background = obj.getAttribute('xbackground')?obj.getAttribute('xbackground'):"black none repeat";

	if (obj.getAttribute('xclass'))
	{
		sp.setAttribute("class",obj.getAttribute('xclass'));
	}
	sp.style.position = obj.getAttribute('xposition')?obj.getAttribute('xposition'):"relative";

	if (obj.getAttribute('xtop'))
		sp.style.top = obj.getAttribute('xtop').replace(/\D+^/g,"") + "px";

	if (obj.getAttribute('xleft'))
		sp.style.left = obj.getAttribute('xleft').replace(/\D+^/g,"") + "px";

	sp.innerHTML += "<a href='javascript:;' onclick='this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display=\"none\";this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = \"\"'><b>"
					+ (obj.getAttribute('closetext')?obj.getAttribute('closetext'):" ")
					+ "</b></a>"
					+ "<a href='javascript:;' onclick='this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display=\"none\";this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = \"\"'>"
					+ ((!obj.getAttribute('closeimg') || obj.getAttribute('closeimg') != "none")?("<img style='margin:5px' border='0' style='text-decoration:none' src='"+(obj.getAttribute('closeimg')?obj.getAttribute('closeimg'):"files/player/x.png")+"'/>"):"")
					+ "</a>";

	return false;
}
