if ((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) < 5 )) {
   document.write("<LINK REL=stylesheet HREF=\"../../2L_stylesheets/fr_generic.css\" TYPE=\"text/css\">"); }

else if (navigator.appName == "Microsoft Internet Explorer"){
   document.write("<LINK REL=stylesheet HREF=\"../../2L_stylesheets/fr_generic.css\" TYPE=\"text/css\">");}

else {
   document.write("<LINK REL=stylesheet HREF=\"../../2L_stylesheets/fr_generic.css\" TYPE=\"text/css\">");}

function validateform(){
	q1 = 0;
	for(it=0 ; it<document.teen_quiz_form.q1.length ; it++) { 
		if(document.teen_quiz_form.q1[it].checked) {
			q1 = document.teen_quiz_form.q1[it].value;
		} 
	}

	q2 = 0;
	for(it=0 ; it<document.teen_quiz_form.q2.length ; it++) { 
		if(document.teen_quiz_form.q2[it].checked) {
			q2 = document.teen_quiz_form.q2[it].value;
		} 
	}

	q3 = 0;
	for(it=0 ; it<document.teen_quiz_form.q3.length ; it++) { 
		if(document.teen_quiz_form.q3[it].checked) {
			q3 = document.teen_quiz_form.q3[it].value;
		} 
	}

	q4 = 0;
	for(it=0 ; it<document.teen_quiz_form.q4.length ; it++) { 
		if(document.teen_quiz_form.q4[it].checked) {
			q4 = document.teen_quiz_form.q4[it].value;
		} 
	}

	q5 = 0;
	for(it=0 ; it<document.teen_quiz_form.q5.length ; it++) { 
		if(document.teen_quiz_form.q5[it].checked) {
			q5 = document.teen_quiz_form.q5[it].value;
		} 
	}

	q6 = 0;
	for(it=0 ; it<document.teen_quiz_form.q6.length ; it++) { 
		if(document.teen_quiz_form.q6[it].checked) {
			q6 = document.teen_quiz_form.q6[it].value;
		} 
	}

	q7 = 0;
	for(it=0 ; it<document.teen_quiz_form.q7.length ; it++) { 
		if(document.teen_quiz_form.q7[it].checked) {
			q7= document.teen_quiz_form.q7[it].value;
		} 
	}

	q81 = 0;
	for(it=0 ; it<document.teen_quiz_form.q81.length ; it++) { 
		if(document.teen_quiz_form.q81[it].checked) {
			q81= document.teen_quiz_form.q81[it].value;
		} 
	}

	q82 = 0;
	for(it=0 ; it<document.teen_quiz_form.q82.length ; it++) { 
		if(document.teen_quiz_form.q82[it].checked) {
			q82= document.teen_quiz_form.q82[it].value;
		} 
	}

	q83 = 0;
	for(it=0 ; it<document.teen_quiz_form.q83.length ; it++) { 
		if(document.teen_quiz_form.q83[it].checked) {
			q83= document.teen_quiz_form.q83[it].value;
		} 
	}

	q91 = 0;
	for(it=0 ; it<document.teen_quiz_form.q91.length ; it++) { 
		if(document.teen_quiz_form.q91[it].checked) {
			q91= document.teen_quiz_form.q91[it].value;
		} 
	}

	q92 = 0;
	for(it=0 ; it<document.teen_quiz_form.q92.length ; it++) { 
		if(document.teen_quiz_form.q92[it].checked) {
			q92= document.teen_quiz_form.q92[it].value;
		} 
	}

	q101 = 0;
	for(it=0 ; it<document.teen_quiz_form.q101.length ; it++) { 
		if(document.teen_quiz_form.q101[it].checked) {
			q101= document.teen_quiz_form.q101[it].value;
		} 
	}

	q102 = 0;
	for(it=0 ; it<document.teen_quiz_form.q102.length ; it++) { 
		if(document.teen_quiz_form.q102[it].checked) {
			q102= document.teen_quiz_form.q102[it].value;
		} 
	}

	q103 = 0;
	for(it=0 ; it<document.teen_quiz_form.q103.length ; it++) { 
		if(document.teen_quiz_form.q103[it].checked) {
			q103= document.teen_quiz_form.q103[it].value;
		} 
	}

	q11 = 0;
	for(it=0 ; it<document.teen_quiz_form.q11.length ; it++) { 
		if(document.teen_quiz_form.q11[it].checked) {
			q11= document.teen_quiz_form.q11[it].value;
		} 
	}

teen_quiz_total = eval(parseFloat(q1)+ parseFloat(q2) + parseFloat(q3) + parseFloat(q4) + parseFloat(q5) + parseFloat(q6) + parseFloat(q7) + parseFloat(q81) + parseFloat(q82) + parseFloat(q83) + parseFloat(q91) + parseFloat(q92) + parseFloat(q101) + parseFloat(q102) + parseFloat(q103) + parseFloat(q11));

//alert("call a doc based on the total = " + eval(teen_quiz_total) );

URL= "";

switch (eval(teen_quiz_total)) {

	case 0:
	case 1:
	case 2:
	case 3:
	case 4:
	case 5:
	case 6:
	case 7:
	case 8:
	case 9:
	case 10:
		//alert("Need Big Improvement :: x < 12");
		// fr:: change the line below to suit your url
		URL = "/servlet/ContentServer?pagename=2ndLevel/Tools/2L_TeenQuiz_Improve";
		break;
	case 11:
	case 12:
	case 13:
	case 14:
	case 15:
	case 16:
	case 17:
	case 18:
	case 19:
		//alert("Average ::  11 < x > 19");
		// fr:: change the line below to suit your url
		URL = "/servlet/ContentServer?pagename=2ndLevel/Tools/2L_TeenQuiz_Average";
		break;
	case 20:
	case 21:
	case 22:
	case 23:
	case 24:
	case 25:
	case 26:
	case 27:
	case 28:
	case 29:
		//alert("Very Good :: 20 < x > 29");
		// fr:: change the line below to suit your url
		URL = "/servlet/ContentServer?pagename=2ndLevel/Tools/2L_TeenQuiz_VGood";
		break;
	default:
		//alert("Excellent  :: x > 30");
		// fr:: change the line below to suit your url
		URL = "/servlet/ContentServer?pagename=2ndLevel/Tools/2L_TeenQuiz_Excellent";
		}

	//alert(URL);
	//window.location.href=URL;
	document.teen_quiz_form.URL.value=URL;
}

