<!--

var debug = false;

var isSCORM = false;
if (typeof parent.setCompleteFromChild == "function")
	isSCORM = true;

var pageWithRelativePath = "" + window.location.pathname;
pageWithRelativePath = pageWithRelativePath.replace(parent.courseTopPath,"");
var pageID = pageWithRelativePath.substring(pageWithRelativePath.indexOf("/")+1);  // remove "course" folder
//alert(" isSCORM: " + isSCORM + "\n\n pageWithRelativePath: " + pageWithRelativePath + "\n\n pageID: " + pageID);

if (isSCORM)
	parent.setBookmark(pageWithRelativePath);
function setComplete() {
	if (isSCORM)
		parent.setCompleteFromChild();
}

function doExit() {
	if (isSCORM)
		parent.lessonClose();
	else
		top.close();
}

var nextActive = true;
var nextHTMLhold = "";
var isQuestion = false;
var isExam = false;

function enterPage() {
	 //hideNav();
	if (typeof loadPageData == "function")
		loadPageData();
	if (!nextActive) {
		if (parent.pageTrack.indexOf(pageID) > -1)
			enableNextButton();
	}
	if (isExam)
		examPageInit();
	if (isSCORM)
		parent.saveSuspendData();
}

function doSetupQ() {
	if (isQuestion)
		disableNextButton();
}

function disableNextButton() {
	if (nextActive) {
		nextHTMLhold = document.getElementById('nextBtnSpan').innerHTML;
		document.getElementById('nextBtnSpan').innerHTML = "<img name='next' src='"+topPath+"images/next-di.jpg' width='80' height='30' alt='Next - disabled' border='0' />";
		nextActive = false;
	}
}

function enableNextButton() {
	if (!nextActive) {
		document.getElementById('nextBtnSpan').innerHTML = nextHTMLhold;
		if (isSCORM) {
			if (parent.pageTrack.indexOf("|" + pageID + "|") == -1) {
				parent.pageTrack += pageID +"|";
				parent.saveSuspendData();
			}
		}
		nextActive = true;
	}
}


function hideNav() {
	if((pageID.indexOf("glossary") > 0)||(pageID.indexOf("help") > 0)) {
		eval("document.getElementById('nav1').innerHTML='<img src=\"/images/courseMap_di.jpg\" width=\"120\" height=\"30\" alt=\"Course Map\" border=\"0\" />'");
		eval("document.getElementById('nav2').innerHTML='<img src=\"/images/glossary_di.jpg\" width=\"100\" height=\"30\" alt=\"Glossary\" border=\"0\" />'");
		eval("document.getElementById('nav3').innerHTML='<img src=\"/images/help_di.jpg\" width=\"80\" height=\"30\" alt=\"Help\" border=\"0\" />'");		
	}
}

function changeup() {
	var ques = document.getElementsByClassName("formCorrect");
	var ques2 = document.getElementsByClassName("formIncorrect");

	ques.innerHTML = "Correct" + ques.innerHTML ;
	ques2.innerHTML = "Incorrect" + ques2.innerHTML ;
}

function gloss() {
	//alert("gloss()");
	if((pageID.indexOf("glossary") < 0)||(pageID.indexOf("help") < 0)) {
		window.open(topPath+'glossary.html','Glossary','resizable=yes,width=1000,height=600,scrollbars=yes,location=no,menubar=no,resizable=yes,toolbar=yes');
	}
}
function helpPage() {
	//alert("helpPage()");
	if((pageID.indexOf("glossary") < 0)||(pageID.indexOf("help") < 0)) {
		javascript:window.open(topPath+'help.html','Help','resizable=yes,width=1000,height=600,scrollbars=yes,location=no,menubar=no,resizable=yes,toolbar=yes');
	}
}

// ------------- ROLLOVER BUTTONS -------------


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// ------------- FEEDBACK -------------


