// Created by Pam Berman (2002) for projects developed through the
// Institute for Interactive Technology and MSIT at Bloomsburg University
// http://iit.bloomu.edu
// pberman@bloomu.edu
//*********************************************************
//THIS JAVASCRIPT CONTROLS THE NAVIGATION, HTML PAGES ARE
//INSERTED INTO THE APPROPRIATE ARRAYS.
//
//Array for pages for each section, hidden and visible variables
//control the back and next buttons on each page.
//
// Introduction
var pages0 = new Array(4);
pages0[0] = new Array("pages0/00.html", "hidden", "visible");
pages0[1] = new Array("pages0/01.html", "visible", "visible");
pages0[2] = new Array("pages0/02.html", "visible", "visible");
pages0[3] = new Array("pages0/03.html", "visible", "visible");
pages0[4] = new Array("pages0/last.html", "visible", "hidden");
//
// Course Content
var pages1 = new Array(15);
pages1[0] = new Array("pages1/00.html", "hidden", "visible");
pages1[1] = new Array("pages1/01.html", "visible", "visible");
pages1[2] = new Array("pages1/02.html", "visible", "visible");
pages1[3] = new Array("pages1/03.html", "visible", "visible");
pages1[4] = new Array("pages1/04.html", "visible", "visible");
//pages1[5] = new Array("pages1/05.html", "visible", "visible");
//pages1[6] = new Array("pages1/06.html", "visible", "visible");
pages1[5] = new Array("pages1/07.html", "visible", "visible");
pages1[6] = new Array("pages1/08.html", "visible", "visible");
pages1[7] = new Array("pages1/09.html", "visible", "visible");
pages1[8] = new Array("pages1/10.html", "visible", "visible");
pages1[9] = new Array("pages1/11.html", "visible", "visible");
pages1[10] = new Array("pages1/12.html", "visible", "visible");
pages1[11] = new Array("pages1/13.html", "visible", "visible");
pages1[12] = new Array("pages1/14.html", "visible", "visible");
pages1[13] = new Array("pages1/15.html", "visible", "visible");
pages1[14] = new Array("pages1/last.html", "visible", "hidden");
//
// Syllabus
var pages2 = new Array(5);
pages2[0] = new Array("pages2/00.html", "hidden", "visible");
pages2[1] = new Array("pages2/01.html", "visible", "visible");
pages2[2] = new Array("pages2/02.html", "visible", "visible");
pages2[3] = new Array("pages2/03.html", "visible", "visible");
pages2[4] = new Array("pages2/last.html", "visible", "hidden");
//
// Course Schedule
var pages3 = new Array(6);
pages3[0] = new Array("pages3/00.html", "hidden", "visible");
pages3[1] = new Array("pages3/01.html", "visible", "visible");
pages3[2] = new Array("pages3/02.html", "visible", "visible");
pages3[3] = new Array("pages3/03.html", "visible", "visible");
pages3[4] = new Array("pages3/04.html", "visible", "visible");
pages3[5] = new Array("pages3/last.html", "visible", "hidden");
//
// Course Documents
var pages4 = new Array(1);
//pages4[0] = new Array("pages4/00.html", "hidden", "visible");
//pages4[1] = new Array("pages4/01.html", "visible", "visible");
//pages4[2] = new Array("pages4/02.html", "visible", "visible");
//pages4[3] = new Array("pages4/03.html", "visible", "visible");
//pages4[4] = new Array("pages4/last.html", "visible", "hidden");
pages4[0] = new Array("pages4/special.html", "hidden", "hidden");
//
// Resources Used
var pages5 = new Array(3);
pages5[0] = new Array("pages5/00.html", "hidden", "visible");
pages5[1] = new Array("pages5/01.html", "visible", "visible");
//pages5[2] = new Array("pages5/02.html", "visible", "visible");
//pages5[3] = new Array("pages5/03.html", "visible", "visible");
pages5[2] = new Array("pages5/last.html", "visible", "hidden");
//pages5[0] = new Array("pages5/special.html", "hidden", "hidden");
//
// Cool Links
var pages6 = new Array(2);
pages6[0] = new Array("pages6/00.html", "hidden", "visible");
//pages6[1] = new Array("pages6/01.html", "visible", "visible");
//pages6[2] = new Array("pages6/02.html", "visible", "visible");
pages6[1] = new Array("pages6/last.html", "visible", "hidden");
//
//*********************************************************
// array for the sections and the corresponding links
// This is what creates the section part of the menu.
// arrays section[index][indexBelow]
//		[0] section title 
//		[1] link
//		[2] 508 accessKey
//		[3] show in menu // true or false
//		[4] page set array name
//		[5] show tabs // true or false
//		[6] title text
var section = new Array(7);
section[0] = new Array("Introduction", "pages0/00.html", "i", true, "pages0", false, "Introduction");
section[1] = new Array("Course Content", "pages1/00.html", "1", true, "pages1", false, "Course Content");
section[2] = new Array("Syllabus", "pages2/00.html", "2", true, "pages2", false, "Syllabus");
section[3] = new Array("Course Schedule", "pages3/00.html", "3", true, "pages3", false, "Course Schedule");
section[4] = new Array("Course Documents", "pages4/special.html", "4", true, "pages4", false, "Course Documents");
section[5] = new Array("Resources", "pages5/00.html", "5", true, "pages5", false, "Resources");
section[6] = new Array("Cool Links", "pages6/00.html", "6", false, "pages6", false, "Cool Links");
//
//*********************************************************
//Subsections
//var tab = new Array(4);
//tab[0] = "Introduction";
//tab[1] = "Loss Control Initiatives";
//tab[2] = "Event Reporting & Intervention";
//tab[3] = "Contact Corporate Risk Management";
//**********************************************************
// array for the resource types and the corresponding links
// This is what creates the resources part of the menu.
// These links will probably always be available.
//
// arrays help[index][indexBelow]
//		[0] help title 
//		[1] help link
//		[2] 508 accessKey
//		[3] show in menu // true or false
//		[4] help set array name // if there is one else use null
//		[5] name for new open window // can't use spaces
//		[6] title text
//
// for the window.opener function these names cannot have spaces
var help = new Array(5);
help[0] = new Array("Blackboard", "http://cde.sshe.edu:8092/?bbatt=Y?bbatt=Y", "none", true, null, "blackboard", "Blackboard");
help[1] = new Array("Centra", "http://148.137.193.254/main/index.jhtml", "none", true, null, "centra", "Centra");
help[2] = new Array("1) Webopedia", "http://www.webopedia.com/", "none", true, null, "webopedia", "Webopedia online dictionary");
//help[1] = new Array("Glossary", "glossary.html", "none", true, null, "glossary", "Glossary");
help[3] = new Array("2) TechWeb", "http://www.techweb.com/encyclopedia/", "none", true, null, "techweb", "TechWeb online dictionary");
help[4] = new Array("3) WebMonkey", "http://hotwired.lycos.com/webmonkey/", "none", true, null, "webmonkey", "WebMonkey online resource for Web developers");

