///////////////////////////////////////////////////////////////////
// commonJS.js
// MIO Common Javascript Functions
//Author: kannan.Chandrasekaran
///////////////////////////////////////////////////////////////////

var popUseScrollbars=true;

///////////////////////////////////////////////////////////////////
// Danny Quiz Stuff
///////////////////////////////////////////////////////////////////
var layerVisible = false;
var daname;
var formCounter;
var clearImage = "../../common_files/images/blank_unmarked.gif";
var rightImage = "../../common_files/images/yes.gif";
var wrongImage = "../../common_files/images/no.gif";
var dannysCrazyTimeout = 0;
var dannysCrazyListoffeedback = new Array();
var switchChecksIndex=0;
var can_go_next = true;
var feedbacks = new Array(); // replacing canGoNext
var daformArray=new Array();
var hasFlashQuiz = false;
var cptFooter="CPT only &copy; Current Procedural Terminology, 2002, Professional Edition, American Medical Association. All rights reserved.";
var CPT_Footer=cptFooter; //way to be consistent, Danny.
var personalLeft=false;
var personalRight=false;
var attempt=0;
var authorName;

var defaultFeedbackWindowHeight = 300;
var defaultAnitaWindowHeight = 300;
var defaultPopupWindowHeight = 585;

// override these in the template with a full img tag
var nowrap_left_img = '';
var nowrap_right_img = '';

// array of types that bigWrapper will deal with
var bigwrapperCheckedTypes = new Array();
bigwrapperCheckedTypes['radio'] = true
bigwrapperCheckedTypes['checkbox'] = true;
bigwrapperCheckedTypes['select-one'] = true;
bigwrapperCheckedTypes['text'] = true;

var hostType;
var prodType;
var authorName;

 

//parce the URL into an array 
function getSearchAsArray() {
		var results = new Array()
		var input = unescape(location.search.substr(1))
		if (input) {

			var srchArray = input.split("&")
			var tempArray = new Array()
			for (var i = 0; i < srchArray.length; i++) {
				tempArray = srchArray[i].split("=")
				results[tempArray[0]] = tempArray[1]
			}
		}
		return results
}


// get host type function
function getHostType() {
	if (location.search) {
		var srchArray = getSearchAsArray()
		if (srchArray["hostType"]) {
			hostType = (srchArray["hostType"])
		}
	}
}

// get prod type function
function getProdType() {
	if (location.search) {
		var srchArray = getSearchAsArray()
		if (srchArray["prodType"]) {
			prodType = (srchArray["prodType"])
		}
	}
}

//get author Name function
function getAuthorName() {
	
	if (location.search) {
		var srchArray = getSearchAsArray()
		if (srchArray["authorName"]) {
			authorName = (srchArray["authorName"])
			
		}
	}
}
getHostType();
getProdType();
getAuthorName();
var tail="hostType="+hostType+"&"+"authorName="+authorName+"&"+"prodType="+prodType


/*function maketrue()
{
	can_go_next=true;
	alert("This was set to " + can_go_next);
	feedbacks.length=0;
}*/
// function to be called onClick in "next" link
//  eg. <a href='next.html' onClick="return(checkGoNext)">
/*function checkGotoNext()
{
	if(! can_go_next || can_go_next == "false")
	{
		var text = "Are you sure that you want to continue";
		if(hasFlashQuiz)
		{
			// flash question (no forms)
			text += " without completing this block?";
		}
		else if(document.forms && document.forms.length == 1)
		{
			// one question (one form)
			text += " without answering this question?";
		}else if(document.forms && document.forms.length > 1)
		{
			// more than one question (more than one form)
			text += " without answering these questions?";
		}
		else
		{
			// unknown type (maybe someone just wants to confirm?)
			text += "?";
		}
		can_go_next = confirm(text);
	}
	return can_go_next;
}*/

function checkGoNext(){
	
	if(! can_go_next || can_go_next == "false")
	{
		var text = "Are you sure that you want to continue";
/*		if(hasFlashQuiz)
		{
			// flash question (no forms)
			text += " without completing this block?";
		}else */
		
		if(document.forms.length!=0 && parseInt(document.frmquest.NoOfQuest.value)<=1){
			// one question (one form)
			text += " without answering this question?";
		}else if(document.forms.length!=0 && parseInt(document.frmquest.NoOfQuest.value)>1){
			// more than one question (more than one form)
			text += " without answering these questions?";
		}
		else if(document.forms.length==0){
			// more than one question (more than one form)
			text += " without answering this question?";
		}else{
			// unknown type (maybe someone just wants to confirm?)
			text += "?";
		}
		can_go_next = confirm(text);
	}	
	return can_go_next;
}
/*function checkGoNext(){
//Commented for temp	
	if(feedbacks && feedbacks.length){ // check for presense of "feedbacks" array?
		can_go_next = true;
		for(var i=0; i<feedbacks.length; i++){
			var daObj = eval(feedbacks[i]);
			can_go_next = can_go_next && daObj.respondedTo;
		}
	}
	if(! can_go_next || can_go_next == "false")
	{
		var text = "Are you sure that you want to continue";
		if(hasFlashQuiz)
		{
			// flash question (no forms)
			text += " without completing this block?";
		}else if(document.forms && document.forms.length == 1){
			// one question (one form)
			text += " without answering this question?";
		}else if(document.forms && document.forms.length > 1){
			// more than one question (more than one form)
			text += " without answering these questions?";
		}else{
			// unknown type (maybe someone just wants to confirm?)
			text += "?";
		}
		can_go_next = confirm(text);
	}
	alert(can_go_next);
	return can_go_next;
}*/


function writeChecks(whichBullet)
{
document.write('<a href="javascript:switchChecks(\''+whichBullet+'\');"><img name="'+whichBullet+'" border="0" src="../../common_files/images/checklist_checkbox.gif" width="29" height="20"></a>');
}

function feedbackHolder(){
    this.usage = 
	  'var feedback = new feedbackHolder()' + '\n' +
      'feedback.add("elemName", "feedback string", "window height")' + '\n' +
      'feedback.add("elemName", "feedback url")';
	this.goodUrl = false;
	this.badUrl = false;
	this.stuffAdded = false;
	this.respondedTo = false; // set to true on respond for checkGoNext() to work
	this.respond = _respond;
	this.add = _feedback_add;
	this.feedbackArray = new Array();
	if(arguments.length){
		alert("error in feedbackHolder creation:\n" + this.usage);
		return false;
	}
	return this;
}

// internal respond function
//  sets respondedTo to true if called without args, or sets it to whatever
//  the arg is if called with an arg.  Returns new value of respondedTo
function _respond(){
	if(arguments.length == 0){
		this.respondedTo = true;
	}else{
		this.respondedTo = arguments[0];
	}
	return(this.respondedTo);
}

// internal add_feedback function
// args:
//  URL - url to redirect to
// OR
//  feedbackString - string to put in popup window
//  windowHeight - integer height of popup window
function _feedback_add(){
	var newfeedback = false;
	if(arguments.length == 2){
		newfeedback = new _url_feedbackObj(arguments[1]);
	}else if(arguments.length == 3){
		newfeedback = new _window_feedbackObj(arguments[1], arguments[2]);
	}
	this.feedbackArray[arguments[0]] = newfeedback;
	this.stuffAdded = true;
}

// new popup feedback object
// args:
//  feedback - string representation of feedback text
//  windowHeight - integer height of feedback window
function _window_feedbackObj(){
	this.isURL = false;
	this.URL = '';
	this.feedback = arguments[0];
	this.windowHeight = arguments[1];
	this.delay = 1000;
	this.showGood = popCorrect;
	this.showGood = delayPopCorrect;
	this.showBad = popWrong;
	this.showBad = delayPopWrong;
	return this;
}

// new redirect feedback object
// args:
//  URL - URL to redirect to
function _url_feedbackObj(){
	this.isURL = true;
	this.URL = arguments[0];
	this.feedback = '';
	this.windowHeight = 0;
	this.delay = 1000;
	//this.showGood = gotoPage;
	this.showGood = delayGotoPage;
	//this.showBad = gotoPage;
	this.showBad = delayGotoPage;
	return this;
}

// delayed good feedback
function delayGood(){
	clearTimeout(dannysCrazyTimeout);
	//dannysCrazyTimeout = setTimeout(this.goodFunk, this.goodDelayTime);
	//dannysCrazyTimeout = setTimeout("this.goodFunk()", this.goodDelayTime);
	window.tempFeedbackObj = this;
	dannysCrazyTimeout = setTimeout("tempFeedbackObj.goodFunk()", this.goodDelayTime);
}
// delayed bad feedback
function delayBad(){
	clearTimeout(dannysCrazyTimeout);
//	dannysCrazyTimeout = setTimeout(this.badFunk, this.badDelayTime);
	window.tempFeedbackObj = this;
	dannysCrazyTimeout = setTimeout("tempFeedbackObj.badFunk()", this.badDelayTime);
}

