<!-- begin hiding script from older browsers

var pathURL = "/Content/Upload/AssetMgmt/images/portal/";
//var pathURL = "images/";

var MHSM = {};

MHSM.PopUp = {

	goto_LawsonESS: function (){
		var bar = MH;
		
		//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpStart("2010-04-26 07:59:59");
		//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpEnd("2010-04-26 08:00:00");
		//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
		bar.PopUp.setPopUpPost("2010-04-14 13:42:00");
		//OK msg to display
		bar.PopUp.setPopUpOkMsg("Click 'OK' to continue and open up a Citrix Remote Access session.");
		//message to display
		bar.PopUp.setPopUpMsg("<h3>MEDITECH UPGRADE<br>Effective April 13, 2010</h3><p>Please note that there will be changes to the Meditech login, desktop and e-signing screens. <a href='#'>Click here to view.</a></p>");
		// Button Options - OkCancel, Ok, Cancel
		bar.PopUp.setPopUpBtns("OkCancel");
		bar.PopUp.setPopUpURLCur("https://lawess.che.org/");
		bar.PopUp.setPopUpURLNew("https://lawsoness.che.org");
		bar.PopUp.jsLink_onClick(450, 521);
	},

	goto_LawsonPROD: function (){
		var bar = MH;
		
		//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpStart("2010-04-26 07:59:59");
		//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpEnd("2010-04-26 08:00:00");
		//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
		bar.PopUp.setPopUpPost("2010-04-14 13:42:00");
		//OK msg to display
		bar.PopUp.setPopUpOkMsg("Click 'OK' to continue and open up a current Lawson MSS/RSS session.");
		//message to display
		bar.PopUp.setPopUpMsg("<p>CHE will be upgrading our Lawson system the weekend of October 23-25.</p><p>Beginning at 12 Noon on Friday, October 23rd, our Lawson system will become unavailable.</p><p>It is expected that by the start of business on Monday, October 26th, the system will be back up and running under the new 9.01 version.</p><p>This will affect ESS, RSS and MSS in the Lawson system as well as all modules including HR, Payroll, Finance and Supply Chain.</p>");
		// Button Options - OkCancel, Ok, Cancel
		bar.PopUp.setPopUpBtns("OkCancel");
		bar.PopUp.setPopUpURLCur("https://lawprod.che.org");
		bar.PopUp.setPopUpURLNew("https://lawsonprod.che.org");
		bar.PopUp.jsLink_onClick(450, 521);
	},

	goto_eRecruiting: function (){
		var bar = MH;
		
		//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpStart("2009-09-14 14:23:00");
		//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpEnd("2009-09-16 15:24:59");
		//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
		bar.PopUp.setPopUpPost("2009-09-14 15:03:00");
		//message to display
		bar.PopUp.setPopUpMsg("This is just a test involving the changing of the Lawson eRecruiting URLs.");
		// Button Options - OkCancel, Ok, Cancel
		bar.PopUp.setPopUpBtns("OkCancel");
		bar.PopUp.setPopUpURLCur("https://jobs.che-ma.org/recruit/servlet/com.lawson.ijob.QuickCandidate?vendor=3");
		bar.PopUp.setPopUpURLNew("https://lawsonrecruit.che.org/recruit/servlet/com.lawson.ijob.QuickCandidate?vendor=3");
		bar.PopUp.jsLink_onClick(375, 521);
	},

	goto_RemoteAccess: function (){
		var bar = MH;
		
		//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpStart("2010-06-21 18:49:59");
		//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpEnd("2010-06-21 19:59:59");
		//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
		bar.PopUp.setPopUpPost("2010-06-21 15:30:00");
		////message to display prior to start time
		bar.PopUp.setPopUpPrr("Remote access via Citrix will be unavailable Monday, June 21, 2010 from 7:00pm-8:00pm.  We apologize for any inconvenience.");
		//message to display
		bar.PopUp.setPopUpMsg("Remote access via Citrix will be unavailable Monday, June 21, 2010 from 7:00pm-8:00pm.  We apologize for any inconvenience.");
		// Button Options - OkCancel, Ok, Cancel
		bar.PopUp.setPopUpBtns("OKCancel");
		bar.PopUp.setPopUpURLCur("https://www.mercyaccess.com/CitrixLogonPoint/SampleLogonPoint/");
		
		//bar.PopUp.jsLink_onClick();
		bar.PopUp.jsLink_onClick(375, 521);
	},

	gotoTestLink: function (){
		var bar = MH;
		
		//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpStart("2010-06-21 15:34:00");
		//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
		bar.PopUp.setPopUpEnd("2010-06-21 19:59:59");
		//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
		bar.PopUp.setPopUpPost("2010-06-21 15:30:00");
		//message to display prior to start time
		bar.PopUp.setPopUpPrr("Remote access via Citrix will be unavailable Monday, June 21, 2010 from 7:00pm-8:00pm.  We apologize for any inconvenience.");
		//message to display
		bar.PopUp.setPopUpMsg("Remote access via Citrix will be unavailable Monday, June 21, 2010 from 7:00pm-8:00pm.  We apologize for any inconvenience.");
		// Button Options - OkCancel, Ok, Cancel
		bar.PopUp.setPopUpBtns("OkCancel");
		bar.PopUp.setPopUpURLCur("https://www.mercyaccess.com/CitrixLogonPoint/SampleLogonPoint/");
		
		//bar.PopUp.jsLink_onClick();
		bar.PopUp.jsLink_onClick(375, 521);
	}
	
};

