function gloss(glossaryId) {
	displayWindow('../pagesincludes/glossaryD.jsp?glossaryId='+glossaryId, '300', '200');
}


function changeImages() {
	if (document.images) {

  		image0on = new Image();
  		image0on.src = "../images/nexton.gif";
  
  
  		image1on = new Image();
  		image1on.src = "../images/backon.gif";


  		image0off = new Image();
  		image0off.src = "../images/nextoff.gif";
  
  
  		image1off = new Image();
  		image1off.src = "../images/backoff.gif";
	}	
	if (document.images) {
	for (var i=0; i<changeImages.arguments.length; i+=2) 
	{
	document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
	}
	}
}


 var windowHandle = '';
 function popOpen(url,name,w,h) {
 attributes='toolbar=no,resizable=yes,scrollbars=yes,left=0,top=0,screenX=0,screenY=0,width='+w+',height='+h+'';
 windowHandle = window.open(url,name,attributes);
}

 var Win;
 function displayWindow(url, width, height){
      
      if (Win != null)
         {
			 if (Win.closed == false)
			 {
			         Win.close()
			  }
          } 
     
         Win = window.open(url,"displayWindow", 'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,status=yes,left=20,top=20');
       
            }
	function newWindow(address){
		displayWindow(address, 460, 360);
	}


function checkIt(myform){
	var options=4;
	var given=myform.options.value;
	if(given)
		options=given;
  	var a=9;
    	for (var i=0; i<options; i++) {
          if (myform.givenAnswer[i].checked == true)
         	a=myform.givenAnswer[i].value;
    	}
	var b=myform.answer.value;
	if(a == b)
		writeIt('<b>Correct:</b><br>   '+myform.explanation.value);
	else
		writeIt('<b>Incorrect:</b><br>   '+myform.explanation.value);
	
}
function writeItS(q,width,height)
{
	newWindow = window.open("", "newWin", "toolbar=no,location=no,scrollbars=yes,resizable=no,width="+width+",height="+height)
	newWindow.document.write("<HTML><HEAD><TITLE>Answer<\/TITLE><\/HEAD><BODY BGCOLOR='#FFFFee' onBlur=\"self.close();\" marginheight=\"0\" topmargin=\"0\">")
	newWindow.document.write("<font face=\"Arial, Helvetica, sans-serif\" size=\"3\">")
	newWindow.document.writeln("" + q)
	newWindow.document.write("<\/font>")
	newWindow.document.write("<\/BODY><\/HTML>")
	newWindow.document.close()
}
function goAhead()
{
}
function writeItSDC(q,width,height)
{
	newWindow = window.open("", "newWin", "toolbar=no,location=no,scrollbars=yes,resizable=no,width="+width+",height="+height)
	newWindow.document.write("<HTML><HEAD><TITLE>Answer<\/TITLE><\/HEAD><BODY BGCOLOR='#FFFFee'  marginheight='0' topmargin='0'>")
	newWindow.document.write("<font face=\"Arial, Helvetica, sans-serif\" size=\"3\">")
	newWindow.document.writeln("" + q)
	newWindow.document.write("<\/font>")
	newWindow.document.write("<\/BODY><\/HTML>")
	newWindow.document.close()
}
function writeIt(q)
{
	newWindow = window.open("", "newWin", "toolbar=no,location=no,scrollbars=yes,resizable=no,width=250,height=300")
	newWindow.document.write("<HTML><HEAD><TITLE>Answer<\/TITLE><\/HEAD><BODY BGCOLOR='#FFFFee' onBlur=\"self.close();\"   marginheight='0' topmargin='0'>")
	newWindow.document.write("<font face=\"Arial, Helvetica, sans-serif\" size=\"3\">")
	newWindow.document.writeln("" + q)
	newWindow.document.write("<\/font>")
	newWindow.document.write("<\/BODY><\/HTML>")
	newWindow.document.close()
}
function checkItMCE(myform){
	var options=4;
	var given=myform.options.value;
	if(given)
		options=given;
  	var a=9;
    	for (var i=0; i<options; i++) {
          if (myform.givenAnswer[i].checked == true)
         	a=myform.givenAnswer[i].value;
    	}
	var b=myform.answer.value;
	if(a == b)
		writeIt('<b>Correct:</b><br>   '+myform.explanationCorrect.value);
	else
	{
		wrongExplan='myform.explanation_'+a+'.value';
		//alert(wrongExplan);
		if(eval('myform.explanation_'+a))
			wrongExplan=eval(wrongExplan);
		else
			wrongExplan=myform.explanationDefault.value;
		writeIt('<b>Incorrect:</b><br>   '+wrongExplan);

	}

}