function DisplayFeedback(FDBK_WindowTitle, FDBK_Header, FDBK_Feedback) {
  FBwin=window.open("","Feedback1","width=400,height=300,left=180,top=110,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

  if (FBwin != null) {
    if (FBwin.opener == null)
      FBwin.opener = window;

    FBwin.document.write("<HTML>\n<HEAD><TITLE>\n");
    FBwin.document.write(FDBK_WindowTitle);
    FBwin.document.write(" &nbsp; &nbsp; &nbsp; </TITLE></HEAD>\n");
    FBwin.document.write("<BODY BACKGROUND='../images/pop_up.jpg' BGCOLOR='WHITE' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>\n");
    FBwin.document.write("<TABLE WIDTH='100%' CELLSPACING=4 CELLPADDING=0><TR><TD ALIGN='CENTER'>\n");
    FBwin.document.write("<FONT STYLE='font-family: Arial, Helvetica, sans-serif; color: White; font-style: normal; font-size: 18px;'><STRONG>\n");
    if (FDBK_Header == "")
      FBwin.document.write("&nbsp;\n");
    else
      FBwin.document.write(FDBK_Header);
    FBwin.document.write("</STRONG></FONT>\n");
    FBwin.document.write("</TD></TR></TABLE>\n");
    FBwin.document.write("<P>\n");
    FBwin.document.write("<FONT STYLE='font-family: Arial, Helvetica, sans-serif; color: Black; font-style: normal; font-size: 16px;'>\n");
    FBwin.document.write("<BLOCKQUOTE>\n");
    FBwin.document.write(FDBK_Feedback);
    FBwin.document.write("\n</BLOCKQUOTE>\n");

    FBwin.document.write("<DIV ID='Close' STYLE='position: absolute; left: 160px; top: 240px; width: 93px; height: 45px; z-index: 0'><A HREF='javascript:self.close()'><IMG SRC='../images/button_close.jpg' WIDTH='93' HEIGHT='45' ALT='Close' BORDER='0'></A></DIV>\n");

    FBwin.document.write("</FONT>\n</BODY>\n</HTML>");
    FBwin.document.close();

    FBwin.focus();
  }
}


function ClickedQuestion() {
	if (document.forms[0].checkme.value == FDBK_CorrectAnswer) 
		DisplayQuestionFeedback(FDBK_FeedbackCorrect);
	else
		DisplayQuestionFeedback(FDBK_FeedbackIncorrect);
}


function DisplayQuestionFeedback(Feedback) {
  FBwin=window.open("","Feedback","width=400,height=300,left=180,top=110,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

  if (FBwin != null)
  {
    if (FBwin.opener == null)
      FBwin.opener = window;

    FBwin.document.write("<HTML>\n<HEAD><TITLE>Feedback &nbsp; &nbsp; &nbsp; </TITLE></HEAD>\n");
    FBwin.document.write("<BODY BACKGROUND='../images/pop_up.jpg' BGCOLOR='WHITE' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>\n");
    FBwin.document.write("<TABLE WIDTH='100%' CELLSPACING=4 CELLPADDING=0><TR><TD ALIGN='CENTER'>\n");
    FBwin.document.write("<FONT STYLE='font-family: Arial, Helvetica, sans-serif; color: White; font-style: normal; font-size: 18px;'><STRONG>\n");
    FBwin.document.write("&nbsp;\n");
    FBwin.document.write("</STRONG></FONT>\n");
    FBwin.document.write("</TD></TR></TABLE>\n");
    FBwin.document.write("<P>\n");
    FBwin.document.write("<FONT STYLE='font-family: Arial, Helvetica, sans-serif; color: Black; font-style: normal; font-size: 16px;'>\n");
    FBwin.document.write("<BLOCKQUOTE>\n");
    FBwin.document.write(Feedback);
    FBwin.document.write("\n</BLOCKQUOTE>\n");

    FBwin.document.write("<DIV ID='Close' STYLE='position: absolute; left: 160px; top: 240px; width: 93px; height: 45px; z-index: 0'><A HREF='javascript:self.close()'><IMG SRC='../images/button_close.jpg' WIDTH='93' HEIGHT='45' ALT='Close' BORDER='0'></A></DIV>\n");

    FBwin.document.write("</FONT>\n</BODY>\n</HTML>");
    FBwin.document.close();

    FBwin.focus();
  }
}


// ------------- GRAPHIC  -------------

function DisplayGraphic(File,W,H,Alt) {
  H = H + 53;
  L = (800 - W) / 2;
  T = (650 - H) / 2;
  FBwin=window.open("","Graphic","width="+W+",height="+H+",left="+L+",top="+T+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

  if (FBwin != null)
  {
    if (FBwin.opener == null)
      FBwin.opener = window;

    FBwin.document.write("<HTML>\n<HEAD><TITLE>Graphic &nbsp; &nbsp; &nbsp; </TITLE></HEAD>\n");
    FBwin.document.write("<BODY BGCOLOR='WHITE' LEFTMARGIN='0' RIGHTMARGIN='0' TOPMARGIN='0' BOTTOMMARGIN='0'>\n");
    FBwin.document.write("<P>\n");
    FBwin.document.write("<FONT STYLE='font-family: Arial, Helvetica, sans-serif; color: Black; font-style: normal; font-size: 16px;'>\n");
    FBwin.document.write("<IMG SRC='images/"+File+"' ALT='"+Alt+"' BORDER='0'>\n");
    FBwin.document.write("<TABLE WIDTH='100%' BGCOLOR='#C6DBE7'><TR><TD ALIGN='CENTER'><A HREF='javascript:self.close()'><IMG SRC='../images/button_close.jpg' WIDTH='93' HEIGHT='45' ALT='Close' BORDER='0'></A></TD></TR></TABLE>\n");
    FBwin.document.write("</FONT>\n</BODY>\n</HTML>");
    FBwin.document.close();

    FBwin.focus();
  }
}



// ------------- VIDEO WINDOW -------------


function VideoWindow(Filename, Text) {
  FBwin=window.open("","Video","width=400,height=400,left=180,top=110,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no");

  if (FBwin != null) {
    if (FBwin.opener == null)
      FBwin.opener = window;

    FBwin.document.write("<HTML><HEAD><TITLE>Video Clip &nbsp; &nbsp; &nbsp; </TITLE>\n");
    FBwin.document.write("<LINK REL='stylesheet' HREF='../msha.css' TYPE='text/css'></HEAD>\n");
    FBwin.document.write("<BODY BGCOLOR='WHITE' LEFTMARGIN='3' RIGHTMARGIN='3' TOPMARGIN='3' BOTTOMMARGIN='3'>\n");
    FBwin.document.write("<DIV ALIGN='CENTER'>\n");
    FBwin.document.write("<OBJECT NAME='rm' ID='RVOCX' CLASSID='CLSID:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH='320' HEIGHT='240'>\n");
    FBwin.document.write("<PARAM NAME='SRC' VALUE='L05_01.html'>\n");
    FBwin.document.write("<PARAM NAME='CONTROLS' VALUE='ImageWindow'>\n");
    FBwin.document.write("<PARAM NAME='CONSOLE' VALUE='cons'>\n");
    FBwin.document.write("<EMBED NOLOGO='true' NOJAVA='true' NAME='rm' AUTOSTART='true' SRC='L05_01.rm' TYPE='audio/x-pn-realaudio-plugin' WIDTH='300' HEIGHT='240' CONTROLS='ImageWindow' CONSOLE='cons'>\n");
    FBwin.document.write("</EMBED> \n");
    FBwin.document.write("<PARAM NAME='autostart' VALUE='true'>\n");
    FBwin.document.write("<PARAM NAME='nojava' VALUE='true'>\n");
    FBwin.document.write("<PARAM NAME='nologo' VALUE='true'>\n");
    FBwin.document.write("</OBJECT>\n");
    FBwin.document.write("</DIV><P>\n");
    FBwin.document.write("<DIV CLASS='normal'>\n");
    FBwin.document.write(Text);
    FBwin.document.write("\n");
    FBwin.document.write("</DIV></BODY></HTML>\n");
    FBwin.document.write("<TABLE WIDTH='100%' BGCOLOR='#C6DBE7'><TR><TD ALIGN='CENTER'><A HREF='javascript:self.close()'><IMG SRC='../images/button_close.jpg' WIDTH='93' HEIGHT='45' ALT='Close' BORDER='0'></A></TD></TR></TABLE>\n");
    FBwin.document.write("</FONT>\n</BODY>\n</HTML>");
    FBwin.document.close();
  }
}



// ------------- FEEDBACK -------------

var timerID = 0;
var feedback = "";
var fbWin = null;
var w,h = 0;

function questionFeedback2(fdbkNum) {
    // Optional Arguments
    w = (arguments[1]) ? arguments[1] : 400;
    h = (arguments[2]) ? arguments[2] : 250;

    if (fbWin && fbWin.open && !fbWin.closed) {
        fbWin.close();
        fbWin = null;
    }

    feedback = eval("a"+fdbkNum);

    tempElement = eval("document.getElementById('qID"+fdbkNum+"')");
    if (fdbkNum == ca) {
        tempElement.className = "qCorrect";
        document.getElementById('next_disabled').style.display='none';
        document.getElementById('next_enabled').style.display='inline';
    } else {
        tempElement.className = "qIncorrect";
        document.getElementById('next_disabled').style.display='inline';
        document.getElementById('next_enabled').style.display='none';

    }
    timerID = setTimeout("displayQuestionFeedback2()", 150);
}

function displayQuestionFeedback2() {
    clearTimeout(timerID);
    timerID  = 0;
    //w, h
    //left=180,top=110
    txt="";
    txt=txt+"<TABLE WIDTH='"+w+"' HEIGHT='"+h+"' CELLSPACING=0 CELLPADDING=0 BORDER=0>\n";
    txt=txt+"<TR>\n";
    txt=txt+"<TD WIDTH='24'><IMG SRC='/images/pop-up_01.jpg' WIDTH='24' HEIGHT='46' ALT='' BORDER='0'></TD>\n";
    txt=txt+"<TD ALIGN='CENTER' VALIGN='TOP' BACKGROUND='images/pop-up_02.jpg'><FONT STYLE='color: White;'></FONT></TD>\n";
    txt=txt+"<TD WIDTH='24'><IMG SRC='/images/pop-up_03.jpg' WIDTH='24' HEIGHT='46' ALT='' BORDER='0'></TD>\n";
    txt=txt+"</TR>\n";
    txt=txt+"<TR>\n";
    txt=txt+"<TD WIDTH='24' HEIGHT='90%' BACKGROUND='images/pop-up_04.jpg'></TD>\n";
    txt=txt+"<TD BACKGROUND='/images/pop-up_05.jpg' VALIGN='TOP' ALIGN='LEFT'>\n";
    txt=txt+"<FONT STYLE='color: Black;'>\n";
    txt=txt+feedback;
    txt=txt+"<BR><BR>\n";
    txt=txt+"<STYLE TYPE='text/css'>.buttonStyle1 { font-family: 'arial',helvetica,sans-serif; font-size: xsmall; font-weight: bold; color: #00049A }</STYLE>";
    txt=txt+'<DIV ALIGN="CENTER"><INPUT TYPE="Button" VALUE=" Close " CLASS="buttonStyle1" ONCLICK="';
    txt=txt+"Element.hide('flash')";
    txt=txt+';return false;"></DIV>\n';
    txt=txt+"</TD>\n";
    txt=txt+"<TD WIDTH='24' BACKGROUND='/images/pop-up_06.jpg'></TD>\n";
    txt=txt+"</TR>\n";
    txt=txt+"<TR>\n";
    txt=txt+"<TD WIDTH='24'><IMG SRC='/images/pop-up_07.jpg' WIDTH='24' HEIGHT='25' ALT='' BORDER='0'></TD>\n";
    txt=txt+"<TD BACKGROUND='/images/pop-up_08.jpg'></TD>\n";
    txt=txt+"<TD WIDTH='24'><IMG SRC='/images/pop-up_09.jpg' WIDTH='24' HEIGHT='25' ALT='' BORDER='0'></TD>\n";
    txt=txt+"</TR>\n";
    txt=txt+"</TABLE>\n";
    $('flash').innerHTML=txt;
    $('flash').width=w;
    $('flash').height=h;
    Element.show('flash');
}

-->