var MH = { };

MH.PopUp = {

	//time when message pop-up is to start appearing (yyyy-mm-dd hh:mm:ss)
	T_STT_PUP : "",	
	//time when message pop-up is to stop appearing (yyyy-mm-dd hh:mm:ss)
	T_END_PUP : "",	
	//message to display prior to T_STT_PUP
	X_PRR_PUP : "",
	//message to display after T_STT_PUP, but prior to T_END_PUP
	X_MSG_PUP : "",
	//time when message was last changed (yyyy-mm-dd hh:mm am/pm)
	T_PST_PUP : "",
	
	X_PUP_OK	: "Click 'OK' to continue and open up a remote access session.",
	X_PUP_CNC : "Click 'Cancel' to close this window.",

	X_URL_CUR : "",
	X_URL_NEW : "",
	// Button Options - OkCancel, Ok, Cancel
	C_OPT_BTN : "",
	I_TLL_SCR : 375,
	I_WDE_SCR : 521,


	setPopUpOkMsg:	function(sMsg_OK){
		this.X_PUP_OK = sMsg_OK;
	},
	
	setPopUpCncMsg:	function(sMsg_CNC){
		this.X_PUP_CNC = sMsg_CNC;
	},
	
	setPopUpURLCur: function(sX_URL){
		this.X_URL_CUR = sX_URL;
	},
	
	setPopUpURLNew: function(sX_URL){
		this.X_URL_NEW = sX_URL;
	},
	
	setPopUpBtns: function(sC_OPT_BTN){
		this.C_OPT_BTN = sC_OPT_BTN;
	},
	
	setPopUpStart: function(T_STT){
		this.T_STT_PUP = T_STT;
	},
	
	setPopUpEnd: function(T_END){
		this.T_END_PUP = T_END;
	},
	
	setPopUpPrr: function(sMsg){
		this.X_PRR_PUP = sMsg;
	},
	
	setPopUpMsg: function(sMsg){
		this.X_MSG_PUP = sMsg;
	},
	
	setPopUpPost: function(T_PST){
		this.T_PST_PUP = T_PST;
	},
	
	jsLink_onClick: function(tall, wide){
		
		if (tall != null)
			this.I_TLL_SCR = tall;
			
		if (wide != null)
			this.I_WDE_SCR = wide;
		
		var t_Now = this.getCurrentTimestamp();
		var newWin;
	
		//alert("t_Now: " + t_Now);
		
		//if no prior message is specified, use the pop-up message
		if (this.X_PRR_PUP.length == 0)
			this.X_PRR_PUP = this.X_MSG_PUP;
			
		//if no new URL is specified, use the current URL
		if (this.X_URL_NEW.length == 0)
			this.X_URL_NEW = this.X_URL_CUR;
			
		if (t_Now < this.T_STT_PUP)
		{
			//display message window
			//this.I_TLL_SCR = 375;
			//this.I_WDE_SCR = 521;
			var sMsgOpt = "";
			sMsgOpt = ((this.C_OPT_BTN.toLowerCase().indexOf("ok") != -1) ? this.X_PUP_OK : "") + ((this.C_OPT_BTN.toLowerCase().indexOf("cancel") != -1) ? ((this.C_OPT_BTN.toLowerCase().indexOf("ok") != -1) ? "<br /><br />" : "") + this.X_PUP_CNC : "");
			newWin = window.open("<html></html>","_blank","height="+this.I_TLL_SCR+",width="+this.I_WDE_SCR);
			//newWin.document.write(this.showMessage(this.X_PUP_OK + "<br><br>" + this.X_PUP_CNC,this.C_OPT_BTN,this.X_URL_CUR,400,820));
			newWin.document.write(this.showMessage(this.X_PRR_PUP, sMsgOpt, this.C_OPT_BTN, this.X_URL_CUR, this.I_TLL_SCR, this.I_WDE_SCR));
			var h = screen.height;
			var w = screen.width;

			newWin.moveTo((w-this.I_WDE_SCR)/2, (h-this.I_TLL_SCR)/2);
		}
		else
		{
//			if ((t_Now > this.T_STT_PUP) && (t_Now < this.T_END_PUP))
			if (t_Now < this.T_END_PUP)
			{
				//display message window
				//this.I_TLL_SCR = 375;
				//this.I_WDE_SCR = 521;
				//var btnOptions = "Cancel";
				var sMsgOpt = this.X_PUP_CNC;
				newWin = window.open("<html></html>","_blank","height="+this.I_TLL_SCR+",width="+this.I_WDE_SCR);
				newWin.document.write(this.showMessage(this.X_MSG_PUP, sMsgOpt,"Cancel"));
				var h = screen.height;
				var w = screen.width;

				newWin.moveTo((w-this.I_WDE_SCR)/2, (h-this.I_TLL_SCR)/2);
			}
			else
			{
				window.open(this.X_URL_NEW,"_blank","height="+this.I_TLL_SCR+",width="+this.I_WDE_SCR+",scrollbars,resizable,location,status,menubar,toolbar");
			}
		}
	},

	showMessage: function(sX_MSG_PUP, sX_MSG_OPT, btnOptions, sX_URL_CUR, iI_HGT, iI_WTH){
		var sHTML = "";
		
		sHTML += "<html>";
		sHTML += "	<head>";
		sHTML += "		<title>Mercy Hospital - Remote Access (Citrix)</title>";
		sHTML += "		<style type='text/css'>";
		sHTML += "			body";
		sHTML += "			{";
		sHTML += "        font-family: Arial;";
		sHTML += "				font-size: 1em;";
		sHTML += "				margin: 0px;";
		sHTML += "				padding: 0px;";
		sHTML += "				background-color: #e0e0e0;";
		sHTML += "			}";
		sHTML += "			#pageLevel";
		sHTML += "			{";
		sHTML += "				min-width: auto;";
		sHTML += "				text-align: left;";
		sHTML += "			}";
		sHTML += "			#pageHeading {	height: auto;	border: 0px solid #080000;margin:0px;padding:0px;	}";
		sHTML += "			#pageContent {	border: 0px solid #080000;margin:0px 5px;padding:0px;	}";
		sHTML += "			#pageContent img";
		sHTML += "			{";
		sHTML += "				margin: 0em 0em;";
		sHTML += "				padding: 0;";
//		sHTML += "				border: 20px inset #ffffff;";
		sHTML += "				text-align: center;";
		sHTML += "				margin-left: auto;";
		sHTML += "				margin-right: auto;";
		sHTML += "			}";
		sHTML += "			#pageHeading img";
		sHTML += "			{";
		sHTML += "				margin: 0;";
		sHTML += "				padding: 0;";
		sHTML += "				border: 0px solid #800000;";
		sHTML += "			}";
		sHTML += "			div#divMsg";
		sHTML += "			{";
		sHTML += "				margin-left: 1em;";
		sHTML += "			}";
		sHTML += "			.imgLeft";
		sHTML += "			{";
		sHTML += "				float: left;";
		sHTML += "			}";
		sHTML += "			.imgRight";
		sHTML += "			{";
		sHTML += "				float: right;";
		sHTML += "			}";
		sHTML += "			#divCaption";
		sHTML += "			{";
		sHTML += "				margin-top: 0em;";
		sHTML += "			}";
		sHTML += "			.closer";
		sHTML += "			{";
		sHTML += "				margin-bottom: 0px; ";
		sHTML += "				padding-right: 1em;";
		sHTML += "				padding-bottom; 0px;";
		sHTML += "				background-image: url(" + pathURL + "moment_gap_03.gif);";
		sHTML += "				text-align: right;";
		sHTML += "				height: 21px;";
		sHTML += "			}";
		sHTML += "			div.closer a, div.closer a:active {color:#ffffff;font-weight: bold; text-decoration: none;}";
		sHTML += "			div.closer a:hover {color: #3333ff; font-weight: bold;}";
		sHTML += "			.msgPopUp, .pmsgPopUp";
		sHTML += "			{";
		sHTML += "				padding: 0em 1em;";
		sHTML += "				font-family: Tahoma, Verdanna;";
		sHTML += "				font-weight: normal;";
		sHTML += "				font-size: .9em;";
//		sHTML += "				text-align: center;";
		sHTML += "			}";
		sHTML += "			.msgPopUp";
		sHTML += "			{";
		sHTML += "				font-weight: bold;";
		sHTML += "				font-size: 1.2em;";
		sHTML += "			}";
		sHTML += "			divMsg.ul";
		sHTML += "			{";
		sHTML += "				margin: 0em;";
		sHTML += "			}";
		sHTML += "			ul.mhListTypeNone li";
		sHTML += "			{";
		sHTML += "				list-style-type: none;";
		sHTML += "				padding: .5em 0em;";
		sHTML += "			}";
		sHTML += "		</style>";
		sHTML += "		<script type='text/javascript' language='javascript'>";
		sHTML += "			function btnOK_onClick()";
		sHTML += "			{";
		sHTML += "				window.open('" + sX_URL_CUR + "','_blank','height=" + iI_HGT + ",width=" + iI_WTH + ",scrollbars,resizable,location,status,menubar,toolbar');";
		sHTML += "				self.close();";
		sHTML += "			}";
		sHTML += "		</script>";
		sHTML += "	</head>";
		sHTML += "<body>";
		sHTML += "	<div id='pageLevel'>";
		sHTML += "		<div id='pageHeading'>";
		sHTML += "			<div class='sectCol1of1'>";
		sHTML += "				<div class='imgLeft'>";
//		sHTML += "					<img src='" + pathURL + "newHP_01.gif'>";
		sHTML += "					<img src='" + pathURL + "Mercy rgb_71x182.jpg'>";
		sHTML += "				</div>";
		sHTML += "				<div class='imgRight'>";
		sHTML += "					<img src='" + pathURL + "Mercy watermark 340x71.jpg'>";
		sHTML += "				</div>";
		sHTML += "			</div>";
		sHTML += "			<div class='sectCol1of1'>";
		sHTML += "				<div class='closer'>";
		//sHTML += "					<a href='javascript:window.close();'>Close window</a>";
		sHTML += "				</div>";
		sHTML += "			</div>";
		sHTML += "		</div>";
		sHTML += "		<div id='pageContent'>";
		sHTML += "			<div class='sectCol1of1'>";
		sHTML += "				<p id='msgPopUp' class='msgPopUp'>" + sX_MSG_PUP + "</p>";
		sHTML += "				<p class='pmsgPopUp'>" + sX_MSG_OPT + "</p>";
		sHTML += "				<p align='center'>";
		
		if (btnOptions.toLowerCase().indexOf("ok") != -1)
		{
			sHTML += "					<input type='button' ID='btnOK' name='btnOK' value='OK' onclick='javascript:btnOK_onClick()'>";
		}
		
		if (btnOptions.toLowerCase().indexOf("cancel") != -1)
		{
			sHTML += "					&nbsp;&nbsp;";
			sHTML += "					<input type='button' ID='btnCancel' name='btnCancel' value='Cancel' onclick='javascript:window.close();'>";
		}
		
		sHTML += "				</p>";
		sHTML += "				<p id='T_UPD_MSG_RMT' align='right' style='font-size:.8em;padding:0em 2em;font-weight:bold;'><span style='font-weight: normal'>posted: </span>" + this.T_PST_PUP + "</p>";
		sHTML += "			</div>";
		sHTML += "		</div>";
		sHTML += "	</div>";
		sHTML += "</body>";
		sHTML += "</html>";
		
		return sHTML;
		
	},

	getCurrentTimestamp: function(){

		var d_now = new Date();
		
		var d_Year = d_now.getFullYear();
		var d_Month = ((d_now.getMonth()) < 9 ? "0" + (parseInt(d_now.getMonth()) + 1) : (parseInt(d_now.getMonth()) + 1));
		var d_Day = ((d_now.getDate()) < 10 ? "0" + d_now.getDate() : d_now.getDate());
		var d_Hour = ((d_now.getHours()) < 10 ? "0" + (parseInt(d_now.getHours())) : (parseInt(d_now.getHours())));
		var d_Minute = ((d_now.getMinutes()) < 10 ? "0" + (parseInt(d_now.getMinutes())) : (parseInt(d_now.getMinutes())));
		var d_Second = ((d_now.getSeconds()) < 10 ? "0" + (parseInt(d_now.getSeconds())) : (parseInt(d_now.getSeconds())));
		var t_Now = d_Year + "-" + d_Month + "-" + d_Day + " " + d_Hour + ":" + d_Minute + ":" + d_Second;

		return t_Now;
	}

};

//--> end hiding script
