﻿function ConfigurePrintPreviewStylesheet(sheetId, bIsStaticForm) {
	/*var cssPreview = document.getElementById("ctl00_" + sheetId);
	//alert(cssPreview.href);
	if (cssPreview != null) {
		cssPreview.disabled = (window.location.search.indexOf("PrintPreview") == -1);
		if (!cssPreview.disabled) window.setTimeout("print();", 250);
		cssPreview = null;
	}*/
	
	if (window.location.search.indexOf("PrintPreview") > -1) {
		var name = (bIsStaticForm ? sheetId : "ctl00_" + sheetId)
		var ss = document.styleSheets[name];
		if (ss != null) {  // IE
			if (ss.media == "print") { ss.media = ""; }
		}
		else {  // Firefox
			var item;
			for (var i=0; i < document.styleSheets.length; i++) {
				item = document.styleSheets.item(i);
				if (item.title == sheetId && item.media.mediaText == "print") {
					item.media.mediaText = "";
					ss = item;
					break;
				}
			}
			item = null;
		}
		if (ss != null) { window.setTimeout("print();", 250); }
	}
}

function IsProdSite() {
	return ("www.sentara.com" == window.location.hostname);
}

function OpenMap(address, mapUrl)
{
	if (mapUrl == null) { mapUrl = "http://portal.sentara.com/mapping/DisplayMap.aspx"; }
	if (mapUrl.indexOf("?") > 0) {
		window.open(mapUrl + address, 'Map', 'width=750, height=550, status=yes, toolbar=no, top=20, left=20, resizable=yes, scrollbars=yes')
	}
	else {
		window.open(mapUrl + '?addressText='+address, 'Map', 'width=750, height=550, status=yes, toolbar=no, top=20, left=20, resizable=yes, scrollbars=yes')
	}
}

function SetPageContentTitle(title)
{
	var div = document.getElementById('MpBCHTitle');
	if(div.childNodes.length > 0) {
		div.childNodes[0].innerHTML = title;
	}
}