//Global Variables

// Keep track of location in content by div number
var CurrentPage;


function RenderPreviousButton() {
	return false;
}

/*******************************************************************************
**
** Checks if Flash object is finished loading.
**
** Inputs:  Object - DOM Reference
**
** Return:  Boolean
**
*******************************************************************************/
function SwfLoaded (swfRef) {
  if (typeof(swfRef) != "undefined") {
    return swfRef.PercentLoaded() == 100;
  } else {
    return false;
  }
}



function pause(numberMillis) {
  var now = new Date();
  var exitTime = now.getTime() + numberMillis;
  while (true) {
      now = new Date();
      if (now.getTime() > exitTime)
          return;
  }
}



function BrowserProps() {
  var name = navigator.appName
  
  if (name=="Netscape") name = "ns"
  else if (name=="Microsoft Internet Explorer") name = "ie"
  
  this.v = parseInt(navigator.appVersion,10)
  this.ns = (name=="ns" && this.v>=4)
  this.ns4 = (this.ns && this.v==4)
  this.ns5 = (this.ns && this.v==5)
  this.nsMac = (this.ns && navigator.platform.indexOf("Mac") >= 0 )
  this.ie = (name=="ie" && this.v>=4)
  this.ie4 = (this.ie && navigator.appVersion.indexOf('MSIE 4')>0)
  this.ie5 = (this.ie && navigator.appVersion.indexOf('MSIE 5')>0)
  this.ieMac = (this.ie && navigator.platform.indexOf("Mac") >= 0 )
  this.op = navigator.userAgent.indexOf("Opera")!=-1
  this.min = (this.ns||this.ie)
}

is = new BrowserProps()



function Initialize() {
	
	// set a local variable to page 1
	var locat = 1;
	
// present page to learner
	DisplayPage(locat);
}

/*******************************************************************************
**
** This function is used to get the total number of a
**
** Inputs:  None
**
** Return:  String - total number of divs with the class name "page"
**
*******************************************************************************/



function DisplayPage( pn )
{
	pageNumber = parseInt(pn);
	
CurrentPage = pageNumber;
	if (pageNumber <1 || pageNumber > 14){
		pageNumber = 1;
	}
	
	var divs = document.getElementsByTagName("div");

	for ( var i = 0; i < divs.length; i++ )	{
		var div = divs[i];
		var id = div.id;
		var className = div.className;

		if ( className == "page" ){
			if ( id == "p" + pageNumber ){
				// show requested page
				div.style.visibility = "visible";
			}
			else {
				// hide other pages
				div.style.visibility = "hidden";
			}
		}

	}

	// set global page
	CurrentPage = pageNumber;

}

