﻿var HelpScript = [
	"<b>Welcome to the Mitel Application Builder Demo</b><br/><br/>This Demo page allows you to simulate the appearance and behavior of the Mitel Hospitality 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>Main window</b><br/><br/>Intelligent Directory provides an&nbsp;on-screen searchable phonebook, much like a&nbsp;Blackberry provides a&nbsp;phonebook. Corporate contacts are automatically pulled from the corporate Active Directory, and user&#146;s&nbsp;personal contacts are pulled from the Exchange Server.<br/><br/>When the user opens the Intelligent Directory, the first page of&nbsp;9&nbsp;names found in&nbsp;Active Directory is&nbsp;displayed. To&nbsp;view other pages, use <img src='Images/icon-left.gif'>&nbsp;Prev or&nbsp;Next&nbsp;<img src='Images/icon-right.gif'> keys on&nbsp;the phone. The label on&nbsp;the bottom shows the current page number and the total number of&nbsp;pages in&nbsp;the directory;<br/>e.g., &#146;Page 1&nbsp;of&nbsp;2&#146;.",	
	"<b>Click-to-Dial keys</b><br/><br/>If a&nbsp;person has only one number available, then the key next to&nbsp;the name is&nbsp;programmed to&nbsp;dial that number when pressed. All &#146;click-to-dial&#146; keys are clearly marked with a&nbsp;small phone icon, e.g. <img class='hdn-1' src='Images/icon-dial-small.gif'>Office:&nbsp;1102.<br/><br/>Try clicking one of&nbsp;these keys to&nbsp;see the phone dial.<br/><br/>Then press the key next to&nbsp;Hang-up&nbsp;to&nbsp;cancel dialing.",
	"<b>Dialing Card keys</b><br/><br/>If the person has more than one number, the key next to&nbsp;the name opens the dialing card which can display up&nbsp;to&nbsp;6&nbsp;different numbers. The keys which open dial cards are labeled with a&nbsp;small card icon, e.g. <img class='hdn-1' src='Images/icon-link-small.gif'>6&nbsp;numbers. The label also tells the user how many numbers this person has.<br/><br/>Click one of&nbsp;these keys to&nbsp;see the person&#146;s dialing card.<br/><br/>Press <img class='hdn' src='Images/icon-close.gif'/> Close to&nbsp;return to&nbsp;the main page.",
	"<b>Corporate Contacts vs. Personal&nbsp;Contacts</b><br/><br/>The Home&nbsp;<img src='Images/icon-home.gif' /> key toggles between corporate and personal contacts on&nbsp;the main page of&nbsp;the Intelligent Directory application.<br/><br/>Click the Home&nbsp;<img src='Images/icon-home.gif' /> key to&nbsp;switch to&nbsp;Personal contacts. Note that the presence is&nbsp;not available for Outlook contacts, but is&nbsp;available for Active Directory contacts. This is&nbsp;because the presence status for corporate contacts is&nbsp;fed from the corporate LCS Server.<br/><br/>Click the Home&nbsp;<img src='Images/icon-home.gif' /> key again to&nbsp;return to&nbsp;corporate contacts.",
	"<b>Telephony Pop-up Window</b><br/><br/>On an&nbsp;incoming or&nbsp;outgoing call, the Telephony window pops up&nbsp;automatically over the Intelligent Directory application. You may dial a&nbsp;number either using a&nbsp;&#146;click-to-dial&#146; key next to&nbsp;a&nbsp;person&#146;s&nbsp;name, or&nbsp;by&nbsp;using the standard phone number keypad on&nbsp;the phone set to&nbsp;the right of&nbsp;the display.",
	"<b>Dialing</b><br/><br/>Dial &#146;1907&#146; using the phone keypad now. The phone should simulate dialing.<br/><br/>Press the key next to&nbsp;Hang-up&nbsp;to&nbsp;cancel dialing.<br/><br/>Note that the Telephony window pops up&nbsp;and hides automatically.",
	"<b>Incoming call</b><br/><br/>To simulate an&nbsp;incoming call, click on&nbsp;the Incoming Call button in&nbsp;the top left corner of&nbsp;this Demo page. The phone should simulate an&nbsp;incoming call from Nicholas Cohen.<br/><br/>Click directly on&nbsp;the upper part of&nbsp;the handset to&nbsp;answer the call.<br/><br/>Click on&nbsp;the handset again to&nbsp;hang&nbsp;up.",
	"<b>Telephony Pop-up Window on&nbsp;Demand</b><br/><br/>Click the key next to&nbsp;<img class='hdn3' src='Images/telephony.gif' /> to&nbsp;open the Telephony window&nbsp;&mdash; this gives you access to&nbsp;the Telephony Softkeys, which pop up&nbsp;over the directory.<br/><br/>Click the key next to&nbsp;<img class='hdn' src='Images/icon-close.gif'/> to&nbsp;close the Telephony window.",
	"<b>Search I</b><br/><br/>The Intelligent Directory allows users to&nbsp;search the corporate contacts (stored in&nbsp;Active Directory) or&nbsp;their Outlook contacts. Searching works just like it&nbsp;does on&nbsp;a&nbsp;Blackberry &mdash; you search using the phone keypad. Search for contacts with a&nbsp;specified name or&nbsp;part of&nbsp;name, e.g. the first few letters of&nbsp;the contact&#146;s&nbsp;last name.<br/><br/>Press the <img class='hdn3' src='Images/search.gif'/> key at&nbsp;the top left of&nbsp;the display.",
	"<b>Search II</b><br/><br/>Now try clicking on&nbsp;the &#146;4&#146;, then the &#146;2&#146;, then the &#146;6&#146; twice &mdash; this should enter &#146;gan&#146; into the search box.<br/><br/>Click Search Now. You should see all names that start with &#146;gan&#146; pop up&nbsp;&mdash; in&nbsp;this case, Dale Gantous is&nbsp;the match.<br/><br/>Press Clear Search (same key) to&nbsp;go&nbsp;back to&nbsp;the main directory.",
	"<b>Settings and Help</b><br/><br/>The Intelligent Directory application allows the user to&nbsp;configure a&nbsp;number of&nbsp;settings as&nbsp;well as&nbsp;view help page.<br/><br/>Press Settings and help key at&nbsp;the bottom of&nbsp;the phone display to&nbsp;open the Settings and Help page.",
	"<b>My&nbsp;Account</b><br/><br/>My Account opens a&nbsp;page where the user can change the account settings. This is&nbsp;where you would enter your password to&nbsp;access your Personal contacts.<br/><br/>Click My&nbsp;Account now to&nbsp;see which settings are available (please change NOTHING on&nbsp;this page for this demo).",
	"<b>Passwords and<br/>Hot-Desking</b><br /><br />The password is&nbsp;stored on&nbsp;the phone in&nbsp;a&nbsp;secure manner &mdash; it&nbsp;is&nbsp;entered once and is&nbsp;not lost even during hot-desking. This means that, when different users hot-desk into their extension using the same physical phone, their password comes with them and their Personal contacts show up.&nbsp;When you hot-desk in,&nbsp;your password comes with you and is&nbsp;ready to&nbsp;go.<br/><br/>Click the <img class='hdn' src='Images/icon-close.gif'/> Close without saving key to&nbsp;return to&nbsp;the Settings and Help page.",
	"<b>My Favorites I</b><br/><br/>Click on the key next to My Favorites to open the page.<br/><br/>My Favorites is a group of numbers that will show up at the top of your Directory listing &mdash; think of it as a dynamic speed-dial list, made up of numbers from the directory. The Intelligent Directory application lets you combine two types of favorites: most recently dialed numbers, and a static list of favorite numbers. If the user selects the most recently dialed list, then every time a number is dialed from the directory it is added to the top of the list. The user can also add static favorites by adding names from the directory to the favorites list.",
	"<b>My Favorites II</b><br/><br/>Click <img class='hdn' src='Images/icon-close.gif'/>&nbsp;Close to return to the Settings and Help page.<br/><br/>This Demo doesn't support the settings keys – please don't play with favorites!",
	"<b>Help page</b><br/><br/>Press the Help key to&nbsp;open the Help page.<br/><br/>To browse the available help contents use <img src='Images/icon-left.gif'>&nbsp;Prev or&nbsp;Next&nbsp;<img src='Images/icon-right.gif'> keys.<br/><br/>Now press <img class='hdn' src='Images/icon-close.gif'/>&nbsp;Close key to&nbsp;close the Help page.",
	"<b>About page</b><br/><br/>Press About key to&nbsp;take a&nbsp;look at&nbsp;the Intelligent Directory About page.<br/><br/>Now press <img class='hdn' src='Images/icon-close.gif'/>&nbsp;Close key to&nbsp;close the About page.<br/><br/>Press <img class='hdn' src='Images/icon-close.gif'/>&nbsp;Close again to&nbsp;return to&nbsp;the main page.",
	"<b>Thank you!</b><br/><br/>Thanks for trying out the Mitel Intelligent Directory demo page!<br/><br/>For more information, please contact your Mitel Dealer Representative, and feel free to&nbsp;<a href='http://www.ingeniussoftware.com/mitel/intelligentdirectory' target='_blank'>download</a> the application and try it&nbsp;out!"
];*/

//=====================================================================
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>";
}