//
//**********************************************************
// array for the links for the proposed tab links
//var tablink = new Array(4);
//tablink[0] = "intro3.html";
//tablink[1] = "1_001.html";
//tablink[2] = "2_001.html";
//tablink[3] = "3_001.html";
//*********************************************************
//
// Create global variable for current section and current page
var numCurrentSection = 0;
var varCurrentPageSet = "pages0";
var numCurrentPage = 1;
//
// Create global variable for maximum page number for each section to force users to navigate linearly to make sure that each page is visited
var maxPageNumSection = new Array(6);
maxPageNumSection[0] = 0;
maxPageNumSection[1] = 0;
maxPageNumSection[2] = 0;
maxPageNumSection[3] = 0;
maxPageNumSection[4] = 0;
maxPageNumSection[5] = 0;
//
//
// Create global variable for completion for each section so that course completion can be sent to LMS
var completedSection = new Array(6);
completedSection[0] = false;
completedSection[1] = false;
completedSection[2] = false;
completedSection[3] = false;
completedSection[4] = false;
completedSection[5] = false;
//
// check to see if there is a cookie with updated values for maxPageNum
//var maxPageNumData = getCookie('completiondata');
//alert(maxPageNumData);
//alert("Check");
//reconstitutedata(maxPageNumData);
//**************************************************************
// if there is no value for window.opener already assign this window to it
if (window.opener == null) {
	window.opener = window;
	// give this window a name 
	window.opener.name = "TechApps";
}

// function that uses the url and name passed to it
// this will open multiple windows with the name passed to it
// if clicked again will give focus to that named window
// code should be added to body onLoad=window.focus() of url page
function openOtherWindow(url, name) {
	window.open(url, name, 'menubar,resizable,scrollbars,status,toolbar,width=800,height=550,screenX=0,screenY=0,left=0,top=0');
	//return false;
	//eval("window." + name + ".focus()");
}
function openSmallerWindow(url, name, width, height) {
	var window_info = 'resizable,scrollbars,width=' + width + ',height=' + height;
	window.open(url, name, window_info);
	//return false;
	//eval("window." + name + ".focus()");
}

