﻿var HelpScript = [
	"<b>Welcome to the School Application Demo</b><br/><br/>This Demo page allows you to simulate the appearance and behavior of the Mitel School 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>My&nbsp;Students: Attendance</b><br/><br/>Click the key next to&nbsp;My&nbsp;Students to&nbsp;open the page.<br/><br/>You should see the list of&nbsp;students. Click next to&nbsp;any of&nbsp;the student on&nbsp;the left side of&nbsp;the phone display to&nbsp;see the presence status change. Click several times to&nbsp;see different presence states. This is&nbsp;how you would take class attendance.",
	"<b>My&nbsp;Students: Info&nbsp;Cards</b><br/><br/>Click next to&nbsp;Anderson, Billy on&nbsp;the right side of&nbsp;the phone display. This should open the student info card.<br/><br/>There are 3&nbsp;tabs of&nbsp;student information available: Attendance, Contact Info and Student profile. Use the phone&#146;s&nbsp;Next&nbsp;<img src='Images/icon-right.gif'> key to&nbsp;view these tabs.<br/><br/>Click Home&nbsp;<img src='images/icon-home.gif' /> key to&nbsp;return to&nbsp;the main page.",
	"<b>School Staff</b><br/><br/>Click the key next to&nbsp;School Staff to&nbsp;open the page.<br/><br/>This is&nbsp;how the school corporate directory would look like.<br/><br/>Click Home&nbsp;<img src='images/icon-home.gif' /> key to&nbsp;return to&nbsp;the main page.",
	"<b>Bulletin Board</b><br/><br/>Click the key next to&nbsp;Bulletin Board to&nbsp;open the bulletin board page.<br/><br/>Click the key next to&nbsp;any of&nbsp;the message titles to&nbsp;see more info. You can also use <img src='Images/icon-left.gif'>&nbsp;Prev and Next&nbsp;<img src='Images/icon-right.gif'> keys to&nbsp;browse through the messages.<br/><br/>Click Home&nbsp;<img src='images/icon-home.gif' /> key to&nbsp;return to&nbsp;the main page.",
	"<b>Book a&nbsp;Room</b><br/><br/>Click the key next to&nbsp;Book a&nbsp;Room to&nbsp;get the idea of&nbsp;the room booking system.<br/><br/>Click the key next to&nbsp;any of&nbsp;the rooms to&nbsp;see more info. Click on&nbsp;Book this Room. Use <img src='Images/icon-left.gif'>&nbsp;Prev and Next&nbsp;<img src='Images/icon-right.gif'> keys to&nbsp;browse through the available times.<br/><br/>Click Home&nbsp;<img src='images/icon-home.gif' /> key to&nbsp;return to&nbsp;the main page.",
	"<b>Duress</b><br/><br/>Click the key next to&nbsp;Duress to&nbsp;open the duress page.<br/><br/>Here you would select the appropriate silent duress depending on&nbsp;the emergency currently in&nbsp;progress. After you click on&nbsp;the corresponding key, a&nbsp;silent duress message would be&nbsp;sent to&nbsp;the central school office. Only single dedicated administrator or&nbsp;security office phone would display this message along with the phone extension (room number) and the date and time when the duress key was pressed. <br/><br/>Click Home&nbsp;<img src='images/icon-home.gif' /> key to&nbsp;return to&nbsp;the main page.",
	"<b>Test Broadcasts</b><br/><br/>Click on&nbsp;the Fire&nbsp;Broadcast button on&nbsp;the top of&nbsp;the page. This simulates the broadcast sent from the school head office to&nbsp;all the phones.<br/><br/>The phone should display a&nbsp;fire alert, all the lamps should blink and there should be&nbsp;a&nbsp;sound of&nbsp;the fire alarm playing.<br/><br/>Click on&nbsp;the Confirm Receipt key to&nbsp;stop the test.<br/><br/>Click on&nbsp;the Bomb&nbsp;Threat&nbsp;or Lockdown&nbsp;Broadcast buttons for the similar effect with different messages and different alarm sounds.",
	"<b>Thank you!</b><br/><br/>Thanks for trying out the Mitel School application demo page!<br/><br/>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>";
}