// onClick check function
function clickCheckthis(daForm){
clearTimeout(dannysCrazyTimeout);

if (daForm.name!=daname)
{
	formCounter++;
	attempt=0;
	
	
}
 daname=daForm.name;
attempt+=1;



var feedbackName;
var checked = new Array();

	if(eval("window." + daForm.name + "Feedback"))
	{
		var feedbackObj = eval(daForm.name + "Feedback");
		feedbackObj.respond();
	}

	
	for(var i=0; i < daForm.elements.length; i++)
	{
		var daElem = daForm.elements[i];
		if (daElem.checked==true && daElem.value==0 )
		{
			
			feedbackName=daElem.name+"-"+daElem.value;
			clearImages(daForm);
			var daImage = getImage(feedbackName);
			daImage.src = rightImage;
			if(feedbackObj.feedbackArray[feedbackName])
				{
					feedbackObj.feedbackArray[feedbackName].showGood();
					can_go_next = true;

					return false;
				}
		
		}
		else if ((daElem.checked==true) && daElem.value>0 && attempt<2 )
		{
			feedbackName=daElem.name+"-"+daElem.value;
			clearImages(daForm);
			var daImage = getImage(feedbackName);
			daImage.src = wrongImage;
			if(feedbackObj.feedbackArray[feedbackName])
				{
				feedbackObj.feedbackArray[feedbackName].showBad();
				can_go_next = true;

				return false;
				}
		}
		else if ((daElem.checked==true) && daElem.value>0 && (attempt==2) )
		{
			feedbackName=daElem.name+"-"+daElem.value;
			clearImages(daForm);
			var daImage = getImage(feedbackName);
			daImage.src = wrongImage;
			if(feedbackObj.feedbackArray[feedbackName])
				{
				feedbackObj.feedbackArray['final'].showBad();
				can_go_next = true;
				return false;
				}
		
		}
	else if((daElem.checked==true) && (attempt>2))
			{
				
				alert("Two attempts are over. Press Reset to try again.")
			}
	}
}

function reset_Page()
	{
		attempt=0;
	}




function dropSubmit(daForm)
{

	if (daForm.name!=daname)
	{
		formCounter++;
		attempt=0;
	}

	daname=daForm.name;
	attempt+=1;

	var daElem = daForm.elements[0]
	
	if(eval("window." + daForm.name + "Feedback"))
		{//if
			var feedbackObj = eval(daForm.name + "Feedback");
			feedbackObj.respond();
		}
	feedbackName=daElem.name+"-"+daElem.value;
		if (daElem.value==0)
			{
				
				if(feedbackObj.feedbackArray[feedbackName])
					{
						var daImage = getImage(daElem.name+"-yn");
						daImage.src = rightImage;
						feedbackObj.feedbackArray[feedbackName].showGood();
						return false;
					}
			}
		else if (daElem.value!=0 && attempt>=2 )
			{
				if(feedbackObj.feedbackArray[feedbackName])
					{
						var daImage = getImage(daElem.name+"-yn");
						daImage.src = wrongImage;
						feedbackObj.feedbackArray['final'].showBad();
						return false;
					}

			}
		else
			{
				if(feedbackObj.feedbackArray[feedbackName])
					{
						var daImage = getImage(daElem.name+"-yn");
						daImage.src = wrongImage;
						feedbackObj.feedbackArray[feedbackName].showBad();
						return false;
					}
	}
	
}

function clearImages1(daForm)
{
		var daElem = daForm.elements[0]
		var daImage = getImage(daElem.name+"-yn");
		daImage.src = "../../common_files/images/blank_unmarked.gif";
}


function clickCheck(daElem){
	clearTimeout(dannysCrazyTimeout);
	var daForm = daElem.form;
	if(eval("window." + daForm.name + "Feedback")){
		var feedbackObj = eval(daForm.name + "Feedback");
		feedbackObj.respond();
	}else{
		alert("Please define the feedback object for form "+ daForm.name +".");
		return false;
	}
	
	var feedbackName = daElem.name;
	if(daElem.type == 'radio'){
		feedbackName = daElem.name + '-' + daElem.value;
	}
	
	var rval = false;
	clearImages(daForm);
	can_go_next = true;
	var daImage = getImage(feedbackName);
	if(daElem.value == 0){
		// 0 = right
		daImage.src = rightImage;
		if(feedbackObj.feedbackArray[feedbackName]){
			feedbackObj.feedbackArray[feedbackName].showGood();
		}
		rval = true;
	}else{
		// non-zero = wrong
		daImage.src = wrongImage;
		if(feedbackObj.feedbackArray[feedbackName]){
			feedbackObj.feedbackArray[feedbackName].showBad();
		}
	}
	return rval;
}

function clickCheck1(daElem){//start overall
	attempt+=1;
	clearTimeout(dannysCrazyTimeout);
	var daForm = daElem.form;
	if(eval("window." + daForm.name + "Feedback")){//if
		var feedbackObj = eval(daForm.name + "Feedback");
		feedbackObj.respond();

	}//close of if
	else{//else
		alert("Please define the feedback object for form "+ daForm.name +".");
		return false;
	}//close of else
	
	var feedbackName = daElem.name;
	if(daElem.type == 'radio'){//if
		feedbackName = daElem.name + '-' + daElem.value;
		//alert(feedbackName);
	}//close of if
	
	var rval = false;
	clearImages(daForm);
	can_go_next = true;
	var daImage = getImage(feedbackName);
	if(daElem.value == 0){//if
		// 0 = right
		daImage.src = rightImage;
		if(feedbackObj.feedbackArray[feedbackName]){//if
			feedbackObj.feedbackArray[feedbackName].showGood();
		}//close of if
		rval = true;
		return false;
	}//close of if
	else if(daElem.value != 1 && attempt==2)
		{
			
		// non-zero = wrong
		daImage.src = wrongImage;
		if(feedbackObj.feedbackArray[feedbackName]){
			feedbackObj.feedbackArray['final'].showBad();
			return false;
		}
		}
	else{//else
		// non-zero = wrong
		daImage.src = wrongImage;
		if(feedbackObj.feedbackArray[feedbackName]){//if
			feedbackObj.feedbackArray[feedbackName].showBad();
			
		}//close of if
	}//close of else
	return rval;
}//overall

function submitCheck(daForm){
	var checked = new Array();
	for(var i=0; i < daForm.elements.length; i++){
		var daElem = daForm.elements[i];
		if(daElem.type && !checked[daElem.type]){
			switch (daElem.type){
				case 'radio':
					checkRadio(daForm, false);
					break;
				case 'checkbox':
					checkCheck(daForm, false);
					break;
				default:
					break;
			}
		}
	}
}

function CheckBox(daForm)
{
	
	if (daForm.name!=daname)
	{
		formCounter++;
		attempt=0;
	}
	
	daname=daForm.name;
	attempt+=1;
		clearImages(daForm);
	//alert(daForm.name);
	var answer=0;
	//alert(daForm.elements.length);
	var feedbackObj = eval(daForm.name + "Feedback");
		feedbackObj.respond();
	for (var i=1;i<daForm.elements.length;i++)
	{
		
			var daElem = daForm.elements[i];
			//alert(daElem.name);
			if (daElem.checked==true)
			{
				if (daElem.value==0)
					{
						var daImage = getImage(daElem.name);
						daImage.src = rightImage;
						answer++;
						
						//if(feedbackObj.feedbackArray[1])
						{
//							feedbackObj.feedbackArray[daElem.name].showbad();
						}
						
					}
				else
					{
						var daImage = getImage(daElem.name);
						daImage.src = wrongImage;				
						
						answer=eval(answer)-1;
					}
			}
			else
			{
			}
				
	}
	if (answer==daForm.elements[0].value)
	{
		
		
		feedbackObj.feedbackArray['Correct'].showGood();
	}
	else if (answer<daForm.elements[0].value && attempt==1)
	{
			//if(feedbackObj.feedbackArray['fstinc']){//if
			feedbackObj.feedbackArray['fstinc'].showBad();
			
			
		//}
	}
	
	else if (answer<daForm.elements[0].value && attempt>1)
	{
			//if(feedbackObj.feedbackArray['SecondInCorrect']){//if
			feedbackObj.feedbackArray['SecondInCorrect'].showBad();
		//}
	}
}
// wraps any "check" function that returns true if all right
//  and false if any wrong.  checkCheck, checkRadio, etc...
//  the function must accept the form name as the first arg
//  and true/false as a second arg (to alert on error)
// form follows function. :)
// daFunction can be an array of functions to apply multiple tests
//  whose results are ANDed together.  This should be an array of
//  functions - not string representations of function names...
// update: can be called with one arg - a form name
//  this requires that a check function be defined either as a
//  variable (form1 would require a variable called form1Checks)
//  that can be either a single function (form1Checks=checkRadio)
//  or an array of functions (form1Checks=new Array(checkRadio, checkCheck))
// updateAgain:
//  now works with object-oriented feedback by taking the first
//  correct element and the first incorrect element in the form
//  and using their feedback for allright and allwrong, respectively.
// further update:
//  now works with forms that have either all correct or all incorrect
function bigWrapper(daFunction, daForm){
	clearTimeout(dannysCrazyTimeout);
	if(arguments.length == 1){
		daForm = arguments[0];
		if(eval("window." + daForm.name + "Checks")){
			daFunction = eval(daForm.name + "Checks");
		}else{
			//alert(form2Checks);
			alert('bad call to bigWrapper - define ' + daForm.name + 'Checks');
		}
	}
	var correctName = "correct" + daForm.name;
	var wrongName = "wrong" + daForm.name;
	if(typeof(daFunction) == 'function'){
		var allRight = daFunction(daForm, false);
	}else{
		var allRight = daFunction[0](daForm, false);
		for(var i=1; i<daFunction.length; i++){
			allRight = daFunction[i](daForm, false) ? allRight : false;
			// apperently, this next way doesn't work.  Sigh.
			// allRight = (allRight && daFunction[i](daForm, false));
		}
	}
	if(eval("window." + daForm.name + "Feedback")){
		var feedback = eval(daForm.name + "Feedback");
		feedback.respond();
	}else{
		alert("you forgot to define the feedback object for form " + daForm.name + ".");
	}

	if(feedback.stuffAdded){
		// new style feedback
		// find the first correct and first incorrect feedback objects
		var firstCorrect = false;
		var firstIncorrect = false;
		var elemType = false;
		for(var i=0; i<daForm.elements.length; i++)
		{
			var daElem = daForm.elements[i];
			if(bigwrapperCheckedTypes[daElem.type]){
				var daVal = daElem.value;
				elemType = daElem.type;
				if(!firstCorrect && daVal == 0){
					firstCorrect = daElem.name;
					if(daElem.type == 'radio'){
						firstCorrect = daElem.name + '-' + daElem.value;
					}
				}else if(!firstIncorrect && daVal != 0){
					firstIncorrect = daElem.name;
					if(daElem.type == 'radio'){
						firstIncorrect = daElem.name + '-' + daElem.value;
					}
				}
			}
			if(firstCorrect && firstIncorrect){
				i=daForm.elements.length; // I distrust "break"... :)
			}
		}
		// use daForm.name in case there are no incorrect / no correct
		if(!firstCorrect){
			firstCorrect = daForm.name;
		}
		if(!firstIncorrect){
			firstIncorrect = daForm.name;
		}
		// do something with getSelected to show feedback for the
		//  currently selected object if the element types are "radio" or
		//  "select-one"
		// do something even more different if the object is type text...
		if(allRight && feedback.feedbackArray[firstCorrect]){
				feedback.feedbackArray[firstCorrect].showGood();
		}else if(feedback.feedbackArray[firstIncorrect]){
				feedback.feedbackArray[firstIncorrect].showBad();
		}
	}else{
		// old style feedback
		if(allRight){
			if(feedback.goodUrl){
				gotoPage(feedback.good);
			}else{
				popCorrect(feedback.good);
			}
		}else{
			if(feedback.badUrl){
				gotoPage(feedback.bad);
			}else{
				popWrong(feedback.bad);
			}
		}
	}

	return allRight;
}