function resetform(){
	// fr:: change the line below to suit your url
	document.teen_quiz_form.URL.value="/servlet/ContentServer?pagename=2ndLevel/SL_Tool/2L_d_tool&c=SL_Tool&cid=1067445338220";
	//document.teen_quiz_form.reset();
}

function resetform1(){
	document.budget_calculator_form.reset();
}

function calc_income(){
	Allowances = 0;
	Allowances = document.budget_calculator_form.Allowances.value;

	Salary = 0;
	Salary = document.budget_calculator_form.Salary.value;

	Over_time  = 0;
	Over_time = document.budget_calculator_form.Over_time.value;

	Additional_jobs = 0;
	Additional_jobs = document.budget_calculator_form.Additional_jobs.value;

	Other = 0;
	Other = document.budget_calculator_form.Other.value;
	
	income = (eval(parseFloat(Allowances) + parseFloat(Salary) + parseFloat(Over_time) + parseFloat(Additional_jobs) + parseFloat(Other) ));

	document.budget_calculator_form.B.value = income;
	diffrence();
	time_left();
}

function calc_outgoing(){
	DVDs = 0;
	DVDs = document.budget_calculator_form.DVDs.value;

	Clothes = 0;
	Clothes = document.budget_calculator_form.Clothes.value;

	Lunch_Money  = 0;
	Lunch_Money = document.budget_calculator_form.Lunch_Money.value;

	School_stuff = 0;
	School_stuff = document.budget_calculator_form.School_stuff.value;

	Magazines = 0;
	Magazines = document.budget_calculator_form.Magazines.value;

	Going_out = 0;
	Going_out = document.budget_calculator_form.Going_out.value;

	Concerts = 0;
	Concerts = document.budget_calculator_form.Concerts.value;

	Cinema = 0;
	Cinema = document.budget_calculator_form.Cinema.value;

	Savings = 0;
	Savings = document.budget_calculator_form.Savings.value;

	Bills = 0;
	Bills = document.budget_calculator_form.Bills.value;

	outgoing = (eval(parseFloat(DVDs) + parseFloat(Clothes) + parseFloat(Lunch_Money) + parseFloat(School_stuff) + parseFloat(Magazines)  + parseFloat(Going_out)  + parseFloat(Concerts)  + parseFloat(Cinema)  + parseFloat(Savings)  + parseFloat(Bills)));

	document.budget_calculator_form.C.value = outgoing;
	diffrence();
	time_left();
}

function diffrence(){
	document.budget_calculator_form.D.value = eval(parseFloat(document.budget_calculator_form.B.value) - parseFloat(document.budget_calculator_form.C.value));
}

function goto_location(){
	//alert(document.teen_quiz_form.URL.value);
	document.location.href=document.teen_quiz_form.URL.value;
}

function time_left(){
	E = eval(parseFloat(document.budget_calculator_form.GOAL.value) / parseFloat(document.budget_calculator_form.D.value));
	if (E > 0 ){
		document.budget_calculator_form.E.value = Math.round(E);
	}else{
		document.budget_calculator_form.E.value = "NaN";
	}
	
}