
function doHelp(num){
	header   = "<html>\n<head><title>Explanation</title></head>\n<body><div style='font-family:arial'>\n"
	footer   = "\n</div><form><input type='button' onClick='window.close()' value='Close window'></form></body></html>"
	help     = new Array()
	help[1]  = "Total compensation usually includes salary and fringe benefits.  Company benefits may include sick leave, vacation pay, insurance, and retirement contributions.  Commonly, fringe benefits amount to 35&#37; of the student's salary.  "
	help[2]  = "Promotional costs for Online Training is zero because the e!Kit promotes online training within your Credit Union for you."
	help[3]  = "Transcripts are kept on file by our LMS system, and reports on students, or the whole Credit Union can be run.  This leaves extra time for the Trainer to plan new training programs and perform other necessary tasks associated with training."
	help[4]  = "This figure takes regular faculty setup costs and divides by 2.  Due to online training possibilities, students can easily sign up for training themselves, rather than having faculty sign students up for training thus reducing time and money spent."
	help[5]  = "This figure is calculated assuming that the 1 year unlimited membership to eCourses is purchased for the flat rate of $2000, exams are purchased seperately, so that figure is factored in.  A student takes one exam, on average, for each course.  Average price of an exam is $25.  "
	help[6]  = "There is no cost for updating old material because eCourses are updated on a regular basis and are available under regular subscription upon their release."
	help[7]  = "This figure is the same as Traditional learning because the tuition price between eSchools and traditional face-2-face conferences, workshops, and seminars is approximately the same."
	help[8]  = "This figure is the same as Traditional learning because the tuition price between eSchools and traditional face-2-face conferences, workshops, and seminars is approximately the same."
	help[9]  = "This figure is zero because with online training there are no travel expenses"
	help[10] = "This figure is zero because with online training there are no travel expenses"
	popup    = window.open("","resultWindow","width=350,height=200,screenX=300,screenY=300,top=300,left=300, scrollbars=yes")
	popup.document.write(header)
	popup.document.write("<p>"+help[num]+"</p>")
	popup.document.write(footer)
	popup.document.close()
	popup.focus()

	}


//parse input to number, strip characters
function numerify(text){

for (x=0; x< text.length; x++)
	{
	if (text.charAt(x)!='.')
		{
		check = parseInt(text.charAt(x))
		check = check.toString()
		}

if (((check) == 'NaN')){
		if (x==0)
			{
			text = text.substring(1,(text.length))
			continue
			}
		if (x==(text.length-1))
			{
			text = text.substring(0,(text.length-1))
			continue
			}
		text = text.substring(0,x) + text.substring((x+1),(text.length))
		x = x-1
		}
}
return(text)
}

function formFloat(num)
{
num = numerify(num)
num = num-0
if (num > 0 || num < 0)
	{
	return(num)
	}
else
	{
	return(0)
	}
}

function percentIt(text){
num = numerify(text) - 0
num = num * 100
num = dollarIt(num)
num = num +"%"
return(num)
}

function dollarIt(text){
dollar = text.toString()

dec_place = dollar.indexOf(".",0)

if (dec_place ==-1){
dollar = dollar + ".00"
return(dollar)
}
else if((dec_place +1) == dollar.length){
dollar = dollar + "00"
return(dollar)
}
else if ((dec_place+2) == dollar.length){
dollar = dollar + "0"
return(dollar)
}
else{
dollar = dollar.substring(0,dec_place+3)
return(dollar)
}

}

function neat(text)
{
text = numerify(text)
text = commaIt(text)
text = dollarIt(text)
return(text)
}