function bigWrapper1(daFunction, daForm){
	
	clearTimeout(dannysCrazyTimeout);
	if(arguments.length == 1){
		daForm = arguments[0];
		if(eval("window." + daForm.name + "Checks")){
			daFunction = eval(daForm.name + "Checks");
		}else{
			
			alert('bad call to bigWrapper - define ' + daForm.name + 'Checks');
		}
	}
	var correctName = "correct" + daForm.name;
	var wrongName = "wrong" + daForm.name;
	alert(wrongName);
	if(typeof(daFunction) == 'function'){
		var allRight = daFunction(daForm, false);
	}else{
		var allRight = daFunction[0](daForm, false);
		for(var i=1; i<daFunction.length; i++){
			allRight = daFunction[i](daForm, false) ? allRight : false;
			// apperently, this next way doesn't work.  Sigh.
			// allRight = (allRight && daFunction[i](daForm, false));
		}
	}
	if(eval("window." + daForm.name + "Feedback")){
		var feedback = eval(daForm.name + "Feedback");
		feedback.respond();
	}else{
		alert("you forgot to define the feedback object for form " + daForm.name + ".");
	}

	if(feedback.stuffAdded){
		// new style feedback
		// find the first correct and first incorrect feedback objects
		var firstCorrect = false;
		var firstIncorrect = false;
		var elemType = false;
		for(var i=0; i<daForm.elements.length; i++)
		{
			var daElem = daForm.elements[i];
			if(bigwrapperCheckedTypes[daElem.type]){
				var daVal = daElem.value;
				elemType = daElem.type;
				if(!firstCorrect && daVal == 0){
					firstCorrect = daElem.name;
					if(daElem.type == 'radio'){
						firstCorrect = daElem.name + '-' + daElem.value;
					}
				}else if(!firstIncorrect && daVal != 0){
					firstIncorrect = daElem.name;
					if(daElem.type == 'radio'){
						firstIncorrect = daElem.name + '-' + daElem.value;
					}
				}
			}
			if(firstCorrect && firstIncorrect){
				i=daForm.elements.length; // I distrust "break"... :)
			}
		}
		// use daForm.name in case there are no incorrect / no correct
		if(!firstCorrect){
			firstCorrect = daForm.name;
		}
		if(!firstIncorrect){
			firstIncorrect = daForm.name;
		}
		// do something with getSelected to show feedback for the
		//  currently selected object if the element types are "radio" or
		//  "select-one"
		// do something even more different if the object is type text...
		if(allRight && feedback.feedbackArray[firstCorrect]){
				feedback.feedbackArray[firstCorrect].showGood();
		}else if(feedback.feedbackArray[firstIncorrect]){
				feedback.feedbackArray[firstIncorrect].showBad();
		}
	}else{
		// old style feedback
		if(allRight){
			if(feedback.goodUrl){
				gotoPage(feedback.good);
			}else{
				popCorrect(feedback.good);
			}
		}else{
			if(feedback.badUrl){
				gotoPage(feedback.bad);
			}else{
				popWrong(feedback.bad);
			}
		}
	}

	return allRight;
}






function switchChecks(whichBullet)
{	
	var offImage="../../common_files/images/checklist_checkbox.gif";
	var onImage="../../common_files/images/checklist_checkbox_mo.gif";
	var currentImage=getTheImage(whichBullet).src; 
	if(currentImage.match("mo.gif"))
	{
		MM_swapImage(whichBullet,'',offImage,1);
		switchChecksIndex--;	
	}
	else
	{
		MM_swapImage(whichBullet,'',onImage,1);
		switchChecksIndex++;	
	}
	if(switchChecksIndex==switchChecksTotal)
	{
		gotoPage(switchChecksNextPage);
	}
	
}

// returns an image object with the given name
function getTheImage(daName){
	return eval("document.images['" + daName + "']");
}

function setLayerVisible(yup)
{
		layerVisible=yup;
}
function myopenWindow(path)
{
	//alert(path);
//	path="../../common_files/cmao_chapter_review_frameset.html?"+path;
	var newpath="../../../../common_files/cmao_chapter_review_frameset.html?"+path;
	screenWidth=screen.width;
	screenHeight=screen.height;
	alert(newpath);
		
	windowLeft=(screenWidth-650)/2;
	windowTop=(screenHeight-500)/2;
	popSimplified('../../../../common_files/cmao_chapter_review_frameset.html?M01L01S03.html','howHigh','howWide')
//	window.open("../../common_files/cmao_chapter_review_frameset.html?M01L01S03.html",'newWin','width=650','height=500',scrollbars=yes,toolbar=no,location=no,resizable=no);
//	biggerWindow = window.open('../../common_files/cmao_chapter_review_frameset.html?M01L01S03.html','newWin','width=650, height=500, left='+windowLeft+',top='+windowTop+', scrollbars=yes,toolbar=no,location=no,resizable=no');
	//biggerWindow.focus();
}
function openWindowBigger(thisPage)
{        
	
	screenWidth=screen.width;
	screenHeight=screen.height;
		
	windowLeft=(screenWidth-650)/2;
	windowTop=(screenHeight-500)/2;
	biggerWindow = window.open(thisPage,'newWin','width=650, height=500, left='+windowLeft+',top='+windowTop+', scrollbars=yes,toolbar=no,location=no,resizable=no');
	biggerWindow.focus();
}

