/*	Composite script of the known and unknown functions - revision 2/26
	Produced by Ed Escott
	You may only use this script if credit is given on the page- ie - "Teaching file engine
	designed by Ed Escott"
	Any comments or suggestions are appreciated - edescott@sprynet.com
	*/

function Findings() {
parent.diagnosis.document.open();
parent.diagnosis.document.close();
parent.diagnosis.document.open();
parent.diagnosis.document.write("<HTML><HEAD><TITLE>Findings Window</TITLE>");
parent.diagnosis.document.write("</HEAD>");
parent.diagnosis.document.write("<BODY>");
parent.diagnosis.document.write("<P>" + findings + "</P>");
parent.diagnosis.document.write("<FORM>");
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=DIAG VALUE=DIAGNOSIS? onclick='parent.images.Answer()'>");
parent.diagnosis.document.write("</FORM>");
parent.diagnosis.document.write("</BODY></HTML>");
parent.diagnosis.document.close();
}

function ButtonBoth() {
// to put findings and return button on right column before diagnosis
// need to redirect this to the unkwnon list when ready
parent.diagnosis.document.write("<P ALIGN='center'>");
parent.diagnosis.document.write("<FORM>");
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=FINDINGS VALUE='Back to FINDINGS' onclick='parent.images.Findings()'>"); 
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=BACK VALUE=\"Back to Teaching File List\" onclick='top.location=\"http://www.uchsc.edu/neuroimaging/tflist.htm\"'>");
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=UNK VALUE=\"To Unknown Case List\" onclick='top.location=\"http://www.uchsc.edu/neuroimaging/unklist.htm\"'>"); 
parent.diagnosis.document.write("</FORM>");
parent.diagnosis.document.write("</P>");
}


function Diagnosis() {
//to write diagnosis to right frame after body tag placed
parent.diagnosis.document.write("<P>" + diagnosis + "</P>");
parent.diagnosis.document.write("<P>" + diagnosisMethod + "</P>");
parent.diagnosis.document.write("<P>" + discussion + "</P>");
parent.diagnosis.document.write("<P>" + references + "</P>");
parent.diagnosis.document.write("<P>" + credits + "</P>");
}

function ButtonBack() {
// to put findings button on right column before diagnosis in known case
parent.diagnosis.document.write("<P ALIGN='center'>");
parent.diagnosis.document.write("<FORM>");
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=BACK VALUE=\"Back to Teaching File List\" onclick='top.location=\"http://www.uchsc.edu/neuroimaging/tflist.htm\"'>"); 
parent.diagnosis.document.write("</FORM>");
parent.diagnosis.document.write("</P>");
}



function Head(title) {
// Function to write the head HTML
// Accepts the variable: title
var t = title
parent.diagnosis.document.open();
parent.diagnosis.document.close();
parent.diagnosis.document.open();
parent.diagnosis.document.write("<HTML><HEAD><TITLE>t</TITLE>");
parent.diagnosis.document.write("</HEAD>");
parent.diagnosis.document.write("<BODY>");
}

function Answer() {
/*  Script to print the answer to the right frame after diagnosis button is pressed */

var y="Diagnosis Window";

Head(y);
ButtonBoth();
Diagnosis();
ButtonBoth();
parent.diagnosis.document.write("</BODY></HTML>");
parent.diagnosis.document.close();
}
 



function Known() {
/*  Script to print all the information to the right frame */


var x="Teaching File - Known";

Head(x);
ButtonBack();
parent.diagnosis.document.write("<P>" + findings + "</P>");
Diagnosis();
ButtonBack();
parent.diagnosis.document.write("</BODY></HTML>");
parent.diagnosis.document.close();
}



function Unknown() {

/* This is the scipt for the "unknown" cases.  It prints the images and history in the right frame and a findings button in the left window.  Clicking brings up the findings, then diagnosis and discussion in the right window. */

// Script to put the findings button in the right column at startup
var f = "Findings button Window";
Head(f);
parent.diagnosis.document.write("<P ALIGN='center'>");
parent.diagnosis.document.write("<FORM>");
parent.diagnosis.document.write("<INPUT TYPE=BUTTON NAME=FINDINGS VALUE=FINDINGS? onclick='parent.images.Findings()'>");
parent.diagnosis.document.write("</FORM>");
parent.diagnosis.document.write("</P>");
parent.diagnosis.document.write("</BODY></HTML>");
parent.diagnosis.document.close();
}

