// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// JavaScript LIBrary for MSKAP 12 Update
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// (c) 2002.  American College of Physicians - American Society of Internal Medicine
//
// Steven Spadt
// Electronic Product Development, ACP-ASIM
//
// 2.27.2002
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//      U t i l i t i e s
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// These utility methods are called throughout
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Browser Detection - 
// Runs on load of each page that imports the jslib and
// sets global variables related to browser class/type
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
var oldIE = false;
var isMac = false;
var extender = "";
if (navigator.appName.indexOf("Netscape") != -1) {
	// Netscape
	var isNetscape = true;
	var pathAdjuster = "";
} else {
	// Not Netscape
	var isNetscape = false;
	var versionString = navigator.appVersion;
	versionMatch = versionString.match(/MSIE ([^;]*);/);
	var versionNumber = parseInt(versionMatch[1]);
	if ((navigator.appName.indexOf("Internet Explorer") != -1)&&(versionNumber<5)){
		oldIE = true;
	}
}
if (navigator.platform == "MacPPC"){
	isMac = true;
	extender = "content/syllabus/";
}

// Map of MCQ Letters to radio numbers
var optionLetter = new Array();
optionLetter[0] = "A";
optionLetter[1] = "B";
optionLetter[2] = "C";
optionLetter[3] = "D";
optionLetter[4] = "E";
optionLetter[5] = "-";

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Maximize the screen (if not netscape) and 
// open License Agreement regardless (unless already agreed) and
// open Cookie Enablement Warning if cookies turned off or Netscape
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function maxScreen() {
	var showCookieWarning = true;
	if (!(isNetscape | isMac)){
		self.moveTo(0,0);
		self.resizeTo(screen.availWidth, screen.availHeight);
		if (navigator.cookieEnabled) {
			showCookieWarning = false;
		}
	}
	// Check if agreement has been accepted yet (look for cookie)...if not, open it
	if (getInfiniteCookie("UpdateLicense")==""){
		// but first, if this is first time, and they need to be warned, do so...
		if (showCookieWarning){
			openCookieWarning();
		}
		openAgreement(); // open the license agreement
	}
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open the Licensing Agreement window
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openAgreement(){
	lawin = window.open("licenseagree.html","la","top=50,left=50,width=520,height=400,scrollbars=yes,resizable=yes");
	lawin.opener = self;
	lawin.focus();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open the Cookie Enablement window
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openCookieWarning(){
	cewin = window.open("cookieEnabling.html","ce","top=100,left=100,width=400,height=300,scrollbars=yes,resizable=no");
	cewin.opener = self;
	cewin.focus();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open the Cookie Enablement window
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openIntro(sourceName){
	introwin = window.open(sourceName+".html","intro","top=50,left=50,width=350,height=400,scrollbars=yes,resizable=yes");
	introwin.opener = self;
	introwin.focus();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open a new window containing the contents of the file at sourcePath, and of
// height and width specified (default is defined here).
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openPopup(source, height, width, inContext){
	if (height==null){
		var height = screen.availHeight - 50;
	}
	if (width==null){
		var width = screen.availWidth - 50;
	}
	puwin = window.open(extender+source,"popup","top=50,left=50,width="+width+",height="+height+",scrollbars=yes,resizable=yes");
	puwin.opener = self;
	puwin.focus();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open a new search window
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openSearchPopup(source){
	spuwin = window.open(source,"searchpopup","top="+(screen.availHeight - 450)+",left=10,width=550,height=400,scrollbars=yes,resizable=yes");
	spuwin.opener = self;
	spuwin.focus();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//      S y l l a b u s    B r o w s e    M o d e
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// These methods control Syllabus Browse Mode

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Called by treeMenuClickRoot() in treeMenuCode.js, display the
// "Main Menu".
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function loadSplashPages(treeMenuName){
	if (treeMenuName=="Self-Assessment"){
		top.main.location = "sasplash.html";
  		top.title.location = "satitle.html";
	} else {
		top.main.location = "mainsplash.html";
  		top.title.location = "title.html";
	}	
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Load a window with the Key Points for the given chunk ID
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function openKeyPoints(chunkID, inContext){
	var pathToKP = "keyPoints/kp" + chunkID + ".html";
	openPopup(pathToKP, 450, 400, inContext);
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Called by treeMenuClickRoot() in treeMenuCode.js, display the
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function loadChunk(chunkNumber){
	// Synchronize Tree...
	var chunkContentPath = "content/syllabus/ucn";
	// ...determine treeFolderID and treeNodeID...
	var treeFolderID = treeMenu.items.length + chapter.length - 1 + toc[chunkNumber].sectionID; // removed one -1 (8.9)
	var treeNodeID = treeMenu.items.length + chapter.length -1 + chunkNumber; // removed one -1 (8.9)
	// ...and the ItemID...(not the same as itemNumber, after resort)
	var itemID = toc[chunkNumber].itemID;
	var cookie = getCookie(treeMenuName);
	var treeMenuExpand = cookie.split(",");
	// When using Prev/Next functionality, automatically open parent folders if necessary
	if ((!cookie)||(treeMenuExpand[toc[chunkNumber].bookID] < 1)){	
		top.treeMenuClick(toc[chunkNumber].bookID, false, true); // book folder
	}
	if ((!cookie)||(treeMenuExpand[types.length + toc[chunkNumber].chapterID] < 1)){	
		top.treeMenuClick(types.length + toc[chunkNumber].chapterID, false, true); // chapter folder ( - 1 on 7.22) - back to normal on 8.9
	}
	if ((!cookie)||(treeMenuExpand[treeFolderID] < 1)){	
		top.treeMenuClick(treeFolderID, false, true); // section folder
	}
	// ...mark the current item as selected
	top.treeMenuClick(treeNodeID, true, false); //treeNodeID
	// Load the content in the main frame	
	top.main.location = chunkContentPath+itemID+".html";
	// Load title info into title frame
	loadTitle(chunkNumber, 0, 0);
}

// ---------------------------------------------------------------
// Update Object Constructor
// ---------------------------------------------------------------
function updateChunk(name, bookID, chapterID, sectionID, itemID){
	this.text = name;
	this.bookID = bookID;
	this.chapterID = chapterID;
	this.sectionID = sectionID;
	this.itemID = itemID; // same as sectionID if this is not a subsection parent or chunk
	return this;
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//      S e l f - A s s e s s m e n t    M o d e
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// These methods control Self-Assessment Mode

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Produce the test results (calculate and display percentages for each book),
// including display of progress bar during calculation (updated at each book),
// and allow user to enter actual hours and submit for CME.
// Also, user can click on "hot" books to view actual responses for each question,
// alongside the correct response.
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function testStatus(){
	var scoreWindow = top.main.document;
	// get user data, if previously submitted
	var userCookie = getInfiniteCookie("userData");  // Use to populate user data form (bottom of page)
	var userArray = new Array(5);
	if (userCookie != null) {
		var userArray = userCookie.split("|"); // 0=first, 1=last, 2=phone, 3=email, 4=testNumber
	} else {
		// initialize the empty array
		for (var i=0; i<userArray.length; i++){
			userArray[i] = null;
		}
	}
	// get hours, if previously submitted
	var hourCookie = getInfiniteCookie("hourData"); // Use to populate select controls, if they exist
	var hourArray = new Array(13);	// will hold index of select object for #hours (index=bookID)
	if (hourCookie != null) {
		var tempHourArray = hourCookie.split("|"); // array of submitted bookIDs (with hours)
		for (var i=0; i<tempHourArray.length; i++){
			var index = tempHourArray[i].indexOf(":");
			// get bookID, and store in appropriate hourArray element
			var bID = parseInt(tempHourArray[i].substring(0,index));
			hourArray[bID] = tempHourArray[i].substr(index+1,1); // the index of the select object for book bID
		}
	} else {
		// initialize the empty array	
		for (var i=0; i<hourArray.length; i++){
			hourArray[i] = null;
		}
	}
	
	// Write the answer sheet to screen
	scoreWindow.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"styles/content.css\" /></head><body><p><br /><table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" align=\"center\" width=\"450\"><tr><td><b><a name=\"top\"><span class=\"large\">Answer Sheet for MKSAP 12 <i>Update</i></span></a></b></td><td align=\"right\">");
	scoreWindow.write("<a href=\"javascript:top.testSummary();\"><img src=\"graphics/viewSummary.gif\" align=\"bottom\" width=\"84\" height=\"19\" alt=\"View a summary of your performance by book\" border=\"0\" /></a> <a href=\"clearWarning.html\"><img src=\"graphics/clearAnswers.gif\" align=\"bottom\" width=\"84\" height=\"19\" alt=\"Erase all of your answers for all disciplines\" border=\"0\" /></a></td></tr></table> </p>\n");
// FOR TESTING...
//	scoreWindow.write("<form name=\"UpdateCMEForm\" action=\"http://cpscdev.acponline.org/free-cgi-bin/mksap-update-cme.pl\" method=\"post\">\n");	
	scoreWindow.write("<form name=\"UpdateCMEForm\" action=\"http://www.acponline.org/cgi-bin/mksap-update-cme.pl\" method=\"post\">\n");
	var itemIndex=1;
	var numberOfColumns=3;
	var atLeastOne = false; // Flag to indicate that at least one book is ready to submit...
	var chapterCookie = getChapterName(itemIndex);  // Assume same cookie, for performance reasons...
	var responsesCookie = getInfiniteCookie(chapterCookie);
	// Loop through books...
	for (bookIndex=0; bookIndex<types.length; bookIndex++) {
		var bookPointsTotal=0;
		var bookPointsPossible=0;
		var bookUnanswered=0;
		// 1 - Loop through questions for this book...
		scoreWindow.write("<table class=\"box\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\" align=\"center\" width=\""+numberOfColumns*150+"\"><tr class=\"tableHeader\"><td colspan=\""+numberOfColumns+"\"><b>"+types[bookIndex]+"</b></td></tr><tr><td colspan=\""+numberOfColumns+"\"></td>\n");
		var columnCount=numberOfColumns+1;	// count up to numberOfColumns
		while ((itemIndex<toc.length)&&(toc[itemIndex].folderID==bookIndex)) {
			bookPointsPossible++;
			if (columnCount > numberOfColumns){
				scoreWindow.write("</tr><tr width=\"150\">");
				columnCount=1;	
			}
			scoreWindow.write("\n<td>");
			columnCount++;
			// ... - Output "hot" label of current item 
			scoreWindow.write("<a href=\"javascript:top.loadItem("+itemIndex+", 1)\">"+toc[itemIndex].text+"</a>: ");
			// a - Look up user's response
			var userResponseNumber = map2Number(findResponse(itemIndex, responsesCookie));
			// b - Compare to correct answer
			if (userResponseNumber == null){
				scoreWindow.write("_</td>\n"); // User hasn't answered this yet
				bookUnanswered++;
			} else {
				if (userResponseNumber == toc[itemIndex].answerNumber){
					scoreWindow.write("<span class=\"correctAnswer\">"+optionLetter[userResponseNumber]+"</span></td>\n");// Correct
					bookPointsTotal++;
				} else {
					// output wrong answer (with correct in parens)
					scoreWindow.write("<span class=\"wrongAnswer\">"+optionLetter[userResponseNumber]+"</span> ("+optionLetter[toc[itemIndex].answerNumber]+")</td>\n");// Incorrect
				}
			}
			// c - Output item # (linked to item), correct answer, user response, and check or "X"
			//      using a 2- or 3-column format to save space!
			itemIndex++;
		}				
		//	2 - Sum total correct, calculate and display % correct 
		var bookScore = calculateBookScore(bookPointsTotal, bookPointsPossible, bookUnanswered);
		scoreWindow.write("</tr><tr><td colspan=\""+numberOfColumns+"\" class=\"tableFooter\">Score: <b>"+bookScore+"%</b>");
		if (bookUnanswered > 0){
			if (bookUnanswered > 1){
				scoreWindow.write(", but "+bookUnanswered+" questions are unanswered");
			} else {
				scoreWindow.write(", but 1 question is unanswered");
			}
			scoreWindow.write("<input type=\"hidden\" name=\"book"+bookIndex+"cme\" value=\"0\"/>\n");
		} else {
			// User is eligible for CME credit for this book...if score is high enough
			//  3 - If % > 30, display submit button to take to page with cme submission form
			//       (with other books with > 30, too)
			if (parseInt(bookScore) >= 30) {
				atLeastOne = true;
				scoreWindow.write(" - You are eligible for up to <b>"+getMaxCredits(bookIndex)+" hour(s)</b> of Category I CME Credit.  You may submit now or wait until you have completed other disciplines.  If you wish to submit now, specify the total amount of time you spent on this discipline: ");
				writeHourOptions(scoreWindow, bookIndex, hourArray);
			}	else {
				// write an explanation that score is too low, must reanswer...
				scoreWindow.write(" - You have not scored high enough to earn Category I CME Credit.  Please review the Update content and reanswer the questions.");
			}
		}
		scoreWindow.write("</td></tr></table><br />\n");
	}		
	// CME Submission section (with submit button and instructions to fax, if no Web access)
	writeCMESubmissionSection(scoreWindow, numberOfColumns, atLeastOne, userArray);
	// clean up...
	scoreWindow.write("</form><br /></html></body>");
	scoreWindow.close();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Generate summary page (with barcharts for each book)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function testSummary() {
	var scoreWindow = top.main.document;
	// Write the barcharts to screen
	scoreWindow.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"styles/content.css\" /></head><body><p><br /><table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" align=\"center\" width=\"450\"><tr><td><b><span class=\"large\">Summary for MKSAP 12 <i>Update</i></span></b></td><td align=\"right\">");
	scoreWindow.write("<a href=\"javascript:top.testStatus();\"><img src=\"graphics/viewDetails.gif\" align=\"bottom\" width=\"84\" height=\"19\" alt=\"View your complete answer sheet\" border=\"0\" /></a> <a href=\"javascript:top.printMain();\"><img src=\"graphics/printThisRecord.gif\" align=\"bottom\" width=\"84\" height=\"19\" alt=\"Print this page for your records\" border=\"0\" /></a></td></tr></table></p><table class=\"box\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" width=\"450\">\n");
	scoreWindow.write("<tr><td></td><td align=\"center\"><b>%</b></td><td colspan=\"2\" align=\"right\" class=\"small\"><span class=\"small\">(# unanswered)</span></td></tr>\n");
	scoreWindow.write("<tr height=\"1\" bgcolor=\"#000000\"><td colspan=\"4\"></td></tr>\n");
	var itemIndex=1;
	var chapterCookie = getChapterName(itemIndex);  // Assume same cookie, for performance reasons...
	var responsesCookie = getInfiniteCookie(chapterCookie);
	// Loop through books...
	for (bookIndex=0; bookIndex<types.length; bookIndex++) {
		var bookPointsTotal=0;
		var bookPointsPossible=0;
		var bookUnanswered=0;
		// 1 - Loop through questions for this book...
		scoreWindow.write("<tr><td class=\"small\" align=\"right\"><span class=\"small\">"+types[bookIndex]+"</span></td> \n");
		while ((itemIndex<toc.length)&&(toc[itemIndex].folderID==bookIndex)) {
			bookPointsPossible++;
			var userResponseNumber = map2Number(findResponse(itemIndex, responsesCookie));
			// Compare to correct answer
			if (userResponseNumber == null){
				bookUnanswered++;
			} else {
				if (userResponseNumber == toc[itemIndex].answerNumber){
					bookPointsTotal++;
				}
			}
			itemIndex++;
		}				
		//	2 - Sum total correct, calculate and display % correct 
		var bookScore = calculateBookScore(bookPointsTotal, bookPointsPossible, bookUnanswered);
		scoreWindow.write("<td align=\"center\">&nbsp;<span class=\"small\"><b>"+bookScore+"</b></span></td>");
		// Output the bar, sized relative to % (red if below 30, yellow if between 30 and 80, green if above 70)
		var barName = "barRed";
		var barWidth = bookScore*2;
		if (bookScore > 79){
			barName = "barGreen";
		} else {
			if (bookScore > 49){
				barName = "barYellow";
			}
		}
		scoreWindow.write("<td align=\"left\" width=\"202\" background=\"graphics/barBack.gif\"><img src=\"graphics/blackPixel.gif\" height=\"19\" width=\"1\" border=\"0\" /><img src=\"graphics/"+barName+".gif\" border=\"0\" height=\"19\" width=\""+barWidth+"\" /><img src=\"graphics/blackPixel.gif\" height=\"19\" width=\"1\" border=\"0\" />");
		// show number unanswered
		scoreWindow.write("</td><td align=\"right\" class=\"small\" background=\"graphics/lineBack.gif\" width=\"30\"><span class=\"small\">");
		if (bookUnanswered > 0){
				scoreWindow.write("("+bookUnanswered+")");
		}		
		scoreWindow.write("</span></td></tr>\n");
	}		
	// clean up...
	scoreWindow.write("</table><br /></html></body>");
	scoreWindow.close();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Clear all responses (by setting responses cookie to empty string)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function clearAnswers() {
	var itemIndex = 1; // Assume same cookie, for performance reasons...
	setInfiniteCookie(getChapterName(itemIndex),"");	// set the responses cookie to empty string
	testStatus(); // Redraw the details (test status) page, showing all cleared answers
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Look up the maximum number of credit hours for a book
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function getMaxCredits(bookIndex){
	var maxHours = new Array();
	maxHours[0] = 3; //"Gastroenterology";
	maxHours[1] = 2; //"Endocrinology and Metabolism";
	maxHours[2] = 3; //"Infectious Disease Medicine";
	maxHours[3] = 2; //"Rheumatology";
	maxHours[4] = 2; //"Oncology";
	maxHours[5] = 3; //"Hematology";
	maxHours[6] = 4; //"Cardiovascular Medicine";
	maxHours[7] = 1; //"Pulmonary Medicine";
	maxHours[8] = 2; //"Neurology";
	maxHours[9] = 1; //"Dermatology";
	maxHours[10] = 2; //"Nephrology";
	maxHours[11] = 3; //"Hospital-Based Medicine";
	maxHours[12] = 2; //"Ambulatory Medicine";
	return maxHours[bookIndex];
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// output the options for user-specification of hours spent 
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function writeHourOptions(scoreWindow, bookID, hourArray){
	//	scoreWindow.write("<br /><input type=\"text\" size=\"2\" maxlength=\"3\" value=\""+getMaxCredits(bookIndex)+"\"> hours</input> (to submit, see <a href=\"#cmeSection\">CME Submission</a> section)\n");
	scoreWindow.write("<br /><select name=\"book"+bookID+"\">\n");
	var maxHours = getMaxCredits(bookID);
	var count = 0;
	var setMax = true;
	for (var i=0.25; i<=maxHours; i+=0.25){
		var alreadySubmitted = (count == hourArray[bookID]);
		if (alreadySubmitted){
			setMax = false;
		}
		scoreWindow.write("<option value=\""+i+"\" "+((alreadySubmitted||(setMax&(i==maxHours))) ? " selected ": "")+"><b>"+i+"</b></option>\n");
		count++;
	}
	if (!(isNetscape)){
		scoreWindow.write("</select>  <b>hour</b>(<b>s</b>) (to complete submission, see <a href=\"#cmeSubmission\">CME Submission</a> section)\n");
	} else {
		scoreWindow.write("</select>  <b>hours</b> (to complete submission, complete the form at the bottom of this page).\n");
	}		
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// output CME Submission section (with submit button and instructions to fax)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function writeCMESubmissionSection(scoreWindow, numberOfColumns, atLeastOne, userArray){
	scoreWindow.write("<table class=\"box\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\" align=\"center\" width=\""+numberOfColumns*150+"\"><tr class=\"tableHeaderBlack\"><td><b><a name=\"cmeSubmission\">CME Submission</a></b></td></tr></tr>\n");
	scoreWindow.write("<tr class=\"tableFooter\"><td><img src=\"graphics/cme.gif\" height=\"19\" width=\"97\" border=\"0\" alt=\"More information about CME submission\" align=\"right\" />\n");
	if (atLeastOne) {
		scoreWindow.write("You are now eligible to submit for the total Category 1 CME Credit Hours indicated above, either via the Internet, by fax, or by mail.\n");
		scoreWindow.write("<p><b>To Submit:</b></p><p><img src=\"graphics/one.gif\" height=\"21\" width=\"21\" border=\"0\" align=\"top\"> <i>Complete this form:</i><br />\n");
		scoreWindow.write("<div class=\"indent\">First Name: <input type=\"text\"  name=\"firstName\" size=\"28\" value=\""+(userArray[0]!=null ? userArray[0] : "")+"\" /><br />Last Name: <input type=\"text\" name=\"lastName\" size=\"28\" value=\""+(userArray[1]!=null ? userArray[1] : "")+"\" /><br />\n");
		scoreWindow.write("<b>Test Number</b> <span class=\"small\">(Customer Order No.)</span>: <input type=\"text\" name=\"testNumber\" size=\"8\" maxlength=\"10\" value=\""+(userArray[4]!=null ? userArray[4] : "")+"\" /><span class=\"large\"><b>*</b></span><br /><span class=\"large\"><b>*</b></span> <span class=\"small\">Your packing slip lists a Customer Order No., which is your Test Number.  If you can't find your number, call Customer Service at +1 (800) 523-1546 x2600<br />(International customers call +1 (215) 351-2600)</span>\n");		
		scoreWindow.write("<br />Phone: <input type=\"text\"  name=\"phone\" size=\"38\" value=\""+(userArray[2]!=null ? userArray[2] : "")+"\" /><br />E-mail: <input type=\"text\" name=\"email\" size=\"38\" / value=\""+(userArray[3]!=null ? userArray[3] : "")+"\"><br />\n");
		scoreWindow.write("</div>\n");
		// list steps 2 and 3
		scoreWindow.write("<br /><img src=\"graphics/two.gif\" height=\"21\" width=\"21\" border=\"0\" align=\"top\"> <a href=\"javascript:top.printCME();\"><img src=\"graphics/printThisRecord.gif\" height=\"19\" width=\"92\" border=\"0\" align=\"top\" alt=\"print this page for your records\"></a><br /><img src=\"graphics/three.gif\" height=\"21\" width=\"21\" border=\"0\" align=\"top\"> <a href=\"javascript:top.submitForCME(document.UpdateCMEForm);\"><img src=\"graphics/submitForCME.gif\" height=\"19\" width=\"92\" border=\"0\" align=\"top\" alt=\"Submit for CME Online\"></a> (via Internet, so no need to fax/mail your form)<br /><b>OR</b> <i>After completing steps 1 and 2 above</i>, either:<br />Fax this page to (215) 351-2799<br /><b>OR</b> mail it to: <br /><span class=\"small\">Customer Service Department<br />ACP-ASIM<br />190 N. Independence Mall W.<br />Philadelphia, PA 19106-1572 (USA)</span></p>\n");
	} else {
		scoreWindow.write("CME credit is not available in this SAMPLE.  In the MKSAP 12 Update product, you would be allowed to submit this form either via the Internet (simply by clicking a button made available here), or by printing this page and faxing or mailing it to the ACP-ASIM.\n");
	}
	scoreWindow.write("<br />"+(!isNetscape ? "<div class=\"rightAlign\">- <a href=\"#top\">back to top</a> -</div>" : "")+"\n");
	scoreWindow.write("</td></tr></table>\n");
}	


// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// validates, then submits data for CME to ACP-ASIM (and sets cookies for next time)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function submitForCME(form) {
	// first store the data in cookies (one for hours, one for demographics) for next time
	//  ...to be retrieved and used to populate fields in writeHourOptions and writeCMESubmissionSection (above)
	// piped list of data (firstName | lastName | phone | email | testNumber)
	var userDataValue = form.firstName.value + "|" + form.lastName.value + "|" + form.phone.value + "|" + form.email.value + "|" + form.testNumber.value;
	setInfiniteCookie("userData", userDataValue);
	// piped list with bookID:hoursClaimed pairs
	var hourDataValue = "";
	var bookHourIndex = "";
	for (var i=0; i<=types.length; i++) {
		var selected = "form.book"+i;
		if (eval(selected) != null){
			bookHourIndex = eval(selected+".selectedIndex");
			hourDataValue = hourDataValue + "|" + i +":"+bookHourIndex;
		}	
	}
	setInfiniteCookie("hourData", hourDataValue);	
	// do form validation (require first/last name, phone, and test ID number)
	if ( (form.firstName.value=="")||(form.lastName.value=="")||(form.phone.value=="")||(form.testNumber.value=="") ) {
		alert ("Please enter all of your information before submitting.");
	} else {
		// submit the data to the CGI handler on ACP-ASIM server
		if (confirm("If you are not already connected to the Internet, please do so now and then click OK.")){
			form.submit();
		}	
	}
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// return total number of hours claimed by user for CME (read directly from form)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//function getTotalHoursClaimed(scoreWindow){
//	var cmeForm = scoreWindow.UpdateCMEForm;
//	var totalClaim = 0;
//	// loop for each selection object, tallying total values
////	for (var s = 0; s < cmeForm.selection.length; s++){
////		totalClaim = totalClaim + cmeForm.selection[0].value;
////	}
//	totalClaim = totalClaim + parseFloat(cmeForm.book0cme.value);
//	return totalClaim;
//}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Calculate and return the integer-rounded book score (%)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function calculateBookScore(points, possible, unanswered){
	var score = (points/(possible-unanswered))*100;
	if (((possible-unanswered) < 1)||(points < 1)) {
		return 0;
	}
	return Math.round(score);
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Check if answer already stored for this item and, if so, check it
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function loadResponse(itemNumber){
	var currentDoc = top.main.document;
	// Get cookie and retrieve previously stored value (if any)
	var chapterCookie = getChapterName(itemNumber);
	var responsesCookie = getInfiniteCookie(chapterCookie);
	var currentResponse = findResponse(itemNumber, responsesCookie);
	if (currentResponse != null){
		var optionNumber = map2Number(currentResponse);
		// Set radio button of corresponding answer option
		//currentDoc.answerOptions.response[optionNumber].checked = true;
		currentDoc.answerOptions.response[optionNumber].checked = true;
	}	
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Do Look-up of answer in answer sheet for given item ID and response number, then
// compare to user's answer and...
// RETURNS: String ["correctAnswer", "wrongAnswer", "answerOption" (default)]
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function checkAnswer(itemNumber, optionNumber){
	var styleText = "answerOption";
	if (toc[itemNumber].answerNumber == optionNumber){
		styleText = "correctAnswer";
	} else {
		var chapterCookie = getChapterName(itemNumber);
		var responsesCookie = getInfiniteCookie(chapterCookie);
		var userResponseNumber = map2Number(findResponse(itemNumber, responsesCookie));
		if ((userResponseNumber != null)&&(userResponseNumber != toc[itemNumber].answerNumber)&&(optionNumber == userResponseNumber)) {
			styleText = "wrongAnswer";
		}
	}	
	return styleText;
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Look up answer in answer sheet for given item ID and response number.
// RETURNS: answer letter (A..E) - null if no match
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function getAnswerLetter(itemNumber){
	return optionLetter[toc[itemNumber].answerNumber];
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Store answer for this item
//  Format:  |{item1ID}:{response1}|{item2ID}:{response2}|...
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function storeResponse(itemNumber, responseLetter){
	// Get cookie and store new response
	var chapterCookie = getChapterName(itemNumber);
	var responsesCookie = getInfiniteCookie(chapterCookie);
	var currentResponse = findResponse(itemNumber, responsesCookie);
	if (currentResponse != null){
		// replace current answer...	
		var reMatch = new RegExp("\\|"+itemNumber+":\\w");
		responsesCookie = responsesCookie.replace(reMatch, "|"+itemNumber+":"+responseLetter);
	} else {
		// no response stored for this item yet, so append answer to cookie...
		responsesCookie = responsesCookie + "|" + itemNumber + ":" + responseLetter;	
	}
    setInfiniteCookie(chapterCookie, responsesCookie);
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Map the option letter (A - E) to (0 - 4)
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function map2Number(letter){
	for (i=0; i<optionLetter.length; i++){
		if (optionLetter[i] == letter)
			return i;
	}
	return null;
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// find parent chapter, then return response stored for item, or null if none
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function findResponse(itemNumber, responsesCookie){
	// Look for "|{itemNumber}:{answerLetter}"...
	var responseArray = responsesCookie.split("|");
	for (i=0; i<responseArray.length; i++){
		var responseIndex = responseArray[i].indexOf(":");
		if (responseArray[i].substring(0,responseIndex)==itemNumber){ 
			// found it...
			return responseArray[i].substr(responseIndex+1,1);
		}
	}
	return null;
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Map item to its parent chapter
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function getChapterName(itemNumber){
	// either use something like toc[itemNumber].folderID OR look up in some other array...
	var chapterName = "UpdateResponses";
	// ...for now, store all in one cookie...
	return chapterName;
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Retrieve cookie of given name
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function getInfiniteCookie(name){
	var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
	var i=0;
    while (i<clen) {
    	var j = i + alen;
        if (document.cookie.substring(i,j)==arg)
			return getInfiniteCookieVal(j);
        i = document.cookie.indexOf(";", i) + 2;
        if (i==1) break;
	}
    return "";
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Retrieve value of cookie based on given offset
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function getInfiniteCookieVal(offset){
    var endstr = document.cookie.indexOf(";", offset);
    if (endstr==-1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Store name/value pair in cookie jar
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function setInfiniteCookie(name, value){
	var exp = new Date();
	exp.setTime(exp.getTime() + (5 * 365 * 24 * 60 * 60 *1000)); // 5 years from now
	document.cookie = name + "=" + escape(value) + "; expires="+exp.toGMTString();
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Open the given item and synchronize the tree and all
// navigational controls to the item position; 
// If qamode > 0, question is displayed, if qamode = 0, answer is displayed
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function loadItem(itemNumber, qamode){
	// Synchronize Tree...
	var itemContentPath = "content/assessment/";
	// ...determine treeFolderID and treeNodeID...
	var treeFolderID = toc[itemNumber].folderID;
	var treeNodeID = itemNumber + treeMenu.items.length - 1;
	// ...and the ItemID...(not the same as itemNumber, after resort)
	var itemID = toc[itemNumber].itemID;
	// ...open the parent folder if not already
	var cookie = getCookie(treeMenuName);
	var treeMenuExpand = cookie.split(",");
	if ((!cookie)||(treeMenuExpand[treeFolderID]<1)){	
		top.treeMenuClick(treeFolderID, false, true);
	}
	// ...mark the current item as selected
	top.treeMenuClick(treeNodeID, true, false);
	// Load item content into main frame
	if (qamode > 0){ 
		var pathAdjuster = "q/item";
	} else {
		var pathAdjuster = "a/item";
	}	
	top.main.location = itemContentPath+pathAdjuster+itemID+".html";
	// Load title info into title frame
	loadTitle(itemNumber, 1, qamode);
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Called by onLoad of q and a mcq pages to retrieve stored answers, if question page,
// populate radio button, and, if answer page, determine correctness by comparing to 
// correct response and print user and correct response together.
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

// ---------------------------------------------------------------
// Utility to trim title strings to fit on one line
function trimTitle(textToTrim, maxLength) {
	if (maxLength == null) var maxLength = 50;
	if (textToTrim.length < (maxLength + 4)){
		return textToTrim;
	} else {		
		return textToTrim.substr(0, maxLength)+"...";
	}	
}
// ---------------------------------------------------------------

// ---------------------------------------------------------------
// Called by loadItem(), this updates the title information with
// the current item information and adjusts calls from Next and
// Previous buttons to appropriate item numbers.
// ---------------------------------------------------------------
function loadTitle(chunkNumber, mode, qamode){
	// update titlebar with new item name and type
	var totalChunks = toc.length - 1;
	var titledoc = top.title.document;
	if (mode > 0) {
		var modeText = "Self-Assessment &gt; ";
		var parentText = types[toc[chunkNumber].folderID];
		var loadFunction = "loadItem";
	} else {
		var modeText = types[toc[chunkNumber].bookID] + " &gt; " 
		if (toc[chunkNumber].sectionID < toc[chunkNumber].itemID) {
			modeText = modeText + trimTitle(chapter[toc[chunkNumber].chapterID], 50 - modeText.length) + " &gt; ";
			var parentText = trimTitle(toc[toc[chunkNumber].sectionID].text);
		} else {
			var parentText = trimTitle(chapter[toc[chunkNumber].chapterID]);
		}
// Old code that bumped chapter up if showing subsection > > > > 
//		if (toc[chunkNumber].sectionID < toc[chunkNumber].itemID) {
//			modeText = modeText + chapter[toc[chunkNumber].chapterID] + " &gt; ";
//			var parentText = toc[toc[chunkNumber].sectionID].text;
//		} else {
//			var parentText = chapter[toc[chunkNumber].chapterID];
//		}
// < < < <
		var loadFunction = "loadChunk";
	}
	titledoc.clear();
	titledoc.close();
// [SS: 3.7.2002: Use qamode to determine what navbar content to load...]	
titledoc.write("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"styles/navigation.css\"><title>ACP-ASIM MKSAP 12 Update: Self-Assessment</title></head>");
titledoc.write("<body background=\"graphics/topBarBackground.gif\" leftmargin=\"0\" topmargin=\"0\" link=\"#003366\" vlink=\"#003366\" alink=\"#006699\">");
titledoc.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">");
titledoc.write("<tr><td colspan=\"2\" align=\"right\" class=\"control\" valign=\"top\" height=\"17\">");
titledoc.write("<img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">\n");
titledoc.write("<a href=\"javascript:top.openSearchPopup('searchPage.html');\" onMouseOver=\"status='Search the Update'; return true;\" onMouseOut=\"status=''; return true;\">Search</a> <img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">\n");
titledoc.write("<a href=\"index.html\" target=\"_top\" onMouseOver=\"status='Return to the main menu'; return true;\" onMouseOut=\"status=\''; return true;\">Main Menu</a> <img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">\n");
titledoc.write("<a href=\"saindex.html\" target=\"_top\" onMouseOver=\"status='View Self-Assessment (questions)'; return true;\" onMouseOut=\"status=''; return true;\">Self-Assessment</a> <img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">\n");
titledoc.write("<a href=\"NLV/index.htm\" target=\"_blank\" onMouseOver=\"status='Open normal lab values table'; return true;\" onMouseOut=\"status=''; return true;\">Lab Values</a> <img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">");
titledoc.write("<a href=\"help.html\" target=\"_blank\" onMouseOver=\"status='Open help documentation'; return true;\" onMouseOut=\"status=''; return true;\">Help</a> <img src=\"graphics/greenspacer.gif\" width=\"14\" height=\"17\" alt=\"\" border=\"0\" align=\"middle\">\n");
titledoc.write("<a href=\"javascript:top.close();\" onMouseOver=\"status='Exit MKSAP 12 Update'; return true;\" onMouseOut=\"status=''; return true;\">Exit</a>&nbsp;&nbsp;&nbsp;");
titledoc.write("</td></tr>");
// titledoc.write("</td></tr></table>");
// 	titledoc.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">");

	titledoc.write("<tr><td width=\"340\" align=\"left\"><span class=\"narrowText\">"+modeText+"</span><br><span class=\"boldText\">"+parentText+"</span></td>\n");
	titledoc.write("<td class=\"control\" align=\"right\">\n");
	if (chunkNumber > 1){
		var previousChunk = chunkNumber-1;
		titledoc.write("<a class=\"mainbar\" href=\"javascript:top."+loadFunction+"("+previousChunk+",1);\" onMouseOver=\"status='Go to previous'; return true;\" onMouseOut=\"status=''; return true;\">");
	}
	titledoc.write("<img src=\"graphics/arrowLeft.gif\" width=10 height=11 border=\"0\" align=\"middle\">&nbsp;<b>Previous</b>&nbsp;");
	if (chunkNumber > 1){
		titledoc.write("</a>");
	}
	titledoc.write("<img src=\"graphics/filler.gif\" width=6 height=10 border=\"0\">\n");
	if (chunkNumber < totalChunks){
		var nextChunk = chunkNumber+1
		titledoc.write("<a class=\"mainbar\" href=\"javascript:top."+loadFunction+"("+nextChunk+",1);\" onMouseOver=\"status='Go to next'; return true;\" onMouseOut=\"status=''; return true;\">");
	}
	titledoc.write("&nbsp;<b>Next</b>&nbsp;<img src=\"graphics/arrowRight.gif\" width=10 height=11 border=\"0\" align=\"middle\">");
	if (chunkNumber < totalChunks){
		titledoc.write("</a>");
	}
	titledoc.write("<img src=\"graphics/filler.gif\" width=16 height=10 border=\"0\"><nobr><a class=\"mainbar\" href=\"javascript:top.printMain();\" onMouseOver=\"status='Print'; return true;\" onMouseOut=\"status=''; return true;\">Print</a></nobr>&nbsp;&nbsp;&nbsp;</td></tr>\n");
	titledoc.write("<tr><td width=\"340\" align=\"left\""+(mode==0 ? " colspan=\"2\" " : "")+"><span class=\"subtleLabel\"><b>"+toc[chunkNumber].text+"</b>");
	if (mode > 0){
		titledoc.write("("+toc[chunkNumber].locality+")");
	}
	 titledoc.write("</span></td>");

	if (mode > 0){
		outputSABar(chunkNumber, qamode, titledoc);
	} else {
	}
	
	titledoc.write("</tr></table></body></html>");
	titledoc.close();
}

// ---------------------------------------------------------------
// Called by loadTitle when in SA mode, writes the MCQ functionality bar
// ---------------------------------------------------------------
function outputSABar(chunkNumber, qamode, titledoc) {
	var toggledMode = 1 - qamode;
	if (toggledMode > 0) {
		var toggledModeText = "Question";
	} else {
		var toggledModeText = "Answer";
	}
	titledoc.write("<td class=\"control\" align=\"right\"><img src=\"graphics/orangeSpacer.gif\" width=12 height=15 border=\"0\" align=\"middle\"><a class=\"forMac\" href=\"javascript:top.loadItem("+chunkNumber+","+toggledMode+")\" onMouseOver=\"status='View "+toggledModeText+"'; return true;\" onMouseOut=\"status=''; return true;\">"+toggledModeText+"</a>");
	titledoc.write("<img src=\"graphics/orangeSpacer.gif\" width=12 height=15 border=\"0\" align=\"middle\">\n");
	titledoc.write("<a class=\"forMac\" href=\"javascript:top.testStatus();\" onMouseOver=\"status='Check test score, submit for CME'; return true;\" onMouseOut=\"status=''; return true;\">Test Status (CME)</a>&nbsp;&nbsp;</td>");
	return;
}

// ---------------------------------------------------------------
// Called by the generated titlebar, this prints the main frame
// of the application
// ---------------------------------------------------------------
function printMain() {
	if (!oldIE){
		top.main.focus();
		top.main.print();
	} else {
		showNotAvailable();
	}
}

// ---------------------------------------------------------------
// Print the CME page
// ---------------------------------------------------------------
function printCME() {
	if (!oldIE) {
		window.print();
	} else {
		showNotAvailable();
	}	
}

// ---------------------------------------------------------------
// Display pop-up that explains that an upgrade is necessary
// for this feature
// ---------------------------------------------------------------
function showNotAvailable() {
	// alert("This feature is only supported by <nobr>Netscape 4.x+</nobr> and <nobr>Internet Explorer 5+.</nobr>  To upgrade your Internet Explorer browser, visit http://www.microsoft.com");
	noprntwin = window.open("","noPrint","top=100,left=100,width=450,height=150,scrollbars=no,resizable=no");
	noprntwin.opener = self;
	noprntwin.document.write("<html><title>Feature Not Available</title><body bgcolor=\"#eeeeee\" onBlur=\"javascript:setTimeout('this.close();',1500);\">");
	noprntwin.document.write("<font face='Arial, Helvetica' size=2>This feature is only supported by <nobr>Netscape 4.x+</nobr> and <nobr>Internet Explorer 5+.</nobr>  To print, click your right mouse button over the content you wish to print and select <b>Print</b> from the resulting menu.<p>[ <a href=\"javascript:this.close();\">Close this window</a> ]");
	noprntwin.document.write("</font></body></html>");
	noprntwin.document.close();
	noprntwin.focus();
}		

// ---------------------------------------------------------------
// Item Object Constructor
// ---------------------------------------------------------------
function saItem(name, folderID, locality, itemID, answerNumber){
	this.text = name;
	this.folderID = folderID;
	this.locality = locality;
	this.itemID = itemID;
	this.answerNumber = answerNumber;
	return this;												
}

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//      C o r e    S y l l a b u s    I n t e g r a t i o n   M o d e
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// These methods provide features for integration of core syllabus to Update, though
// the core features are embedded in the .js library of the core product
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// Load the navigation bar at the top of the content pages.
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
function loadNavigationBanner(itemID){
	document.write("<img src=\"../../graphics/smallBanner.gif\" height=\"22\" width=\"173\" alt=\"MKSAP 12 Update\"><div class=\"rightAlign\"><a href=\"javascript:history.back();\"><img src=\"../../graphics/back.gif\" width=\"38\" height=\"19\" border=\"0\" alt=\"Back\" /></a> <a href=\"javascript:this.print();\"><img src=\"../../graphics/print.gif\" width=\"38\" height=\"19\" alt=\"Print the contents of this window\" border=\"0\"></a> <a href=\"javascript:this.close();\"><img src=\"../../graphics/closeWindow.gif\" width=\"84\" height=\"19\" alt=\"Close this window\" border=\"0\"></a></div>\n");
}