function openWindow(thisPage, howHigh)
{
	if(!howHigh)
	{
		howHigh = 400; //default
	}
	newTom2 = window.open(thisPage,'newTom2','width=620,height='+howHigh+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
	newTom2.focus();
}

function openPages(whichStep,tail) //not actual step number, just the index of this one for this phase.
{

	var fiber="lesson"+whichStep+"_pages.html?"+tail;
	
	screenWidth=screen.width;
	screenHeight=screen.height;
		
	windowLeft=(screenWidth-400)/2;
	windowTop=(screenHeight-300)/2;

	horkinFiberChunks = window.open(fiber,'horkinFiberChunks','width=400,height=300,left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
	horkinFiberChunks.focus();
}

function moduleoutline(page) //not actual step number, just the index of this one for this phase.
{
//tail="hostType="+hostType+"&"+"authorName="+authorName+"&"+"prodType="+prodType

	var fiber=page+"?"+tail;
	
	document.location.href=fiber;
	
}

//function openPages(whichPhase, whichStep) //not actual step number, just the index of this one for this phase.
//{
//var fiber="pages_phs"+whichPhase+".html";
//if(arguments.length > 1){
//	fiber="pages_phs"+whichPhase+"_step"+whichStep+".html";
//}
//horkinFiberChunks =
//window.open(fiber,'horkinFiberChunks','width=400,height=300,scrollbars=yes,toolbar=no,location=no,resizable=yes');
//horkinFiberChunks.focus();
//}

function openWord(thisPage)
{
	newTom3 = window.open(thisPage,'newWin2','width=405,height=300,scrollbars=yes,toolbar=no,location=no,resizable=no');
	newTom3.focus();
}

function delayGotoPage(thisPage){
	clearTimeout(dannysCrazyTimeout);
	dannysCrazyTimeout = setTimeout("gotoPage('"+this.URL+"')", this.delay);
}

function gotoPage(thisPage)
{
	thisPage=thisPage+"?"+tail;
	if(arguments.length == 0){
		// method call
		window.location = this.URL;
	}else{
		// regular call
		window.location = thisPage;
	}
    //this.respond();
}

// wide (585px) popup window with text
function popWideWindow(displayText, howHigh){
	return popWindow(displayText, howHigh, 585);
}

function popClinic()
{
	screenWidth=screen.width;
	screenHeight=screen.height;
	
	windowLeft=(screenWidth-600)/2;
	windowTop=(screenHeight-500)/2;
	
	largeClinic = window.open("../../common_files/floorplan.html",'largeClinic','width=600,height=575,left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');		
	largeClinic.focus();
}

function popLifecycle(whichOne) //will probably have to change
{
	if(!whichOne)
	{
		largeCycle = window.open("lifecycle.html",'largeCycle','width=600,height=599,scrollbars=yes,toolbar=no,location=no,resizable=yes');		
	}
	else
	{
		whichOne=whichOne.toLowerCase();
		whichOne=whichOne+".html";
		largeCycle = window.open(whichOne,'largeCycle','width=600,height=599,scrollbars=yes,toolbar=no,location=no,resizable=yes');			
	}
	largeCycle.focus();
}

function popGlossary(whichFile)
{
	screenWidth=screen.width;
	screenHeight=screen.height;
	
	if(!whichFile) //no word, display all.			
	{		
		windowLeft=(screenWidth-600)/2;
		windowTop=(screenHeight-400)/2;
		largeGlossary = window.open("../../common_files/macrogloss/mio_glossary.html?"+tail,'largeGlossary','width=600,height=400,left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');		
		largeGlossary.focus();
	}
	else
	{
		howWide=380;
		whichFile = whichFile.replace(/ /g, '_');
		//display "whichFile" file
		glossary_file="../../common_files/mio_glossary/"+whichFile+".html?"+tail;
		
		windowLeft=(screenWidth-400)/2;
		windowTop=(screenHeight-400)/2;
		smallGlossary=window.open(glossary_file,'smallGlossary','width=397,height=400,left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');		
		smallGlossary.focus();
	}	 	
}
// method call only - PITA to make work both ways :(
function delayPopCorrect(){
	clearTimeout(dannysCrazyTimeout);
	dannysCrazyTimeout = setTimeout("popCorrect('"+
	                     this.feedback.replace(/'/g, "\\'")+
						 "', " + this.windowHeight + 
						 ", " + this.delay + 
						 ")", this.delay);
}

// method call only - PITA to make work both ways :(
function delayPopWrong(){
	clearTimeout(dannysCrazyTimeout);
	dannysCrazyTimeout = setTimeout("popWrong('"+
	                     this.feedback.replace(/'/g, "\\'")+
						 "', " + this.windowHeight + 
						 ", " + this.delay + 
						 ")", this.delay);
}
function maketrue()
{
		can_go_next=true;
		//alert("This was set to " + can_go_next);
		feedbacks.length=0;

}
function popCorrect(displayText,howHigh) //anita's advice
{
	//can_go_next=true;
	var delay = 0;
	var cScript1='/';
	if(arguments.length == 0){
		// method call
		var howHigh = this.windowHeight;
		var displayText = this.feedback;
		delay = this.delay;
	}
	if(arguments.length < 3){
		delay = arguments[2];
	}
	if(!howHigh){
		// called w/ one arg
		var howHigh = defaultFeedbackWindowHeight;
	}
	
	screenWidth=screen.width;
	screenHeight=screen.height;
	windowLeft=(screenWidth-385)/2;
	windowTop=(screenHeight-howHigh)/2;
	
	var popYesText="<html><head><title>Yes!</title><link href='../../common_files/cmao.css' rel='stylesheet' type='text/css'>\n";
    popYesText+='<script>\n';
    popYesText+='MM_preloadImages = opener.MM_preloadImages;\n';
    popYesText+='function MM_swapImage() { //v3.0\n';
    popYesText+='  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n';
    popYesText+='   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n';
    popYesText+='}\n';
    popYesText+='function MM_swapImgRestore() { //v3.0\n';
    popYesText+='  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n';
    popYesText+='}\n';
    popYesText+='function MM_findObj(n, d) { //v4.0\n';
    popYesText+='var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n';
    popYesText+='d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n';
    popYesText+='  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n';
    popYesText+='  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n';
    popYesText+=' if(!x && document.getElementById) x=document.getElementById(n); return x;\n';
	popYesText+='}\n';
    popYesText+='<'+cScript1+'script></head>\n';
	popYesText+='<body><center><table width="360" border="1" cellspacing="0" cellpadding="0">\n';
	popYesText+='<tr><td width="273" height="68"><img src="../../common_files/images/pop_feedbk_yes_hdr.gif" width="273" height="68"></td>\n';
	popYesText+='<td width="87" height="68"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/popUp/feedback/pop_hdr_pos_col3_close_mo.jpg\',1);MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/pop_feedbk_yes_close_mo.gif\',1)"><img name="closeIt" alt="Close Window" border="0" src="../../common_files/images/pop_feedbk_yes_close.gif" width="87" height="68"></a></td></tr>\n';
	popYesText+='<tr><td colspan="2"><table width="360" border="0" cellspacing="0" cellpadding="0"><tr><td width="30"><img src="../../common_files/images/spacer.gif" width="30" height="10"></td>\n';
	popYesText+='<td><div class="feedback_yes"><!-- feedback text start --> \n';
	popYesText+=displayText;
	popYesText+='<!-- feedback text end --></div></td></tr></table></td></tr></table>\n';
	popYesText+='<br><br><div class="copyright" align="center"><script type="text/javascript">document.write(window.opener.cmaoCopyright);displayText=window.opener.displayText;</script></div><script language="javascript"src="../../common_files/common.js"></script></center></body></html>\n';
    
    feedBack = window.open('','feedBath','width=397,height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
    feedBack.document.write(popYesText);
    feedBack.document.close();
    feedBack.focus();
}

function popWrong(displayText,howHigh) //anita's advice
{	
	
	//can_go_next=true;
	//alert("Yes the alert was called");
	if(arguments.length == 0){
		// method call
		var howHigh = this.windowHeight;
		var displayText = this.feedback;
	}
	if(!howHigh){
		// called w/ one arg
		var howHigh = defaultFeedbackWindowHeight;
	}
	
	screenWidth=screen.width;
	screenHeight=screen.height;
	windowLeft=(screenWidth-385)/2;
	windowTop=(screenHeight-howHigh)/2;	
	var cScript1='/';
	var popNoText="<html><head><title>No.</title><link href='../../common_files/cmao.css' rel='stylesheet' type='text/css'>\n";
    popNoText+='<script>\n';
    popNoText+='MM_preloadImages = opener.MM_preloadImages;\n';
    popNoText+='function MM_swapImage() { //v3.0\n';
    popNoText+='  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n';
    popNoText+='   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n';
    popNoText+='}\n';
    popNoText+='function MM_swapImgRestore() { //v3.0\n';
    popNoText+='  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n';
    popNoText+='}\n';
    popNoText+='function MM_findObj(n, d) { //v4.0\n';
    popNoText+='var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n';
    popNoText+='d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n';
    popNoText+='  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n';
    popNoText+='  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n';
    popNoText+=' if(!x && document.getElementById) x=document.getElementById(n); return x;\n';
	popNoText+='}\n';
    popNoText+='<'+cScript1+'script></head>\n';
	popNoText+='<body><center><table width="360" border="0" cellspacing="0" cellpadding="0">\n';
	popNoText+='<tr><td width="273" height="68"><img src="../../common_files/images/pop_feedbk_no_hdr.gif" width="273" height="68"></td>\n';
	popNoText+='<td width="87" height="68"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/popUp/feedback/pop_hdr_pos_col3_close_mo.jpg\',1);MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/pop_feedbk_no_close_mo.gif\',1)"><img name="closeIt" alt="Close Window" border="0" src="../../common_files/images/pop_feedbk_no_close.gif" width="87" height="68"></a></td></tr>\n';
	popNoText+='<tr><td colspan="2"><table width="360" border="0" cellspacing="0" cellpadding="0"><tr><td width="30"><img src="../../common_files/images/spacer.gif" width="30" height="10"></td>\n';
	popNoText+='<td><div class="feedback_no"><!-- feedback text start --> \n';
	popNoText+=displayText;
	popNoText+='<!-- feedback text end --></div></td></tr></table></td></tr></table>\n';
	popNoText+='<br><br><div class="copyright" align="center"><script type="text/javascript">document.write(window.opener.cmaoCopyright);displayText=window.opener.displayText;</script></div><script language="javascript"src="../../common_files/common.js"></script></center></body></html>\n';
    
    feedBack = window.open("",'feedBath','width=397,height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
    feedBack.document.write(popNoText);
    feedBack.document.close();
    feedBack.focus();
}




// narrow (385px) popup window with text
var popCPTFooter = false;

function popWindow(displayText,howWide,howHigh,collapse)
{
		//alert(displayText)
		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';
		
		
		
		var some_random_number = Math.floor(Math.random()*1000);        
	    if(window.snapCrackle && !snapCrackle.closed)                         
              window.snapCrackle.close();
		
		if(!collapse)
		{
			leftMargin='<td><img src="../../common_files/images/spacer.gif" width="15"></td><td width="540">';
			tomCenterThingy="";
		}
		else if(collapse==true)
		{
			leftMargin='<td colspan="3">';
			tomCenterThingy=' align="center"';
		}
		                  
		  
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 350; 
  		  }
		  howWide =375;
		}
		else
		{
			if(howWide=="wide")
			{
				howWide=585;
				if(!howHigh)
				{
  		  			howHigh = 530; 
  		  		}
  		  	}
			
			/*else
			{
				howWide=385;
				if(!howHigh)
				{
  		  			howHigh = 300; 
  		  		}				
			}*/
		}
	
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		var end_spaces="<br><br>";
		if(displayText.substr(displayText.length-5)=="</ul>") 
		{
			end_spaces="";	
		}

		screenWidth=screen.width;
		screenHeight=screen.height;
		
		windowLeft=(screenWidth-howWide)/2;
		windowTop=(screenHeight-howHigh)/2;

		if(howHigh > 450)
		{
			windowTop=0;	
		}
		
		if(howWide <= 410){			
		    var header = '<table width="360" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="266" height="32"><img src="../../common_files/images/pop_hdr_360pixels.gif" width="266" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_360pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_360pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="340" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_340_blue.gif" width="340" height="5"><br><div class="footer">'+cmaoCopyright+'</div></td></tr>';
            var innerWidth=360;
		}else if(howWide >= 585){
		    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="32"><img src="../../common_files/images/pop_hdr_560pixels.gif" width="466" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_560pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_560pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=yes,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
            var innerWidth=560;
		}
		else if(howWide > 385 && howWide < 585){
			var header = '<table width="561" border="0"><tr><td colspan="2" width="560"><table border="0" width="560" cellpadding="0" cellspacing="0"><tr valign="top"><td><img src="../../common_files/images/popup_560p_hdr.jpg" width="486" height="40"></td>';
			var header_right = '../../common_files/images/popup_560p_close_btn.jpg';
			var header_right_mo = '../../common_files/images/popup_560p_close_mo.jpg';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
            var divider= '<img src="../../common_files/images/Divider_multicolor_550x8.gif">';
		}
		//var dividerSpace =
		//    (displayText.indexOf(toTopTable) == -1) ? '<br><br>' : '';      	
	
        with(snapCrackle.document){
        clear();
        write('<html><head><title>Popup</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function popSimplified(whichPage, howHigh, howWide)\n');   
        write('{\n');   
        write('if(!howHigh)\n');   
        write('         howHigh=400;\n');   
        write('if(!howWide)\n');   
        write('howWide=620;     \n');   
        write('aPage= window.open(whichPage,"aPage","height="+howHigh+",width="+howWide+",scrollbars=yes,toolbar=yes,location=no,resizable=yes");\n');   
        write('aPage.focus();\n');   
        write('}\n'); 
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');

        write('</head>');
        write('<body><center>');
        write(header);
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="32"></a></td>');
        write('</tr><tr><td colspan="2"><table border="0" cellpadding="0" width="'+innerWidth+'" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
        write(end_spaces+'</div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table>');
		write('<div class="copyright" align="center"><script type="text/javascript">displayText=window.opener.displayText;</script></div><script language="javascript"src="../../common_files/common.js"></script></center></body></html>');
        close();
		}	
	snapCrackle.focus();
}

function popWindowpop(displayText,howWide,howHigh,collapse)
{

		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';
		
		
		
		var some_random_number = Math.floor(Math.random()*1000);        
	   // if(window.snapCrackle1 && !snapCrackle1.closed)                         
       //       window.snapCrackle1.close();
		
		if(!collapse)
		{
			leftMargin='<td><img src="../../common_files/images/spacer.gif" width="15"></td><td width="540">';
			tomCenterThingy="";
		}
		else if(collapse==true)
		{
			leftMargin='<td colspan="3">';
			tomCenterThingy=' align="center"';
		}
		                  
		  
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 300; 
  		  }
		  howWide =385
		}
		else
		{
			if(howWide=="wide")
			{
				howWide=585;
				if(!howHigh)
				{
  		  			howHigh = 530; 
  		  		}
  		  	}
			else
			{
				howWide=385;
				if(!howHigh)
				{
  		  			howHigh = 300; 
  		  		}				
			}
		}
	
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		var end_spaces="<br><br>";
		if(displayText.substr(displayText.length-5)=="</ul>") 
		{
			end_spaces="";	
		}

		screenWidth=screen.width;
		screenHeight=screen.height;
		
		windowLeft=(screenWidth-howWide)/2;
		windowTop=(screenHeight-howHigh)/2;

		if(howHigh > 450)
		{
			windowTop=0;	
		}
		
		if(howWide <= 410){			
		    var header = '<table width="360" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="266" height="32"><img src="../../common_files/images/pop_hdr_360pixels.gif" width="266" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_360pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_360pixels_close_mo.gif';
			snapCrackle1 = window.open("",'snapCrackle1','width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="340" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_340_blue.gif" width="340" height="5"><br><div class="footer">'+cmaoCopyright+'</div></td></tr>';
            var innerWidth=360;
		}else if(howWide >= 585){
		    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="32"><img src="../../common_files/images/pop_hdr_560pixels.gif" width="466" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_560pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_560pixels_close_mo.gif';
			snapCrackle1 = window.open("",'snapCrackle1'+some_random_number,'width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=yes,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
            var innerWidth=560;
		}
		else if(howWide > 385 && howWide < 585){
			var header = '<table width="561" border="0"><tr><td colspan="2" width="560"><table border="0" width="560" cellpadding="0" cellspacing="0"><tr valign="top"><td><img src="../../common_files/images/popup_560p_hdr.jpg" width="486" height="40"></td>';
			var header_right = '../../common_files/images/popup_560p_close_btn.jpg';
			var header_right_mo = '../../common_files/images/popup_560p_close_mo.jpg';
			snapCrackle1 = window.open("",'snapCrackle1','width='+howWide+',height='+howHigh+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
            var divider= '<img src="../../common_files/images/Divider_multicolor_550x8.gif">';
		}
		//var dividerSpace =
		//    (displayText.indexOf(toTopTable) == -1) ? '<br><br>' : '';      	
	
        with(snapCrackle1.document){
        clear();
        write('<html><head><title>Popup</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function popSimplified(whichPage, howHigh, howWide)\n');   
        write('{\n');   
        write('if(!howHigh)\n');   
        write('         howHigh=400;\n');   
        write('if(!howWide)\n');   
        write('howWide=620;     \n');   
        write('aPage= window.open(whichPage,"aPage","height="+howHigh+",width="+howWide+",scrollbars=yes,toolbar=yes,location=no,resizable=yes");\n');   
        write('aPage.focus();\n');   
        write('}\n'); 
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="32"></a></td>');
        write('</tr><tr><td colspan="2"><table border="0" cellpadding="0" width="'+innerWidth+'" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
        write(end_spaces+'</div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table></center></body></html>');
        close();
		}	
	snapCrackle1.focus();
}// JavaScript Document

function popPersonal(displayText,howWide,howHigh)
{
		var some_random_number = Math.floor(Math.random()*1000);        
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 300; 
  		  }
		  howWide =585
		}
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		if(howHigh > 450)
		{
			topWindow='top="0",';	
		}
		else
		{
			topWindow='';	
		}	
		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';	
		leftMargin='<td><img src="../../common_files/images/spacer.gif" width="15"></td><td width="540">';
		tomCenterThingy="";	
		
		if(personalLeft && personalRight)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+personalLeft+"</td><td valign='top'>"+displayText+"</td><td valign='top' align='right'>"+personalRight+"</td></tr></table>";
			displayText=format_display_text;
		}
		else if(personalLeft)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+personalLeft+"</td><td valign='top'>"+displayText+"</td></tr></table>";
			displayText=format_display_text;
		}
		else if(personalRight)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+displayText+"</td><td valign='top' align='right'>"+personalRight+"</td></tr></table>";
			displayText=format_display_text;
		}
		
	    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="65"><img src="../../common_files/images/pop_hdr_personal_560.gif" width="466" height="65"></td>';
		var header_right = '../../common_files/images/pop_hdr_gloss_560_close.gif';
		var header_right_mo = '../../common_files/images/pop_hdr_gloss_560_close_mo.gif';
		snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+','+topWindow+'scrollbars='+scroll+',toolbar=yes,location=no,resizable=yes');
		var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" src="../../common_files/images/pop_btm_btn_returntop.gif" alt="Return to Top" width="80" height="15"></a></td>';
        returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
        var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
	
        with(snapCrackle.document){
        clear();
        write('<html><head><title>Personal Story</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="58"></a></td>');
        write('</tr><tr><td colspan="2"><table border="0" cellpadding="0" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
        write('<br><br></div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table></center></body></html>');
        close();
		}	
		snapCrackle.focus();		
}

// function that does the same thing as using a reset button or calling
//  form.reset() and doing <form onReset="clearImages(this)"> :)
function resetForm(resetMe)
{
	resetMe.reset();
		clearImages(resetMe);
}

// function called by flash objects to set can_go_next
function setIdiot(toWhat)
{
	can_go_next=toWhat;
	hasFlashQuiz = true;
}

function popSimplified(whichPage, howHigh, howWide)
{
	if(!howHigh)
		howHigh=400;
        if(!howWide)
		howWide=620;	
			
	screenWidth=screen.width;
	screenHeight=screen.height;
		
	windowLeft=(screenWidth-howWide)/2;
	windowTop=(screenHeight-howHigh)/2;			
			
	aPage= window.open(whichPage,'aPage','height='+howHigh+',width='+howWide+',left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=yes,location=no,resizable=yes');
	aPage.focus();
}

function popSimplified_NoToolBar(whichPage, howHigh, howWide)
{
	if(!howHigh)
		howHigh=400;
        if(!howWide)
		howWide=620;	
			
	screenWidth=screen.width;
	screenHeight=screen.height;
		
	windowLeft=(screenWidth-howWide)/2;
	windowTop=(screenHeight-howHigh)/2;			
			
	aPage= window.open(whichPage+"?"+tail,'aPage','height='+howHigh+',width='+howWide+',left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
	aPage.focus();
}

function popActivity(whichPage, howHigh, howWide)
{
	
	howHigh=howHigh;
    howWide=howWide;	
	
	screenWidth=screen.width;
	screenHeight=screen.height;
	
	windowLeft=(screenWidth-howWide)/2;
	windowTop=(screenHeight-howHigh)/2;
			
	aPage= window.open(whichPage+"?"+tail,'aPage','height='+howHigh+',width='+howWide+',left='+windowLeft+',top='+windowTop+',scrollbars=no,toolbar=no,location=no,resizable=no');
	aPage.focus();
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the the FSCommand messages in a Flash movie
function cms1500_DoFSCommand(command, args) {
  var cms1500Obj = InternetExplorer ? cms1500 : document.cms1500;
  //
  //alert(args);
  setIdiot(args);
  //
}
// Hook for Internet Explorer 
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
	navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub cms1500_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call cms1500_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

images_changed=new Array();

//wrapper to check text box questions
tom_tries=new Array();
tom_passed_through=0;
function textBoxWrap(tomForm)
{
	can_go_next = true;
	if(!window.feedback_correct || tom_passed_through)
	{
		feedback_correct=eval('feedback_correct_'+tomForm.name);
		feedback_incorrect=new Array();
		feedback_incorrect=eval('feedback_incorrect_'+tomForm.name);
		tom_passed_through++;
	}
	
	tomCorrect=new Array();
	for(i=0;i<20;i++)
	{
		tomCorrect[i]=false;
	}
	tomWrong=false;
	for(i=0;i<tomForm.length;i++)
	{
		tom_image_name="yesno"+i+"_"+tomForm.name;
		images_changed[tomForm.name].push(tom_image_name);
		for(k=0;k<eval('answers_'+tomForm.name)[i].length;k++) //correct answers
		{
			if(tomForm["textfield"+i+"_"+tomForm.name].value == eval("answers_"+tomForm.name)[i][k])
			{
				tomCorrect[i]=true;
			}
		}
			
		if(tomCorrect[i]==true) //Correct! change image, and pop up form
		{			
			MM_swapImage(tom_image_name,'',rightImage,1);

		}
		else //Wrong! change image, and pop up form
		{
			MM_swapImage(tom_image_name,'',wrongImage,1);

		}	
		for(l=0;l<tomForm.length;l++)
		{
			if(tomCorrect[i]==false)
			{
				tomWrong=true;	
			}
		}
	
	}	
	if(tomWrong)
	{
		clearTimeout(dannysCrazyTimeout);
		dannysCrazyTimeout = setTimeout("popWrong('"+feedback_incorrect[tom_tries[tomForm.name]]+"', 300)", "1000");
		if(tom_tries[tomForm.name]<1)
			tom_tries[tomForm.name]++;
		else
			tom_tries[tomForm.name]=1;
	}
	else
	{	
		clearTimeout(dannysCrazyTimeout);
		dannysCrazyTimeout = setTimeout("popCorrect('"+feedback_correct+"', 300)", "1000");
	}
	
}
//clear text boxes
function textBoxClear(tomForm)
{
	tomForm.reset();
	tom_tries[tomForm.name]=0;
	for(i=0;i<images_changed[tomForm.name].length;i++)
	{
		MM_swapImage(images_changed[tomForm.name][i],'',clearImage,1);
	}
}
function writeTomTextBox(questionText,formName,numBoxes,boxText)
{	
	if(!formName)
	{
		formName='form1';	
	}
	if(!numBoxes)
	{
		numBoxes=1;	
	}
	if(!boxText)
	{
		boxText="";	
	}
	
	var displayBoxText=boxText.split("~");

	tom_tries[formName]=0;
	images_changed[formName]=new Array();
	document.write('<form name="'+formName+'" method="post" action="" onSubmit="textBoxWrap(this);return false">');
    document.write(questionText+'<br><br>');
    for(i=0;i<numBoxes;i++)
    {
    	document.write('<img src="../../common_files/images/blank_unmarked.gif" width="27" height="12" name="yesno'+i+'_'+formName+'">');
   		document.write(" "+displayBoxText[i]);
    	document.write(' <input type="text" name="textfield'+i+'_'+formName+'"><br><br>');
    }
    document.write('<a href="#" onClick="javascript:textBoxWrap(');
    document.write(formName);
    document.write(');return false;" onMouseUp="MM_swapImgRestore()" onMouseDown="MM_swapImage(\'Submit\',\'\',\'../../common_files/images/btn_submit_mo.gif\',1)"><img name="Submit" border="0" src="../../common_files/images/btn_submit.gif" width="51" height="22"></a>&nbsp;');
    document.write('<a href="#" onClick="textBoxClear('+formName+');return false;" onMouseUp="MM_swapImgRestore()" onMouseDown="MM_swapImage(\'Reset\',\'\',\'../../common_files/images/btn_reset_mo.gif\',1)"><img name="Reset" border="0" src="../../common_files/images/btn_reset.gif" width="51" height="22"></a>');
	document.write('</form>');
	
}
function popEmergency(displayText,howWide,howHigh)
{
		var some_random_number = Math.floor(Math.random()*1000);        
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 300; 
  		  }
		  howWide =585
		}
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		if(howHigh > 450)
		{
			topWindow='top="0",';	
		}
		else
		{
			topWindow='';	
		}	
		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';	
		leftMargin='<td><img src="../../common_files/images/spacer.gif" width="20"></td><td width="540">';
		tomCenterThingy="";	
		
		if(personalLeft && personalRight)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+personalLeft+"</td><td valign='top'>"+displayText+"</td><td valign='top' align='right'>"+personalRight+"</td></tr></table>";
			displayText=format_display_text;
		}
		else if(personalLeft)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+personalLeft+"</td><td valign='top'>"+displayText+"</td></tr></table>";
			displayText=format_display_text;
		}
		else if(personalRight)
		{
			var format_display_text="<table border='0' width='540'><tr><td valign='top'>"+displayText+"</td><td valign='top' align='right'>"+personalRight+"</td></tr></table>";
			displayText=format_display_text;
		}
		
	    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="65"><img src="../../common_files/images/pop_hdr_emergency_560.gif" width="466" height="65"></td>';
		var header_right = '../../common_files/images/pop_hdr_gloss_560_close.gif';
		var header_right_mo = '../../common_files/images/pop_hdr_gloss_560_close_mo.gif';
		snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+','+topWindow+'scrollbars='+scroll+',toolbar=yes,location=no,resizable=yes');
		var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" src="../../common_files/images/pop_btm_btn_returntop.gif" alt="Return to Top" width="80" height="15"></a></td>';
        returnToTop+='<td valign="top" align="right"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
        var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
	
        with(snapCrackle.document){
        clear();
        write('<html><head><title>Emergency Scenario</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="58"></a></td>');
        write('</tr><tr><td colspan="2"><table border="0" cellpadding="0" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
        write('<br><br></div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table></center></body></html>');
        close();
		}	
		snapCrackle.focus();		
}
//Kannan
function popItDepends(displayText,howHigh) //anita's advice
{	
	if(arguments.length == 0){
		// method call
		var howHigh ;//= this.windowHeight;
		var displayText = this.feedback;
	}
	if(!howHigh){
		// called w/ one arg
//		var howHigh = defaultFeedbackWindowHeight;
		var howHigh = 100;
	}
	howHigh=420;
	screenWidth=screen.width;
//	screenHeight=screen.height;
	screenHeight=100;
	windowLeft=(screenWidth-385)/2;
//	windowTop=(screenHeight-howHigh)/2;	
	windowTop=150;	
	
	var popNoText='<html><head><title>It Depends</title><link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n';
    popNoText+='<script>\n';
    popNoText+='MM_preloadImages = opener.MM_preloadImages;\n';
    popNoText+='function MM_swapImage() { //v3.0\n';
    popNoText+='  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n';
    popNoText+='   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n';
    popNoText+='}\n';
    popNoText+='function MM_swapImgRestore() { //v3.0\n';
    popNoText+='  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n';
    popNoText+='}\n';
    popNoText+='function MM_findObj(n, d) { //v4.0\n';
    popNoText+='var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n';
    popNoText+='d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n';
    popNoText+='  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n';
    popNoText+='  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n';
    popNoText+=' if(!x && document.getElementById) x=document.getElementById(n); return x;\n';
	popNoText+='}\n';
    popNoText+='</script></head>\n';
	popNoText+='<body><center><table width="360" border="0" cellspacing="0" cellpadding="0">\n';
	popNoText+='<tr><td width="273" height="68"><img src="../../common_files/images/pop_feedbk_ID_hdr.gif" width="273" height="68"></td>\n';
	popNoText+='<td width="87" height="68"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/popUp/feedback/pop_hdr_pos_col3_close_mo.jpg\',1);MM_swapImage(\'closeIt\',\'\',\'../../common_files/images/pop_feedbk_no_close_mo.gif\',1)"><img name="closeIt" alt="Close Window" border="0" src="../../common_files/images/pop_feedbk_no_close.gif" width="87" height="68"></a></td></tr>\n';
	popNoText+='<tr><td colspan="2"><table width="360" border="0" cellspacing="0" cellpadding="0"><tr><td width="30"><img src="../../common_files/images/spacer.gif" width="30" height="10"></td>\n';
	popNoText+='<td><div class="feedback_no"><!-- feedback text start --> \n';
	popNoText+=displayText;
	popNoText+='<!-- feedback text end --></div></td></tr></table></td></tr></table></center></body></html>\n';
    
    feedBack = window.open("",'feedBath','width=400,height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars=yes,toolbar=no,location=no,resizable=yes');
    feedBack.document.write(popNoText);
    feedBack.document.close();
    feedBack.focus();
}

