document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"><\/script>');
document.write('<script type="text/javascript" src="/customcf/vExpanderItem.js"><\/script>');
document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/effects.js"><\/script>');
document.write('<script type="text/javascript" src="/cob/customcf/Tween.js"><\/script>');
document.write('<script type="text/javascript" src="/cob/customcf/opacityTween.js"><\/script>');
document.write('<script type="text/javascript" src="/cob/customcf/lightbox.js"><\/script>');

// undergraduate index
// Element.observe(window, "load", function() {
// 	if ($("imageSwap")) {
// 		var image = $("imageSwap");
// 		image.observe("mouseover", function(event) {
// 			image.src = "/cob/undergraduate/images/bizwire_on.jpg";	
// 		});
// 		image.observe("mouseout", function(event) {
// 			image.src = "/cob/undergraduate/images/bizwire_off.jpg";
// 		});
// 	}
// });

// admissions self check
function pastcatalogs() {
	document.getElementById("catalog").innerHTML = "0"
	document.getElementById("catalog2").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/past-catalogs.gif' alt='Past Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog3").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/past-catalogs.gif' alt='Past Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog4").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/past-catalogs.gif' alt='Past Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog5").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/past-catalogs.gif' alt='Past Catalogs' width='100' height='125' border='0'>"
	cobgpachecker()
	gpachecker()
	page2()
}
function futurecatalogs() {
	document.getElementById("catalog").innerHTML = "1"
	document.getElementById("catalog2").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/06-07catalog.gif' alt='Future Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog3").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/06-07catalog.gif' alt='Future Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog4").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/06-07catalog.gif' alt='Future Catalogs' width='100' height='125' border='0'>"
	document.getElementById("catalog5").innerHTML = "<br /><strong>Catalog</strong><br /><img src='/cob/images/admission/06-07catalog.gif' alt='Future Catalogs' width='100' height='125' border='0'>"
	cobgpachecker()
	gpachecker()
	page2()
}

//Page 2 Check your resident GPA

function gpachecker() {
	
	//Grab Values
	var startinggpa = document.getElementById("startinggpa").value;
	if( startinggpa == "" ) { startinggpa = 0 }
	
	
	var startingcredits = document.getElementById("startingcredits").value;
	if( startingcredits == "" ) { startingcredits = 0 }

	var sel = document.getElementById("class1grade");
	var class1grade = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class2grade");
	var class2grade = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class3grade");
	var class3grade = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class4grade");
	var class4grade = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class5grade");
	var class5grade = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class6grade");
	var class6grade = sel.options[sel.selectedIndex].value;
	
	var sel = document.getElementById("class1credits");
	var class1credits = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class2credits");
	var class2credits = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class3credits");
	var class3credits = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class4credits");
	var class4credits = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class5credits");
	var class5credits = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("class6credits");
	var class6credits = sel.options[sel.selectedIndex].value;

	//Convert values to numbers

	var startinggpa=parseFloat(startinggpa);
	var startingcredits=parseFloat(startingcredits);
	var class1grade=parseFloat(class1grade);
	var class2grade=parseFloat(class2grade);
	var class3grade=parseFloat(class3grade);
	var class4grade=parseFloat(class4grade);
	var class5grade=parseFloat(class5grade);
	var class6grade=parseFloat(class6grade);
	var class1credits=parseFloat(class1credits);
	var class2credits=parseFloat(class2credits);
	var class3credits=parseFloat(class3credits);
	var class4credits=parseFloat(class4credits);
	var class5credits=parseFloat(class5credits);
	var class6credits=parseFloat(class6credits);
	
	//Total everything up
	
	var totalcredits=startingcredits+class1credits+class2credits+class3credits+class4credits+class5credits+class6credits;
	var totalpoints=startingcredits*startinggpa + class1credits*class1grade + class2credits*class2grade + class3credits*class3grade + class4credits*class4grade + class5credits*class5grade + class6credits*class6grade;

	//Figure out what the feedback will be
	
	var resgpa = (totalpoints/totalcredits)
	
	if(totalcredits < 54) {
		var feedback="you would not be admitted to the College of Business because you must have at least 54 credits"
	} else {
		if(resgpa < 2.3) {
			var feedback="you would not be admitted because your resident GPA must be at least a 2.3"
		} else {
			var feedback="you would be admitted to the College of Business"
		}
	}

	//Display feedback or lack there of

	if(totalcredits != 0 && totalpoints != 0 ) {
		document.getElementById("nextpageone").style.display = "block"
		document.getElementById("feedbackone").innerHTML = "Based on the information provided your GPA would be " + Math.round(1000*(totalpoints/totalcredits))/1000 + " and you'll have " + totalcredits + " total credits at the end of the semester.  This means that " + feedback;
	} else {
				document.getElementById("nextpageone").style.display = "none"
				document.getElementById("feedbackone").innerHTML = ""
			}

}

//page 3, check your college of business GPA

function cobgpachecker() {

	var sel = document.getElementById("Acct201g");
	var Acct201g = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("Acct202g");
	var Acct202g = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("Econ103g");
	var Econ103g = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("Econ104g");
	var Econ104g = sel.options[sel.selectedIndex].value;
	var sel = document.getElementById("Mis240g");
	var Mis240g = sel.options[sel.selectedIndex].value;
	
	var Acct201g=parseFloat(Acct201g);
	var Acct202g=parseFloat(Acct202g);
	var Econ103g=parseFloat(Econ103g);
	var Econ104g=parseFloat(Econ104g);
	var Mis240g=parseFloat(Mis240g);
	
	var lg=0
	
	if(Acct201g <= 1.667) { lg++ }
	if(Acct202g <= 1.667) { lg++ }
	if(Econ103g <= 1.667) { lg++ }
	if(Econ104g <= 1.667) { lg++ }
	if(Mis240g <= 1.667) { lg++ }
	
	var cobgpa= (Math.round(1000*((Acct201g+Acct202g+Econ103g+Econ104g+Mis240g)/5)))/1000;
	
	if (document.getElementById("catalog").innerHTML == 0 ) {
		if(lg>1) {
			thismeans="you would not be admitted because you can not have more then one 'C-' or lower.";
			} else {
			if(lg==1) {
				if(cobgpa>=2.4) {
					thismeans="you would be admitted.";
					} else {
					thismeans="you would not be admitted because you need to get a GPA of 2.4 if you have a grade below a 'C-'.";
				}
			} else {
				if(cobgpa>=2.2) {
					info="you would be admitted.";
					} else {
					thismeans = "you would not be admitted because you must have at least a 2.2 GPA between the five courses.";
				}
			}
		}
	}

	if (document.getElementById("catalog").innerHTML == 1 ) {
		if(cobgpa>=2.2) {
			thismeans="you would be admitted.";
		} else {
			thismeans = "you would not be admitted because you must have at least a 2.2 GPA between the five courses.";
		}
	}
	
	
	
	if(Acct201g != 0 && Acct202g != 0 && Econ103g != 0 && Econ104g != 0 && Mis240g != 0) {
		document.getElementById("nextpagetwo").style.display = "block"
		document.getElementById("feedbacktwo").innerHTML = "Based on the information provided your College of Business GPA would be " + cobgpa + ". This means that " + thismeans;
	} else {
		document.getElementById("nextpagetwo").style.display = "none"
		document.getElementById("feedbacktwo").innerHTML = ""
	}

	
}
