function popUpWindow(URLStr, left, top, width, height, scroll, resize, winID)
{
	var winVar = this[winID];
	if(winVar) {
		if(!winVar.closed) winVar.close();
	}
	winVar = open(URLStr, winID, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + (scroll ? "yes" : "no") + ',resizable=' + (resize ? "yes" : "no") + ',copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

//PLEASE MAKE SURE TO REFLECT ANY CHANGES MADE TO THIS FUNCTION INTO launchXStreamDebug() ALSO
function launchXStream(id, connSpeed, visitor, vid)
{
	//debugSite = true;
	var width =  (screen.availWidth > 1280) ? 1278 : screen.availWidth - 10;
	var height =  (screen.availHeight > 1024) ? 1022 : screen.availHeight - 29;
	var left = Math.floor((screen.availWidth - width) / 2) - 5;
	var top = Math.floor((screen.availHeight - height) / 2) - 14;
	var sitePage = "Videos.aspx?xstreamID=" + id + "&ConnectionSpeed=" + connSpeed + "&visitorID=" + visitor + "&vid=" + vid;
	popUpWindow(sitePage, left, top, width, height, false, false, "siteWin");
}

//PLEASE MAKE SURE TO REFLECT ANY CHANGES MADE TO THIS FUNCTION INTO launchXStream() ALSO
function launchXStreamDebug(id, connSpeed, visitor, vid)
{
	//debugSite = true;
	var width =  (screen.availWidth > 1280) ? 1278 : screen.availWidth - 10;
	var height =  (screen.availHeight > 1024) ? 1022 : screen.availHeight - 29;
	var left = Math.floor((screen.availWidth - width) / 2) - 5;
	var top = Math.floor((screen.availHeight - height) / 2) - 14;
	var sitePage = "Videos_debug.aspx?xstreamID=" + id + "&ConnectionSpeed=" + connSpeed + "&visitorID=" + visitor + "&vid=" + vid;
	popUpWindow(sitePage, left, top, width, height, false, false, "siteWin");
}

function launchBandwidthPopup(XStreamID,VideoID)
{
	var width =  (screen.availWidth > 1280) ? 1278 : screen.availWidth - 10;
	var height =  (screen.availHeight > 1024) ? 1022 : screen.availHeight - 29;
	var left = Math.floor((screen.availWidth - width) / 2) - 5;
	var top = Math.floor((screen.availHeight - height) / 2) - 14;
	var	sitePage = "http://www.realxstream.com/launcher.aspx?xstreamID=" + XStreamID + "&Vid=" + VideoID + "&qna=" + 'false';	
	popUpWindow(sitePage, left, top, width, height, false, false, "launchWin");
}

function launchTerms()
{
	var width =  420;
	var height =  500;
	var left = Math.floor((screen.availWidth / 2) - (width / 2));
	var top = Math.floor((screen.availHeight / 2) - (height / 2));
	popUpWindow("../terms.html", left, top, width, height, true, false, "termsWin");
}

function launchPrivacy()
{
	var width =  420;
	var height =  500;
	var left = Math.floor((screen.availWidth / 2) - (width / 2));
	var top = Math.floor((screen.availHeight / 2) - (height / 2));
	popUpWindow("../privacy.html", left, top, width, height, true, false, "termsWin");
}