function popWindowwithprintTI(displayText,howWide,howHigh,collapse)
{

		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';
		
		var some_random_number = Math.floor(Math.random()*1000);        
	    if(window.snapCrackle && !snapCrackle.closed)                         
              window.snapCrackle.close();
		
		if(!collapse)
		{
			leftMargin='<td><img src="../../common_files/images/spacer.gif" width="15"></td><td width="540">';
			tomCenterThingy="";
		}
		else if(collapse==true)
		{
			leftMargin='<td colspan="3">';
			tomCenterThingy=' align="center"';
		}
		                  
		  
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 300; 
  		  }
		  howWide =385
		}
		else
		{
			if(howWide=="wide")
			{
				howWide=585;
				if(!howHigh)
				{
  		  			howHigh = 530; 
  		  		}
  		  	}
			else
			{
				howWide=385;
				if(!howHigh)
				{
  		  			howHigh = 300; 
  		  		}				
			}
		}
	
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		var end_spaces="<br><br>";
		if(displayText.substr(displayText.length-5)=="</ul>") 
		{
			end_spaces="";	
		}

		screenWidth=screen.width;
		screenHeight=screen.height;
		
		windowLeft=(screenWidth-howWide)/2;
		windowTop=(screenHeight-howHigh)/2;

		if(howHigh > 450)
		{
			windowTop=0;	
		}
		
		if(howWide <= 410){			
		    var header = '<table width="360" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="266" height="32"><img src="../../common_files/images/pop_hdr_360pixels.gif" width="266" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_360pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_360pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="340" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="javascript:window.print();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrPrintUm\',\'\',\'../../common_files/images/btn_printOv.gif\',1)"><img name="mrPrintUm" alt="Print" border="0" src="../../common_files/images/btn_print.gif" ></a><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_340_blue.gif" width="340" height="5"><br><div class="footer">'+cmaoCopyright+'</div></td></tr>';
            var innerWidth=360;
		}else if(howWide >= 585){
			
		    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="32"><img src="../../common_files/images/pop_hdr_560pixels.gif" width="466" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_560pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_560pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right">  <a href="javascript:window.print();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrPrintUm\',\'\',\'../../common_files/images/btn_printOv.gif\',1)"><img name="mrPrintUm" alt="Print" border="0" src="../../common_files/images/btn_print.gif" ></a>    <a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
            var innerWidth=560;
		}
		else if(howWide > 385 && howWide < 585){
			var header = '<table width="561" border="0"><tr><td colspan="2" width="560"><table border="0" width="560" cellpadding="0" cellspacing="0"><tr valign="top"><td><img src="../../common_files/images/popup_560p_hdr.jpg" width="486" height="40"></td>';
			var header_right = '../../common_files/images/popup_560p_close_btn.jpg';
			var header_right_mo = '../../common_files/images/popup_560p_close_mo.jpg';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
            var divider= '<img src="../../common_files/images/Divider_multicolor_550x8.gif">';
		}
		//var dividerSpace =
		//    (displayText.indexOf(toTopTable) == -1) ? '<br><br>' : '';      	
	
        with(snapCrackle.document){
        clear();
        write('<html><head><title>Popup</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function popSimplified(whichPage, howHigh, howWide)\n');   
        write('{\n');   
        write('if(!howHigh)\n');   
        write('         howHigh=400;\n');   
        write('if(!howWide)\n');   
        write('howWide=620;     \n');   
        write('aPage= window.open(whichPage,"aPage","height="+howHigh+",width="+howWide+",scrollbars=yes,toolbar=no,location=no,resizable=yes");\n');   
        write('aPage.focus();\n');   
        write('}\n'); 
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="32"></a></td>');
        write('</tr><tr><td colspan="2"><table border="0" cellpadding="0" width="'+innerWidth+'" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
        write(end_spaces+'</div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table></center></body></html>');
        close();
		}	
	snapCrackle.focus();
}

