plugins = {
	OAS: {
		getSitePage: function () {
			try {
				return sitepage;
			} catch (e) {
				try {
					return window.parent.sitepage;
				} catch (ee) {
					return null;
				}
			}
		},
		hostid: null,
		enabled: false,
		setHostId: function (id) {
			plugins.OAS.hostid = id;
		},
		getHostId: function () {
			return plugins.OAS.hostid;
		},
		setEnabled: function (active) {
			plugins.OAS.enabled = active;
		},
		getEnabled: function () {
			return plugins.OAS.enabled;
		},
		setCompanionAd: function (creative) {
			var idc = document.getElementById("mediageneral_companion_position");
			if (idc != null) {
				if (creative == undefined) {
					if (idc.nodeName.toLowerCase() != "iframe") {
						var ad_iframe = document.createElement('iframe');
						ad_iframe.id = "mediageneral_companion_position";
						ad_iframe.scrolling = "no";
						ad_iframe.frameBorder = "0";
						ad_iframe.width = "300";
						ad_iframe.height = "250";
						ad_iframe.style.margin = "0px";
						ad_iframe.style.padding = "0px";
						idc.parentNode.replaceChild(ad_iframe, idc);
						idc = ad_iframe;
					}
					idc.src = "http://media.mgnetwork.com/mgvideocenter/iframe.html?sitepage=" + sitepage + "&poslist=" + oasPosList + "&flash_request=1";
				} else {
					var ad_pos = document.createElement('div');
					ad_pos.id = "mediageneral_companion_position";
					ad_pos.innerHTML = creative;
					idc.parentNode.replaceChild(ad_pos, idc);
				}
			}
			return (idc != null);
		},
		delegateEvent: function (target, eventType) {
			$('#\\'+target).parents('.app-videoplayer').trigger(eventType);
		}
	}
}