/*
  3Com OEM Course PageScript
  DO NOT MODIFY THIS SCRIPT
  Author: Kevin Heald at UserView
  Email: kevin.heald@userview.com
*/

// ------------------------------- define global variables
var pagenames = new Array()
var page_to_add = 0
var i = 0
var temp_location_URL = ""
var location_URL = ""
var current_page = ""

// ------------------------------- exit checkpoint and return function
function exit_checkpoint() {
  if (page_chk_1 != "") {
    parent.frames["content"].location = loc_temp_2 + page_chk_1
	} else {
	parent.frames["content"].location = loc_temp_2 + "000h000.htm"
  }
}

// ------------------------------- goto prev page function
function prev_page()
{
    // stores the current URL
  temp_location_URL = parent.frames["content"].location.href
  location_URL = temp_location_URL.substring(0, temp_location_URL.lastIndexOf("/") + 1)

    // stores the current page name
  current_page = temp_location_URL.substring(location_URL.length, temp_location_URL.length + 1).toLowerCase()

    // get previous page name in array
  for (i = 0; i < pagenames.length; i++) {
    if (pagenames[i] == current_page) {
      break
    }
  }
  if (i > 0) {
    parent.frames["content"].location = location_URL + pagenames[i - 1]
    } else {
    parent.frames["content"].location = location_URL + pagenames[0]
  }
}

// ------------------------------- goto next page function
function next_page()
{
    //stores the current URL
  temp_location_URL = parent.frames["content"].location.href
  location_URL = temp_location_URL.substring(0, temp_location_URL.lastIndexOf("/") + 1)

    //stores the current page name
  current_page = temp_location_URL.substring(location_URL.length, temp_location_URL.length + 1).toLowerCase()

    // get next page name in array
  for (i = 0; i < pagenames.length; i++) {
    if (pagenames[i] == current_page) {
      break
    }
  }
  if (i + 1 < pagenames.length) {
    parent.frames["content"].location = location_URL + pagenames[i + 1]
    } else {
    parent.frames["content"].location = location_URL + pagenames[0]
  }
}

// ------------------------------- addpage to array function
function AddPageASP(name)
{
  pagenames[page_to_add] = name + ".asp"
  page_to_add++
}

function AddPageHTM(name)
{
  pagenames[page_to_add] = name + ".htm"
  page_to_add++
}

// ------------------------------- define htm page file names in sequence
AddPageHTM("000h000")  // Course Home
AddPageHTM("m01h001")  // Lesson 1
AddPageHTM("m01h002")
AddPageHTM("m01h003")
AddPageHTM("m01h004")
AddPageHTM("m01h005")
AddPageHTM("m01h006")
AddPageHTM("m01h007")
AddPageHTM("m02h001")  // Lesson 2
AddPageHTM("m02h002")
AddPageHTM("m02h003")
AddPageHTM("m02h004")
AddPageHTM("m02h005")
AddPageHTM("m03h001")  // Lesson 3
AddPageHTM("m03h002")
AddPageHTM("m03h003")
AddPageHTM("m03h004")
AddPageHTM("m03h005")
AddPageHTM("m03h006")
AddPageHTM("m03h007")
AddPageHTM("m03h008")
AddPageHTM("m04h001")  // Lesson 4
AddPageHTM("m04h002")
AddPageHTM("m04h003")
AddPageHTM("m04h004")
AddPageHTM("m04h005")
AddPageHTM("m04h006")
AddPageHTM("m04h007")
AddPageHTM("m05h001")  // Next Steps