function popWindowwithprint(daForm,displayText,howWide,howHigh,collapse)
{
		var pdf = daForm.pdf.value;
		var scroll = popUseScrollbars ? 'yes' : 'no';
		var showTheCPTFooter = popCPTFooter ? "<br>"+cptFooter : '';
		
		var some_random_number = Math.floor(Math.random()*1000);        
	    if(window.snapCrackle && !snapCrackle.closed)                         
              window.snapCrackle.close();
		
		if(!collapse)
		{
			leftMargin='<td><img src="../../common_files/images/spacer.gif" width="15"></td><td width="540">';
			tomCenterThingy="";
		}
		else if(collapse==true)
		{
			leftMargin='<td colspan="3">';
			tomCenterThingy=' align="center"';
		}
		                  
		  
		if(!howWide)
		{
		  if(!howHigh)
  		  {
  		  	howHigh = 300; 
  		  }
		  howWide =385
		}
		else
		{
			if(howWide=="wide")
			{
				howWide=585;				
				if(!howHigh)
				{
  		  			howHigh = 530; 
  		  		}
  		  	}
			else
			{
				howWide=385;
				if(!howHigh)
				{
  		  			howHigh = 300; 
  		  		}				
			}
		}
	
		if(popUseScrollbars)
		{
				howWide += 25;
		}

		var end_spaces="<br><br>";
		if(displayText.substr(displayText.length-5)=="</ul>") 
		{
			end_spaces="";	
		}

		screenWidth=screen.width;
		screenHeight=screen.height;
		
		windowLeft=(screenWidth-howWide)/2;
		windowTop=(screenHeight-howHigh)/2;
		if(howHigh > 450)
		{
			windowTop=0;	
		}
		
		if(howWide <= 410){			
		    var header = '<table width="360" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="266" height="32"><img src="../../common_files/images/pop_hdr_360pixels.gif" width="266" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_360pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_360pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="340" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right"><a href="'+pdf+'.pdf" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrPrintUm\',\'\',\'../../common_files/images/btn_printOv.gif\',1)"><img name="mrPrintUm" alt="Print" border="0" src="../../common_files/images/btn_print.gif" ></a><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_340_blue.gif" width="340" height="5"><br><div class="footer">'+cmaoCopyright+''+cmaoCopyright+'</div></td></tr>';
            var innerWidth=360;
		}else if(howWide >= 585){
		    var header = '<table width="560" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="466" height="32"><img src="../../common_files/images/pop_hdr_560pixels.gif" width="466" height="32"></td>';
			var header_right = '../../common_files/images/pop_hdr_560pixels_close.gif';
			var header_right_mo = '../../common_files/images/pop_hdr_560pixels_close_mo.gif';
			snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="560" border="0" cellspacing="0" cellpadding="0"><tr><td align="left" valign="top"><a href="javascript:window.scroll(0,0);" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'ToTop\',\'\',\'../../common_files/images/pop_btm_btn_returntop_mo.gif\',1)"><img name="ToTop" border="0" alt="Return to Top" src="../../common_files/images/pop_btm_btn_returntop.gif" width="80" height="15"></a></td>';
            returnToTop+='<td valign="top" align="right">  <a href="'+pdf+'.pdf" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrPrintUm\',\'\',\'../../common_files/images/btn_printOv.gif\',1)"><img name="mrPrintUm" alt="Print" border="0" src="../../common_files/images/btn_print.gif" ></a>    <a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseUm\',\'\',\'../../common_files/images/pop_btm_btn_close_mo.gif\',1)"><img name="mrCloseUm" alt="Close Window" border="0" src="../../common_files/images/pop_btm_btn_close.gif" width="94" height="15"></a></td></tr></table></td></tr>';
            var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
            var innerWidth=560;
		}
		else if(howWide > 385 && howWide < 585){
			var header = '<table width="561" border="0"><tr><td colspan="2" width="560"><table border="0" width="560" cellpadding="0" cellspacing="0"><tr valign="top"><td><img src="../../common_files/images/popup_560p_hdr.jpg" width="486" height="40"></td>';
			var header_right = '../../common_files/images/popup_560p_close_btn.jpg';
			var header_right_mo = '../../common_files/images/popup_560p_close_mo.jpg';
			snapCrackle = window.open("",'snapCrackle','width='+howWide+',height='+howHigh+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
            var divider= '<img src="../../common_files/images/Divider_multicolor_550x8.gif">';
		}
		//var dividerSpace =
		//    (displayText.indexOf(toTopTable) == -1) ? '<br><br>' : '';      	
		
        with(snapCrackle.document){
        clear();
        write('<html><head><title>Popup</title>');
        write('<link href="../../common_files/cmao.css" rel="stylesheet" type="text/css">\n');
        write('<script>\n');
        write('function popSimplified(whichPage, howHigh, howWide)\n');   
        write('{\n');   
        write('if(!howHigh)\n');   
        write('         howHigh=400;\n');   
        write('if(!howWide)\n');   
        write('howWide=620;     \n');   
        write('aPage= window.open(whichPage,"aPage","height="+howHigh+",width="+howWide+",scrollbars=yes,toolbar=no,location=no,resizable=yes");\n');   
        write('aPage.focus();\n');   
        write('}\n'); 
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
		var print1="<table border='0'><tr><td align='right' valign='middle'><a href='"+pdf+".pdf' onMouseOut='MM_swapImgRestore()' onMouseOver=MM_swapImage('mrPrintUm1','','../../common_files/images/btn_printOv.gif',1)><img name='mrPrintUm1' alt='Print' border='0' src='../../common_files/images/btn_print.gif' ></a></td></tr></table>"
        write('<td><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'mrCloseButton\',\'\',\''+header_right_mo+'\',1)">');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="94" height="32"></a></td>');
        write('<tr><td></td><td align=right>'+print1+'</td></tr></tr><tr><td colspan="2"><table border="0" cellpadding="0" width="'+innerWidth+'" cellspacing="0"><tr>'+leftMargin+'<div class="text_area"'+tomCenterThingy+'>');
        write(displayText);
		write(end_spaces+'</div></td></tr></table></td></tr>');
        write(returnToTop);
        write(divider);
        write('</table></center></body></html>');
        close();
		}	
	snapCrackle.focus();
}
function popWindowCopyright(displayText,howWide,howHigh)
{
			screenWidth=screen.width;
			screenHeight=screen.height;
			//howWide=410;
			//howHigh=260;
			windowLeft=(screenWidth-howWide)/2;
			windowTop=(screenHeight-howHigh)/2;
			var some_random_number = Math.floor(Math.random()*1000);   
		    var header = '<table width="340" border="0" cellspacing="0" cellpadding="0"><tr valign="top">';
			var header_right = '../shared_assets/popuptitle_copyright.jpg';
			var header_right_mo = '../shared_assets/popuptitle_copyright.jpg';
			snapCrackle = window.open("",'snapCrackle'+some_random_number,'width='+howWide+',height='+howHigh+',left='+windowLeft+',top='+windowTop+',scrollbars='+scroll+',toolbar=no,location=no,resizable=yes');
			var returnToTop='<tr><td colspan="3"><table width="322"  border="0" cellspacing="0" cellpadding="0"><tr><td align="right" background="../shared_assets/popupbottom.jpg"><a href="javascript:window.close();" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'img_close\',\'\',\'../shared_assets/popupclose_MO.jpg\',1);MM_swapImage(\'img_close\',\'\',\'../shared_assets/popupclose_mo.jpg\',1)"><img name="img_close" src="../shared_assets/popupclose.jpg" alt="Close Window" width="35" height="13" border="0"></a><img src="../shared_assets/spacer.gif" width="2" height="1"></td></td></tr></table></tr></table></td></tr>';
        //    var divider= '<tr align="center" valign="top"><td colspan="3"><img src="../../common_files/images/pop_divider_560_blue.gif" width="560" height="5"><br><div class="footer">'+cmaoCopyright+''+showTheCPTFooter+'</div></td></tr>';
            var innerWidth=400;
			//leftMargin=10;
			
		with(snapCrackle.document){
        clear();
        write('<html><head><title>Copyright</title>');
        write('<link href="../../common/bodystyle_gray.css" rel="stylesheet" type="text/css">\n');
////////////////////// Margin pixels modified as per request on 28 February 2006
		write('<style type="text/css"><!--body {margin-left: 2px;	margin-top: 0px;	margin-right: 2px;	margin-bottom: 0px;}--></style>');
        write('<script>\n');
        write('function MM_swapImage() { //v3.0\n');
        write('  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)\n');
        write('   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}\n');
        write('}\n');
        write('function MM_swapImgRestore() { //v3.0\n');
        write('  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;\n');
        write('}\n');
        write('function MM_findObj(n, d) { //v4.0\n');
        write('var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {\n');
        write('d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}\n');
        write('  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];\n');
        write('  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);\n');
        write(' if(!x && document.getElementById) x=document.getElementById(n); return x;\n');
		write('}\n');
        write('</script>\n');
        write('</head>');
        write('<body><center>');
        write(header);
        write('<td>');
        write('<img name="mrCloseButton" alt="Close Window" border="0" src="'+header_right+'" width="322" height="18"></a></td>');
        write('</tr><tr><td colspan="2"><table width="322" border="0" cellpadding="0" cellspacing="0"><tr><td><div class="bodycontent">');
        write(displayText);
        write('<br><br></div></td></tr></table></td></tr>');
        write(returnToTop);
       // write(divider);
        write('</table></center></body></html>');
        close();
		}	
		snapCrackle.focus();		
}
var qute="'";
if (authorName=="Gray")
{
	
	displayText="<br>&copy; 2006 Mosby, Inc. All rights reserved.<br><br>No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, without permission in writing from the publisher. <br><br>Produced in the United States of America. <BR><BR>[0-323-02632-X]";
	var cmaoCopyright="<br><a href=\"javascript:popSimplified('http://evolve.elsevier.com/disclaimer.html?asis','360','480')\">Terms and Conditions</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/privacy_policy.html?asis','360','480')\">Privacy Policy</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/support.html','wide','wide')\">Contact Us</a> | ";
	cmaoCopyright+="<a href=\"javascript:popWindowCopyright(displayText,'322','240')\">Copyright </a>&copy; 2006  Mosby, Inc.</a> All rights reserved.";
	cmaoCopyright+="<br />Evolve&reg; is a registered trademark of <a href=\"javascript:popSimplified('http://www.elsevier.com/?asis','howWide','howHigh')\">Elsevier Inc</a>. in the United States and other jurisdictions.<br /><br />";

	
}
/*else if(authorName=="Klieger")
{

	displayText="&copy; 2006 Elsevier, Inc. All rights reserved. <br><br>No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, without permission in writing from the publisher. <br><br>Produced in the United States of America. <BR><BR>[1-4160-2480-8]";
	var cmaoCopyright="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/disclaimer.html?asis','360','480')\">Terms and Conditions</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/privacy_policy.html?asis','360','480')\">Privacy Policy</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/support.html','wide','wide')\">Contact Us</a> | ";
	cmaoCopyright+="<a href=\"javascript:popWindowCopyright(displayText,'410','260')\">Copyright </a>&copy; 2006  <a href=\"javascript:popSimplified('http://www.elsevier.com','wide','wide')\">Elsevier Inc.</a> <nobr>All rights reserved.</nobr>";
	cmaoCopyright+="<br />Evolve&reg; is a registered trademark of Elsevier Inc. in the United States and/or other jurisdictions.";

}
else if(authorName=="Kennedy")
{

	displayText="&copy; 2006 Elsevier, Inc. All rights reserved. <br><br>No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, without permission in writing from the publisher. <br><br>Produced in the United States of America. <BR><BR>[1-4160-2478-6]";
	var cmaoCopyright="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/disclaimer.html?asis','360','480')\">Terms and Conditions</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/privacy_policy.html?asis','360','480')\">Privacy Policy</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/support.html','wide','wide')\">Contact Us</a> | ";
	cmaoCopyright+="<a href=\"javascript:popWindowCopyright(displayText,'410','260')\">Copyright </a>&copy; 2006  <a href=\"javascript:popSimplified('http://www.elsevier.com','wide','wide')\">Elsevier Inc.</a> <nobr>All rights reserved.</nobr>";
	cmaoCopyright+="<br />Evolve&reg; is a registered trademark of Elsevier Inc. in the United States and/or other jurisdictions.";

}
else if(authorName=="Young_Kennedy")
{

	displayText="&copy; 2006 Elsevier, Inc. All rights reserved. <br><br>No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, without permission in writing from the publisher. <br><br>Produced in the United States of America. <BR><BR>[1-4160-2479-4]";
	var cmaoCopyright="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/disclaimer.html?asis','360','480')\">Terms and Conditions</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/privacy_policy.html?asis','360','480')\">Privacy Policy</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/support.html','wide','wide')\">Contact Us</a> | ";
	cmaoCopyright+="<a href=\"javascript:popWindowCopyright(displayText,'410','260')\">Copyright </a>&copy; 2006  <a href=\"javascript:popSimplified('http://www.elsevier.com','wide','wide')\">Elsevier Inc.</a> <nobr>All rights reserved.</nobr>";
	cmaoCopyright+="<br />Evolve&reg; is a registered trademark of Elsevier Inc. in the United States and/or other jurisdictions.";

}
else if(authorName=="Bonewit")
{
	displayText="&copy; 2006 Elsevier, Inc. All rights reserved. <br><br>No part of this product may be reproduced or traansmitted in any form or by any means, electronic or mechanical, including input into or storage in any information system, without permission in writing from the publisher. <br><br>Produced in the United States of America. <BR><BR>[0-7216-0682-2]";
	var cmaoCopyright="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/disclaimer.html?asis','360','480')\">Terms and Conditions</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/privacy_policy.html?asis','360','480')\">Privacy Policy</a> | ";
	cmaoCopyright+="<a href=\"javascript:popSimplified('http://evolve.elsevier.com/support.html','wide','wide')\">Contact Us</a> | ";
	cmaoCopyright+="<a href=\"javascript:popWindowCopyright(displayText,'410','260')\">Copyright </a>&copy; 2006  <a href=\"javascript:popSimplified('http://www.elsevier.com','wide','wide')\">Elsevier Inc.</a> <nobr>All rights reserved.</nobr>";
	cmaoCopyright+="<br />Evolve&reg; is a registered trademark of Elsevier Inc. in the United States and/or other jurisdictions.";
}*/


function linkPage(page) //not actual step number, just the index of this one for this phase.
{
	var fiber=page+"?"+tail;	
	document.location.href=fiber;
}


//var cmaoCopyright="Copyright &copy; 2006, Elsevier Science (USA). All rights reserved.";

function popwindow1(text)
{
	
	width=339;
	height=300;
	
	var screenHeight = screen.height;
	var screenWidth = screen.width;

	windowLeft=(screenWidth-width)/2;
	windowTop=(screenHeight-height)/2;
	var poptext='';

	poptext+='<html><head>';
	poptext+='<title>Evolve</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
poptext+='<script language="javascript" type="text/javascript" src="../../js/openwindownoscroll.js"></script><script language="javascript" src="../../js/gray.js"></script><script language="javascript" type="text/javascript" src="../../js/openwindowscroll.js"></script><script language="javascript" type="text/javascript" src="../../js/openwin.js"></script><script type="text/javascript" language="Javascript" src="../../js/wm_cookies.js"></script><script language="javascript" type="text/javascript" src="../../js/parseURL.js"></script><script language="JavaScript" type="text/javascript" src="../../js/global.js"></script>';
poptext+='<style type="text/css"><!--body {	margin-left: 0px;	margin-top: 0px;	margin-right: 0px;margin-bottom: 0px;}--></style>';
poptext+='<link href="../../common/bodystyle.css" rel="stylesheet" type="text/css">';
poptext+='<link href="../../common/bodystyle_gray.css" rel="stylesheet" type="text/css"></head>';
poptext+='<body>';
poptext+='<table width="322"  border="0" cellspacing="0" cellpadding="0">';
poptext+='<tr><td background="../shared_assets/popuptitle_blank.jpg"><span class="popscreen_title">&nbsp;&nbsp;Unit Dose</span></td>    <td><img src="../shared_assets/poptoporangespacer.jpg" width="10" height="18"></td>  </tr>';
poptext+='<tr><td colspan="2"><img src="../shared_assets/spacer.gif" width="10" height="15"></td>  </tr>';
poptext+='<td colspan="2"><table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr><td width="3%">&nbsp;</td><td width="290" height="160" class="bodycontent" valign="top">';
poptext+=text;
poptext+='</td></tr></table></td></tr>';
poptext+='<tr><td colspan="2"><img src="../shared_assets/spacer.gif" width="10" height="15"></td></tr>';
poptext+='  <tr><td width="306" align="right" background="../shared_assets/popupbottom.jpg"><a href="javascript:window.close()"><img src="../shared_assets/popupclose.jpg" alt="Close" width="35" height="13" border="0"></a></td>    <td width="10"><img src="../shared_assets/popbottomorangespacer.jpg" width="10" height="13"></td>  </tr>';
poptext+='  <tr><td colspan="2" align="right" class="copyright"><div class="copyright" align="center">';
poptext+=cmaoCopyright;
poptext+='</div></td></tr></table></body></html>';
	feedBack = window.open("",'feedBath','width='+width+',height='+height+',left='+windowLeft+',top='+windowTop+',scrollbars=yes, toolbar=no, location=no, resizable=no');
	feedBack.document.write(poptext);
	feedBack.document.close();
	feedBack.focus();
}