// Copyright 1999 InsideDHTML.com, LLC. All rights reserved
// For more information see www.siteexperts.com
// This script can be reused as long as this copyright notice is maintained
// Script modified by R. D. Robbins to extend functionality

function showHideLayers()
{ 
	var i, visStr, obj, args = showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3)
	{
		if ((obj = findObj(args[i])) != null)
		{
			visStr = args[i+2];
			if (obj.style)
			{
				obj = obj.style;
				if(visStr == 'show') visStr = 'visible';
				else if(visStr == 'hide') visStr = 'hidden';
			}
			obj.visibility = visStr;
		}
	}
}


//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Context Menu Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

//The following 3 functions are used for the discovery text templates
function MM_findObj(n, d) { //v4.01
	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);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
		
function MM_setTextOfLayer(objName,x,newText) { //v4.01
	if ((obj=MM_findObj(objName))!=null) with (obj)
	if (document.layers) {document.write(unescape(newText)); document.close();}
	else innerHTML = unescape(newText);
}

function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }
}

//This provides the functionality for scoring the correct progress check question
function scoreA() {
  // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  function newG01() {
    G01 = new MM_interaction('G01',0,0,0,null,0,0,0,'','','c','',0);
    G01.add('inpt','choice1',0,1,1,0);
    G01.add('inpt','choice2',0,1,0,0);
    G01.add('inpt','choice3',0,1,0,0);
    G01.add('inpt','choice4',0,1,0,0);
    G01.init();
    G01.am('segm','Segment: Correctness_',1,0);
    G01.am('cond','Correct_01','G01.correct == true',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'show\',\'MultipleChoiceIncorrect\',\'\',\'hide\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Incorrect_','G01.correct == (false)',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'show\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
	G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceMakeSelection\',\'\',\'show\',\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'hide\')','');
    G01.am('end');
  }

  if (window.newG01 == null) window.newG01 = newG01;
  if (!window.MM_initIntFns) window.MM_initIntFns = ''; window.MM_initIntFns += 'newG01();';
}

function scoreB() {
  // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  function newG01() {
    G01 = new MM_interaction('G01',0,0,0,null,0,0,0,'','','c','',0);
    G01.add('inpt','choice1',0,1,0,0);
    G01.add('inpt','choice2',0,1,1,0);
    G01.add('inpt','choice3',0,1,0,0);
    G01.add('inpt','choice4',0,1,0,0);
    G01.init();
    G01.am('segm','Segment: Correctness_',1,0);
    G01.am('cond','Correct_01','G01.correct == true',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'show\',\'MultipleChoiceIncorrect\',\'\',\'hide\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Incorrect_','G01.correct == (false)',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'show\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
	G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceMakeSelection\',\'\',\'show\',\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'hide\')','');
    G01.am('end');
  }
  if (window.newG01 == null) window.newG01 = newG01;
  if (!window.MM_initIntFns) window.MM_initIntFns = ''; window.MM_initIntFns += 'newG01();';
}

function scoreC() {

  // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  function newG01() {
    G01 = new MM_interaction('G01',0,0,0,null,0,0,0,'','','c','',0);
    G01.add('inpt','choice1',0,1,0,0);
    G01.add('inpt','choice2',0,1,0,0);
    G01.add('inpt','choice3',0,1,1,0);
    G01.add('inpt','choice4',0,1,0,0);
    G01.init();
    G01.am('segm','Segment: Correctness_',1,0);
    G01.am('cond','Correct_01','G01.correct == true',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'show\',\'MultipleChoiceIncorrect\',\'\',\'hide\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Incorrect_','G01.correct == (false)',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'show\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
	G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceMakeSelection\',\'\',\'show\',\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'hide\')','');
    G01.am('end');
  }
  if (window.newG01 == null) window.newG01 = newG01;
  if (!window.MM_initIntFns) window.MM_initIntFns = ''; window.MM_initIntFns += 'newG01();';
}

function scoreD() {
  // Copyright 1998,1999 Macromedia, Inc. All rights reserved.
  function newG01() {
    G01 = new MM_interaction('G01',0,0,0,null,0,0,0,'','','c','',0);
    G01.add('inpt','choice1',0,1,0,0);
    G01.add('inpt','choice2',0,1,0,0);
    G01.add('inpt','choice3',0,1,0,0);
    G01.add('inpt','choice4',0,1,1,0);
    G01.init();
    G01.am('segm','Segment: Correctness_',1,0);
    G01.am('cond','Correct_01','G01.correct == true',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'show\',\'MultipleChoiceIncorrect\',\'\',\'hide\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Incorrect_','G01.correct == (false)',0);
    G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'show\',\'MultipleChoiceMakeSelection\',\'\',\'hide\')','');
    G01.am('end');
    G01.am('cond','Unknown Response_','G01.knownResponse == false',0);
	G01.am('actn','Show-Hide Layers','MM_showHideLayers(\'MultipleChoiceMakeSelection\',\'\',\'show\',\'MultipleChoiceCorrect\',\'\',\'hide\',\'MultipleChoiceIncorrect\',\'\',\'hide\')','');
    G01.am('end');
  }
  if (window.newG01 == null) window.newG01 = newG01;
  if (!window.MM_initIntFns) window.MM_initIntFns = ''; window.MM_initIntFns += 'newG01();';
}

//This function is needed to judge a progress check question
function MM_judgeInt(intId) { //v1.0
  eval(intId+".judge()");
}

//This function is needed to grade a progress check question
function MM_initInteractions() { //v1.0
  if (window.MM_initIntFns) {eval(window.MM_initIntFns); window.MM_initIntFns = '';}
}

