﻿var HelpScript = [
	"<b>Welcome to the Patient Services Portal demo</b><br/><br/>This demo page allows you to simulate the appearance and behavior of the Mitel Patient Services Portal application.<br/><br/>This script will walk you through the most exciting features of the application.<br/><br/>Press Next to continue.",
	"<b>How to&nbsp;use this demo&nbsp;page</b><br/><br/>All the clickable areas are located on&nbsp;the phone image and correspond to&nbsp;the clickable phone keys; e.g., most of&nbsp;the programmable keys on&nbsp;both sides of&nbsp;the phone screen, and all the dial pad keys can be&nbsp;clicked. You can&#146;t click on&nbsp;the phone screen itself, so&nbsp;click on&nbsp;the key next to&nbsp;screen label instead.<br/><br/>Although every effort was made to&nbsp;make the functionality of&nbsp;this page as&nbsp;close to&nbsp;the phone&#146;s functionality as&nbsp;possible &mdash; this is&nbsp;not the real phone :).",
	"<b>Login:</b><br/><br/>Click the key beside “Nurse” to toggle through the different roles which can be accessed during the demo.  Note that the “Nurse” role is a dual role and plays the part of the service initiator as well as the application administrator.  In a real world deployment, the application would most likely be administered by a backend system.<p>Once you have selected a role (For the purpose of the demo, begin with the Nurse role), click the key next to Login to bring up the home-screen for that role.</p>",
	"<b>Services:</b><br/><br/>Click the key next to Bed 1 or Bed 2 to bring up available services which can be initiated for these beds in this particular room. Click the appropriate task and its options become available.  Click the key beside the option you wish to request and note that the box beside that option turns grey to indicate a request has been generated.  Also note that the request is timestamped on the phone. Click Home <img src='images/icon-home.gif' />  key to return to Nurse homepage and note that the task box beside the chosen bed is now grey to indicate an outstanding request. Click Logout to return to the application front page.",
	"<b>Service:</b><br/><br/>Toggle to the service provider associated with the service you requested, as the Nurse, and Login. You should see a task screen with a grey box to indicate a pending task.  Click on the entry containing the task which you requested as the Nurse. The checkmark indicates that this task has been completed and note that it is time-stamped.  You can now Logout.",
	"<b>Completion:</b><br/><br/>Login as Nurse as in tip Three.  You will see a box associated with a Bed with a checkmark on the home-screen under “Tasks”. Click beside that box to take you to the selected service. Click beside the service and you will see the completed time-stamped task which you can then “clear” by clicking beside the checked box. Click Home <img src='images/icon-home.gif' />  to go back to the Nurse home-screen.",
	"<b>Codes</b><br/><br/>Click the key beside “Codes” and you will be presented with a screen which lists all of the applicable security codes. Choose a code to initiate and note the LEDs on the phone start to blink. Click Home <img src='images/icon-home.gif' />  to go back to the nurse homescreen and then Logout.  You will notice that on the application Frontpage the LEDs will remain blinking and you should see a notification of the code and the associated room number. This would be replicated across all the phones on the network. Note that certain codes such as “Evacuation” will not have an associated room number in the display on the Frontpage. This simulates a code that was initiated by the backend admin system, rather than from a specific room phone. Log back in as Nurse and go back to the Codes screen and click beside the selected code. This will cancel the Alert. Click the Home ",
	"<b>On-Call List</b><br/><br/>Click the key beside “On-Call List” and you will be presented with the “Departments” screen.  Click beside the department you choose and you are presented with a list of Doctors who are either On-Call , On-duty, or Off-duty.  Click beside the Doctor On-Call and the phone automatically dials that doctor.",
	"<b>Thank you!</b><br/><br/>Thanks for trying out the Mitel Patient Services Portal application demo! For more information, please contact your Mitel Dealer Representative."
];

//=====================================================================
var CurrentTipIndex = 0;
var HelpDiv = "Help";

function OnNextTip()
{
	CurrentTipIndex++;
	if(CurrentTipIndex >= HelpScript.length){
		CurrentTipIndex = 0;
	}
	SetCurrentTip();
}

function OnPreviousTip()
{
	CurrentTipIndex--;
	if(CurrentTipIndex < 0){
		CurrentTipIndex = HelpScript.length-1;
	}
	SetCurrentTip();
}

function SetCurrentTip()
{
	if(document.getElementById(HelpDiv))
		document.getElementById(HelpDiv).innerHTML = 
			"<table style='width:158px;'><tr><td style='border-top:solid 1px silver;border-bottom:solid 1px silver;'>Tip "+(CurrentTipIndex+1).toString() + " of " + HelpScript.length.toString() + ""+
			"</td></tr><tr><td><br/>"+
			HelpScript[CurrentTipIndex]+
			"</td></tr></table>";
}