﻿function EnablePrintPreview() {
	if (window.location.search.indexOf("PrintPreview") > -1) {
		var ss;
		for (var i = 0; i < document.styleSheets.length; i++) {
			ss = document.styleSheets[i];
			try {
				if (ss.media == "print") { ss.media = ""; } // IE
				else if (ss.media.mediaText == "print") { ss.media.mediaText = ""; }// Firefox
			}
			catch (e) { }
		}
		ss = null;
		window.setTimeout("print();", 250);
	}
}

function SetPageContentTitle(title) {
	var div = document.getElementById('MpBCHTitle');
	if (div.childNodes.length > 0) {
		div.childNodes[0].innerHTML = title;
	}
}

function SetSelectedChannel() {
    var folder = location.pathname.match(/\w+(?=\/)/);
    document.getElementById(folder).className = "selected";
}

function IsProdSite() {
	if ("brokers.optimahealth.com" == window.location.hostname || "brokerssecure.optimahealth.com" == window.location.hostname)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function popup(url,height,width) {

	if (height == undefined)
	{
		height="500";
	}
	if(width == undefined)
	{
		width="300";
	}
	window.open(url,null,'width=' + width + ',height=' + height + ',menubar=no,status=no,location=no,toolbar=no,scrollbars=yes,resizable=yes');
}




