var pX = 100;
var pY = 100;
var a = 1;

var turl = 'tvPopup.html'

var telA = ' ';
var telB = ' ';
var telC = ' ';

function popTv(aName)
{
	telA = aName;
	window.open(turl, "tv", 'height=425,width=540,left=' + pX + ',top=' + pY);
}

function popClient(){
	var width = 700, height = 356;
	var client = window.open(site_url + "/uploads.html", "client_login", "width=" + width + ",height=" + height + ",top=" + ((screen.height - height) / 2) + ",left=" + ((screen.width - width) / 2) + ",status=yes,resizable=no,scrollbars=no");

	if (client)
		client.focus();
}
function openQuicktime(href)
{
	var w = window.open(site_url + "/empty.html", "video", "height=425,width=540,scrollbars=no,resizable=no");

	if (w)
	{
		try
		{
			w.focus();

			w.document.open();
			w.document.write('\
<html>\
	<head>\
		<title>Quicktime Video</title>\
		<link rel="stylesheet" type="text/css" href="' + site_url + '/default/css/index.css" />\
	</head>\
	<body style="background: black !important;">\
		<div id="video-container" style="text-align: center;"></div>\
	</body>\
</html>\
		');
			w.document.close();

			function finish()
			{
				writeQuickTime("video-container", href, w.document);
			}

			window.setTimeout(finish, 0);
		}
		catch (e)
		{
			return false;
		}
	}
}

function writeQuickTime(el_id, video, doc)
{
	if (!doc)
		doc = document;

	doc.getElementById(el_id).innerHTML = '<embed id="popup-video" src="' + video + '" width="540" height="425" autoplay="true" controller="true" scale="aspect" loop="false" bgcolor="000000" enablejavascript="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/indext.html"></embed>';
}