function formFill(theform){
	theform.elements["q1_online"].value = formFloat(theform.elements["q1_trad"].value)
	theform.elements["q2_trad"].value = formFloat(theform.elements["q1_trad"].value) * 1.35
	theform.elements["q2_online"].value = theform.elements["q2_trad"].value

	theform.elements["q3_online"].value = formFloat(theform.elements["q3_trad"].value)

	theform.elements["q4_trad"].value = formFloat(theform.elements["q3_trad"].value) * 52
	theform.elements["q4_online"].value = formFloat(theform.elements["q4_trad"].value)

	theform.elements["q5_online"].value = formFloat(theform.elements["q5_trad"].value)

	theform.elements["q6_trad"].value = formFloat(theform.elements["q5_trad"].value) * 12
	theform.elements["q6_online"].value = formFloat(theform.elements["q6_trad"].value)

	theform.elements["q7_online"].value = 0

	theform.elements["q8_trad"].value = formFloat(theform.elements["q7_trad"].value) * 12
	theform.elements["q8_online"].value = 0

	theform.elements["q9_online"].value = formFloat(theform.elements["q9_trad"].value)

	theform.elements["q10_trad"].value = (formFloat(theform.elements["q6_trad"].value)) * (formFloat(theform.elements["q9_trad"].value))
	theform.elements["q10_online"].value = formFloat(theform.elements["q10_trad"].value)

	theform.elements["q11_online"].value = 0

	theform.elements["q12_online"].value = formFloat(theform.elements["q12_trad"].value) * .5

	//theform.elements["q13_online"].value = formFloat(theform.elements["q13_trad"].value)

	theform.elements["q14_online"].value = formFloat(theform.elements["q14_trad"].value)

	//theform.elements["q15_online"].value = formFloat(theform.elements["q15_trad"].value)

	theform.elements["q16_online"].value = formFloat(theform.elements["q16_trad"].value)

	theform.elements["q17_online"].value = formFloat(theform.elements["q17_trad"].value) * .5

	theform.elements["q18_online"].value = formFloat(theform.elements["q18_trad"].value)

	theform.elements["q19_online"].value = 2000

	theform.elements["q20_trad"].value = (formFloat(theform.elements["q19_trad"].value) * formFloat(theform.elements["q14_trad"].value))
	theform.elements["q20_online"].value = (formFloat(theform.elements["q18_trad"].value) * 25 * formFloat(theform.elements["q14_trad"].value)) + 2000

	theform.elements["q21_online"].value = 0

	theform.elements["q22_online"].value = formFloat(theform.elements["q22_trad"].value)

	theform.elements["q23_trad"].value = formFloat(theform.elements["q16_trad"].value) * formFloat(theform.elements["q22_trad"].value)
	theform.elements["q23_online"].value = formFloat(theform.elements["q23_trad"].value)

	theform.elements["q24_online"].value = 0

	theform.elements["q25_trad"].value = 0

	theform.elements["q26_trad"].value = ((formFloat(theform.elements["q6_trad"].value)/formFloat(theform.elements["q4_trad"].value)) * formFloat(theform.elements["q2_online"].value)) * formFloat(theform.elements["q9_online"].value)
	theform.elements["q26_online"].value = formFloat(theform.elements["q26_trad"].value)

	theform.elements["q27_trad"].value = (theform.elements["q8_trad"].value/theform.elements["q4_trad"].value) * theform.elements["q2_trad"].value * theform.elements["q9_trad"].value
	theform.elements["q27_online"].value = 0

	theform.elements["q28_online"].value = 0

	theform.elements["q29_trad"].value = formFloat(theform.elements["q11_trad"].value) + formFloat(theform.elements["q12_trad"].value) + formFloat(theform.elements["q17_trad"].value) + formFloat(theform.elements["q20_trad"].value) + formFloat(theform.elements["q21_trad"].value) + formFloat(theform.elements["q23_trad"].value) + formFloat(theform.elements["q24_trad"].value) + formFloat(theform.elements["q25_trad"].value) + formFloat(theform.elements["q26_trad"].value) + formFloat(theform.elements["q27_trad"].value) + formFloat(theform.elements["q28_trad"].value)
	theform.elements["q29_trad"].value = "$" + dollarIt(theform.elements["q29_trad"].value)
	theform.elements["q29_online"].value =0

	theform.elements["q30_online"].value = formFloat(theform.elements["q11_online"].value) + formFloat(theform.elements["q12_online"].value) + formFloat(theform.elements["q17_online"].value) + formFloat(theform.elements["q20_online"].value) + formFloat(theform.elements["q21_online"].value) + formFloat(theform.elements["q23_online"].value) + formFloat(theform.elements["q24_online"].value) + formFloat(theform.elements["q25_online"].value) + formFloat(theform.elements["q26_online"].value) + formFloat(theform.elements["q27_online"].value) + formFloat(theform.elements["q28_online"].value)
	theform.elements["q30_online"].value = "$" + dollarIt(theform.elements["q30_online"].value)
	theform.elements["q30_trad"].value =0

	theform.elements["q31_online"].value = formFloat(theform.elements["q29_trad"].value) - formFloat(theform.elements["q30_online"].value)
	theform.elements["q31_online"].value = "$" + dollarIt(theform.elements["q31_online"].value)

	theform.elements["q32_online"].value = formFloat(theform.elements["q31_online"].value) / formFloat(theform.elements["q30_online"].value)
	theform.elements["q32_online"].value = percentIt(theform.elements["q32_online"].value)

	theform.elements["q33_online"].value = formFloat(theform.elements["q31_online"].value) / formFloat(theform.elements["q29_trad"].value)
	theform.elements["q33_online"].value = percentIt(theform.elements["q33_online"].value)

}

function doNext(item,itemform)
{
qname = item.name
qnum  = parseInt(qname.substring(1,qname.indexOf("_")))
qnum  = qnum + 1
if ((qnum==13)||(qnum==15))
	{
	qnum  = qnum + 1
	}
if (qnum < 33)
	{
	target = "q" + qnum + "_trad"
	itemform.elements[target].focus()
	itemform.elements[target].select()
	}
else
	{
	item.blur()
	}
}

function doSkip(item,itemform)
{
qname = item.name
qnum  = parseInt(qname.substring(1,qname.indexOf("_")))
//qnum  = qnum + 1
if ((qnum==13)||(qnum==15))
	{
	qnum  = qnum + 1
	}
if (qnum < 33)
	{
	target = "q" + qnum + "_online"
	itemform.elements[target].focus()
	itemform.elements[target].select()
	}
else
	{
	item.blur()
	}

}
