var PlayerDisplayed = false;
var currPlayClip = null, currDownClip = null, targetMode;
function IniFramePage() {
	if (!CheckTop()) {
		return;
	}
	try {
		parent.RegisterCF(window);
		parent.MMSelectItemFromFrame(MenuArgs);
		parent.ShowBannerFromFrame(BannerArgs);
	}
	catch(e) {}
	
}
function OpenMatchConsole() {
	//var w = window.open("http://www.manutd.com/default.sps?pagegid={1981432E-2416-4FCB-A1B3-9D779A923E8D}", "MatchTracker", "width=890,height=710,history=no,resizable=yes,status=no,scrollbars=yes,menubar=no");
	var w = window.open("http://tracker.manutd.com/MatchTracker/matchTracker.html", "MatchTracker", "width=890,height=710,history=no,resizable=yes,status=no,scrollbars=yes,menubar=no");
	if (!w) {
		alert("Your browser settings prevent from launching popup windows");
		return;
	}
	w.focus()
}
function ShowGoodies(me, ev) {
	CancelEvent(ev);
	DoBlur(me);
	//var w = window.open(WebRoot + "public/GPopup.html", "GoodiesPopup", "width=480,height=667,history=no,resizable=yes,status=yes,menubar=no");
	var w = window.open(WebRoot + "public/GPopup.html", "GoodiesPopup", "width=331,height=466,history=no,resizable=yes,status=yes,menubar=no");
	if (w) {
		w.focus();
	}
	else {
		return true;
	}
	return false;
}
function ShowSecureMessage(me, ev) {
	CancelEvent(ev);
	DoBlur(me);
	var w = window.open(WebRoot + "public/SecureServer.html", "SecureServer", "width=400,height=188,history=no,resizable=yes,status=yes,menubar=no");
	if (w) {
		w.focus();
	}
	else {
		return true;
	}
	return false;
}
function ShowDdGuarantee(me, ev) {
	CancelEvent(ev);
	DoBlur(me);
	var s = "http://" + window.location.host + WebRoot + "public/DdGuarantee.html"
	var w = window.open(s, "DdGuarantee", "width=550,height=300,history=no,resizable=yes,status=yes,menubar=no");
	if (w) {
		w.focus();
	}
	else {
		return true;
	}
	return false;
}
function hbxPT() {
	var s = document.title;
	return repJS(s);
}
function hbxCC() {
	var cc = 0;
	var s = ""
	try {
		cc = MenuArgs[0];
	} catch (e) {}
	if (cc > 0) {
		try {
			s = parent.GetMenuName(cc);
		} catch (e) {}
	}
	return repJS(s);
}
function repJS(s) {
	var re1 = /'|\\/g;
	var ss = s.replace(re1, "");
	return ss;
}
