function processMousemove(e) {return (!mouseDown);}function processClick(e) {if (browserType == "NV4") {if (e.which != 1) { return false;} else { clickY = e.screenY;clickY2 = e.pageY;mouseDown = (e.type == "mousedown");return true;}} else { if(!e) {e = window.event;}if (e.button == 2) {alert("Right click is disabled.");e.cancelBubble = true;e.returnValue = false;return false;} else {clickY = e.screenY;clickY2 = e.y;return true;}}}function disableEvent(e) {if (browserType == "NV4") {return false;} else { if(!e) {e = window.event;}return IECancelEvent(e);}}function IECancelEvent(e) {e.cancelBubble = true;e.returnValue = false;return false;}function resetEvents() {if (browserType == "NV4") {window.onmousedown=processClick;window.onmouseup=processClick;window.onmousemove=processMousemove;} else {document.onmousedown=processClick;document.onmouseup=processClick;}}function stopClock (){if(timerRunning) {clearTimeout(timerID);}timerRunning = false;}function startClock () {mySelect = Menu.document.timeform.timeType;stopClock();showTime();}function showTime() {var now = new Date();var timeValue = "";nowMilliseconds = now.getTime();i = mySelect.selectedIndex;switch(i) {case 0:var timeLeft =  examTime - (nowMilliseconds - startTimeValue);var timeLeftSeconds = Math.round(timeLeft / 1000);var timeLeftMinutes = Math.floor(timeLeftSeconds / 60);timeLeftSeconds -= (timeLeftMinutes * 60);timeLeftHours = Math.floor(timeLeftMinutes / 60);timeLeftMinutes -= (timeLeftHours * 60);timeValue += "" + timeLeftHours;timeValue += ((timeLeftMinutes < 10) ? ":0" : ":") + timeLeftMinutes;timeValue += ((timeLeftSeconds < 10) ? ":0" : ":") + timeLeftSeconds;break;case 1:var visitSeconds = Math.round((nowMilliseconds - sectionTimeValue) / 1000);var visitMinutes = Math.floor(visitSeconds / 60);visitSeconds -= (visitMinutes * 60);visitHours = Math.floor(visitMinutes / 60);visitMinutes -= (visitHours * 60);timeValue += "" + visitHours;timeValue += ((visitMinutes < 10) ? ":0" : ":") + visitMinutes;timeValue += ((visitSeconds < 10) ? ":0" : ":") + visitSeconds;break;case 2:var hours = now.getHours();var minutes = now.getMinutes();var seconds = now.getSeconds();milliseconds = now.getTime();timeValue += "" + ((hours >12) ? hours -12 :hours);timeValue += ((minutes < 10) ? ":0" : ":") + minutes;timeValue += ((seconds < 10) ? ":0" : ":") + seconds;timeValue += (hours >= 12) ? " p.m." : " a.m.";break;case 3:timeValue = "Clock disabled";}Menu.document.timeform.time.value = timeValue;timerID = setTimeout("showTime()",1000);timerRunning = true;}function incrementSelected() {for (i=0; i<mySelect.length; i++) {if (mySelect[i].selected) {break;}}if (i==3) {mySelect[0].selected = true;} else {mySelect[i+1].selected = true;}Questions.window.focus();}function open_values() {var options = '';checkwin = "" +typeof(values_win);if (browserType == "NV4") {options = 'height=550,width=280,screenX=1,screenY=1,resizable,scrollbars,dependent';} else { options = 'height=550,width=280,left=1,top=1,resizable,scrollbars';}if (checkwin == "undefined") {values_win=window.open ('Values-e.htm', 'Values', options);} else {if (values_win.closed) {values_win=window.open ('Values-e.htm', 'Values', options);} else {values_win.focus();}}}function open_calculator() {var winHeight = 235;var winWidth = 200;var screenHeight = screen.availHeight;var screenWidth = screen.availWidth;var clickX = screenWidth - winWidth - parseInt(5*screenWidth/100);var clickY = screenHeight - winHeight - parseInt(5*screenHeight/100);var options = 'height='+winHeight+',width='+winWidth;checkwin = "" +typeof(calc_win);if (browserType == "NV4") {options += ',screenX='+clickX+',screenY='+clickY+',dependent,alwaysRaised=1,hotkeys=0';} else { options += ',left='+clickX+',top='+clickY;}if (checkwin == "undefined") {calc_win=window.open('Opencalc-e.htm', 'Calculator', options);} else {if (calc_win.closed) {calc_win=window.open('Opencalc-e.htm', 'Calculator', options);} else {calc_win.focus();}}}function closeWindows() {checkwin = "" +typeof(Questions.imageWin);if ((checkwin != 'undefined') && (!Questions.imageWin.closed)) {Questions.imageWin.close();}checkwin = "" +typeof(calc_win);if ((checkwin != 'undefined') && (!calc_win.closed)) {calc_win.close();}checkwin = "" +typeof(values_win);if ((checkwin != 'undefined') && (!values_win.closed)) {values_win.close();}}function randomNumber() {var temp = parseInt(Math.random()*6);if (isNaN(temp)) {temp=0;}return temp;}function gotoAnchor(anchor) {Questions.location.hash = anchor;Questions.window.focus();}function statusHelp (k) {if (!Menu.document.timeform) {return false;}switch(k) {case 0:startClock();break;case 100:stopClock();Menu.document.timeform.time.value = "Switch languages";break;case 10:stopClock();Menu.document.timeform.time.value = "Jump to Case";break;default:stopClock();Menu.document.timeform.time.value = "Jump to Question " +k;}return true;}function browser_check() {var browser = '';if (navigator.appName.indexOf("Netscape") != -1) {browser = "NV";} else {browser = "IE";}if ((navigator.appVersion < "4") || (navigator.appVersion >= "5")) { return 'X'; } else {browser += "4";}if (navigator.appVersion.indexOf("Mac") != -1) {browser += 'M';}return browser;}function createMenu() {var code ='';code += '<html><head><title>Menu</title>';code += '<style type="text/css">';code += 'BODY {font-family: Arial, Helvetica, sans-serif}';code += 'A.question {font-family: Arial, Helvetica; font-weight: bold; text-decoration: none}';code += '</style>';if (browserType == "NV4") {buttonWidth = 'width=150';} else {buttonWidth = 'style="width: 150px"';code += unescape('%3Cscript language="Javascript"%3E');code += 'document.onmousedown=processClick;';code += 'document.onmouseup=processClick;';code += 'document.onselectstart=disableEvent;';code += 'function processClick() {e = window.event; parent.processClick(e);}';code += 'function disableEvent() {e = window.event; parent.disableEvent(e);}';code += unescape('%3C/script%3E');}code += '</head><body bgcolor="#FFEEDD" link="#0000FF" vlink="#0000FF" alink="#0000FF">';code += '<center><h4><font color="#800000">MCC CDM Exam</font><br><font size=+1>Case One</font></h4>';code += '<p><a href="javascript:alert(\'Not functional in this demonstration version\')" onMouseOver="parent.statusHelp(100); return true" onMouseOut="parent.statusHelp(0)">Switch to French</a>';code += '<form name="timeform" onSubmit="return false">';if (browser.substring(3,4)=='M') {code += '<input type="text" name="time" value="Time" style="text-align: center">';} else {code += '<input type="button" name="time" width=154 style="width: 154px" value="Time" onClick="parent.incrementSelected()">';}code += '<font size=-2><select name="timeType" onChange="parent.Questions.window.focus()">';code += '<option selected>Time remaining in exam<option>Time spent on section<option>Current time';code += '<option>Disable</select></font></form>';code += '<p><table width=90% border=4 bordercolor="#FFFFFF" cellpadding=5><tr align="center"><td bgcolor="#FFFFFF">';code += '<a href="Javascript: void 0" onClick="parent.gotoAnchor(\'case\'); return false" class="question" onMouseOver="parent.statusHelp(10)" onMouseOut="parent.statusHelp(0)">Case 1</a>';for (i=1; i<5; i++) {if (i<=numQuestions) {code += '<br><a href="Javascript: void 0" onClick="parent.gotoAnchor(\'q' + i + '\'); return false"';code += ' class="question" onMouseOver="parent.statusHelp(' + i + ')" OnMouseOut="parent.statusHelp(0)">Question ' + i + '</a>';} else {code += '<br>&nbsp;';}}code += '</td></tr></table>';code += '<form name="submitform">';code += '<p><nobr><input type="button" value="Normal values" ' + buttonWidth + ' onClick="parent.open_values()">';code += '<br><font size=-1>Normal </nobr>values for most common laboratory tests</font>';code += '<p><nobr><input type="button" value="Calculator" ' + buttonWidth + ' onClick="parent.open_calculator()">';code += '<br><font size=-1>Online </nobr>calculator</font>';code += '<p><table border=0 cellpadding=10 cellspacing=0><tr align=center valign=center bgcolor="#FF9999"><td>';code += '<p><font size=-1><strong>Check your answers before clicking "Submit."</strong></font>';code += '<br><input type="button" name="submitbutton" value="Submit" ' + buttonWidth + ' onClick="parent.checkSubmit()">';code += '</td></tr></table>';code += '</form></center></body></html>';return code;} function checkSubmit() {for (i=0; i<numQuestions; i++) {var n = eval('Questions.document.myform.n' + i);if (typeof(n) == 'object') {if (n.value == 0) {if (!confirm("You have not answered all the questions! \nAre you sure you want to submit Case "+caseNo+"?\nClick 'Cancel' to return to the section.")) {Questions.window.focus();return;}break;}} else {var x = eval('Questions.document.myform.x' + i + '.value');var test = eval('Questions.document.myform.q' + x  + '_1.value.length');if (test == 0) {if (!confirm("You have not answered all the questions! \nAre you sure you want to submit Case "+caseNo+"?\nClick 'Cancel' to return to the section.")) {Questions.window.focus();return;}break;}}}closeWindows();Questions.document.myform.submit();buttonwidget = Menu.document.submitform.submitbutton;if (browserType == "NV4") {window.onmousedown=disableEvent;window.onmouseup=disableEvent;buttonwidget.blur();} else {buttonwidget.disabled = true;}buttonwidget.value='Please wait';disableButtonID = setTimeout("resetDisableButton('Resubmit')", 10000);}function resetTimeout() {resetEvents();Menu.document.submitform.submit.value='Resubmit';}function reset() {startClock();Questions.window.focus();resetEvents();}function push(thisArray, newMember) {var j = thisArray.length;thisArray[j] = newMember;}function pop(thisArray) {var temp=thisArray[thisArray.length-1];thisArray.length--;return temp;}function parseQuery(query) { var query = query.toLowerCase();var pairs = new Array();pairs = query.split('&');for (i=0; i<pairs.length; i++) {var matches = unescape(pairs[i]).match(/q(\d+)_(\d+)=(.+)/);if (matches != null) {if (matches[2] == 0) {answers[matches[1]] = new Array();} else if (matches[3]=='on') {push(answers[matches[1]], matches[2]);} else {push(answers[matches[1]], matches[3]);}}}}function formatScore(score) {if ((score==1) || (score ==0)) {return score;}var str = "" + Math.round(score*100)/100; if (str.indexOf(".") == 0) {str = "0" + str;} return str;}

