// JavaScript Document

//This is to reset the layers to the default after an interactions
function HH_resetLayers(d) {
/*
As long as the id of all feedback layers are preceeded by "FB_"
You can have as many or as few feedback layers as you like.
This will hide all layers whose id property begins with a "FB_" prefix.
*/
	for (i=0;i<d.all.length;i++) {
		eID = d.all(i).id
		ePrefix = eID.slice(0,3)

		if (ePrefix == "FB_") {
			MM_showHideLayers(eID,'','hide');
		}
	}
}

function HH_resetForms(d) {
/*
	This function loops through all the forms on the document
	and calls each form's reset method.
	Resetting a form causes all inputs to reset to their default states/values.
*/
	for (i=0;i<d.forms.length;i++) {
		d.forms[i].reset();
	}
}

//Pop-up window functions

//opens briefcase window
var briefcaseWindow;
function openBriefcase(url){
if(!briefcaseWindow || briefcaseWindow.closed){
briefcaseWindow = window.open(url,"","Width=600 height=480 top=100 left-100 screenx=100 screeny=100");
}else{
briefcaseWindow.focus();
}
}
//closes briefcase window
function closeBriefcase(){
if (briefcaseWindow){
briefcaseWindow.close();
}
}

//opens note window
var noteWindow;
function openNote(url){
if(!noteWindow || noteWindow.closed){
noteWindow = window.open(url,"",'Width=500, height=500, top=100, left-100, screenx=100, screeny=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no' );
//alert("this is the alert");
}else{
noteWindow.focus();
}
}
//closes note window
function closeNote(){
if (noteWindow){
noteWindow.close();
}
}
//opens help window
var helpWindow;
function openHelp(url){
if(!helpWindow || helpWindow.closed){
helpWindow = window.open(url,"","Width=600 height=480");
}else{
helpWindow.focus();
}
}

function closeHelp(){
if (helpWindow){
helpWindow.close();
}
}
//opens about window
var aboutWindow;
function openAbout(url){
if(!aboutWindow || aboutWindow.closed){
aboutWindow = window.open(url,"","Width=600 height=480");
}else{
aboutWindow.focus();
}
}

function closeAbout(){
if (aboutWindow){
aboutWindow.close();
}
}

//Exits program
function ExitProgram(callwindow){
	result = confirm ('Sure you want to Exit?  Click OK if you want to save your progress and close the course.');
	if (result==true){	
		window.self.close();
	opener.focus();
	opener.close();
		
		return true;	
	}	
	    return false;
}

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original:  Premshree Pillai (premshree@hotmail.com ) -->
<!-- Web Site:  http://www.qiksearch.com -->
<!-- Begin
window.onerror = null;

var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);

var blink_speed=500;
var i=0;


if (NS4 || IE4) {
	if (navigator.appName == "Netscape") {
		layerStyleRef 	=	"layer.";
		layerRef		=	"document.layers";
		styleSwitch		=	"";
	}else{
		layerStyleRef	=	"layer.style.";
		layerRef		=	"document.all";
		styleSwitch		=	".style";
	}
}
//BLINKING
/*--------------------HJH
Initialize a global variable to count
the number of times through the blink function
----------------------HJH*/
var count = 0;

/*--------------------HJH
Add the second argument to the function definition
numTimes holds the number of flashes you would like to occur
----------------------HJH*/
function Blink(layerName, numTimes){
if (numTimes == 'undefined') { numTimes = -1 }

	if (NS4 || IE4) { 
		if (i%2 == 0) {
			eval(layerRef+'["'+layerName+'"]' + styleSwitch + '.visibility="visible"');
			count++;
		} else {
			eval(layerRef+'["'+layerName+'"]' + styleSwitch + '.visibility="hidden"');
		}
	}

	if (i < 1) {
		i++;
	} else {
		i--;
	}

	if ( (count < numTimes) || (numTimes == -1) ) {
		setTimeout("Blink('"+layerName+"',"+numTimes+")", blink_speed);
	} else {
		return;
	}

}

function showGoodjob(){
	if (G01.correct == (true)&G02.correct == (true)&G03.correct == (true)){
	document.getElementById("photo").style.visibility = "hidden";
	document.getElementById("goodjob").style.visibility = "visible";
	//alert("this")
	}
	}

//  End -->

//opens mlearning window
var mlearningWindow;
function openmlearning(url){
	//alert("this");
if(!mlearningWindow || mlearningWindow.closed){
mlearningWindow = window.open(url,"",'Width=425, height=750, top=100, left-100, screenx=100, screeny=100,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no' );
//alert("this is the alert");
}else{
mlearningWindow.focus();
}
}

