
function turngreen(varLi, varInput) {

	var boxLi = document.getElementById(varLi);
		
	if (document.grantNloan[varInput].checked) {
		boxLi.style.backgroundColor = "#c5dfc3";
	} 	
	else {
		boxLi.style.backgroundColor = "transparent";
	}
}


function turnallwhite() {
	
	var searchform = document.getElementById("searchform");
	
	var listItems = grantNloan.getElementsByTagName("li");
	
	for (var i = 0; i < listItems.length; i++){
		listItems[i].style.backgroundColor = "transparent";
	}
	
}
function turnallwhite2() {
	
	var searchform = document.getElementById("searchform");
	
	var listItems = grantNloan.getElementsByTagName("li");
	
	for (var i = 0; i < listItems.length; i++){
		listItems[i].style.backgroundColor = "transparent";
	}
	
}

function turngreenX() {
	// Fix the "undefined" error here seems we dont' have a 14th question? - FL
	// modified so that the whole document items are spelled out. -- S.C 
	for(i=0; i<document.grantNloan.elements.length; i++)
	{
		if(document.grantNloan.elements[i].checked)
		{
			var boxLi = document.getElementById("question"+(i+1));
			boxLi.style.backgroundColor = "#c5dfc3";	
		}
	} 	
}

function resetX() {
	// modified so that the whole document items are spelled out. -- S.C
	document.grantNloan["business_type"].value = "for_profit";
	document.grantNloan["name"].value = "0";
	document.grantNloan["state_name"].value = "0";
	
	for(i=0; i<document.grantNloan.elements.length; i++)
	{	
		var boxLi = document.getElementById("question"+(i+1));
		if(boxLi!=null){
			boxLi.style.backgroundColor = "transparent";	
			document.grantNloan.elements[i].checked= false;	
		}			
	}
}
function resetS() {
	document.grantNloan.reset();
	for(i=0; i<document.grantNloan.elements.length; i++)
	{
		
			document.getElementById("question" + i).style.backgroundColor = "transparent";
			document.grantNloan.elements[i].checked= false;	
		
	}
}