
//function switchformfield(varSelectionValue,varTargetField,varTargetValue)
function switchformfield(varSelectionField,varSelectionValue)
{
	if ( varSelectionField == "language" ) {
		if ( varSelectionValue == "All Languages" ) {
			document.forms["resourcessearchform"].elements["category"].style.color = "#000000";
			document.forms["resourcessearchform"].elements["category"].style.backgroundColor = "#ffffff";
		} else if ( varSelectionValue == "English" ) {
			document.forms["resourcessearchform"].elements["category"].style.color = "#000000";
			document.forms["resourcessearchform"].elements["category"].style.backgroundColor = "#ffffff";
		} else {
			document.forms["resourcessearchform"].elements["category"].value = "multilingual_resources";
			document.forms["resourcessearchform"].elements["category"].style.color = "#666666";
			document.forms["resourcessearchform"].elements["category"].style.backgroundColor = "#eeeeee";
			alert(varSelectionValue + ' resources are only available in the multilingual information sheets category.')
		}
	}
}

function confirmResources() {
	var f = document.forms["rafflebookorderform"];
	var m = "";
	//alert("f=" + f);
	//alert("f.resourcescount.value=" + f.resourcescount.value);
	//alert("f=" + f + " count=" + f.resourcescount.value);
	if ( f.resourcescount.value ) {
		for (var i=0; i<=f.resourcescount.value; i++) {
			if ( f.elements["Field015n" + i] ) {
				fname = f.elements["Field015n" + i].value;
			} else {
				fname = "";
			}
			if ( f.elements["Field015v" + i] ) {
				fval = f.elements["Field015v" + i].value;
			} else {
				fval = 0;
			}
			if ( fval && fval > 0 ) {
				m += fval + "\t" + fname + "\n";
			}
		}
		if ( m != "" ) {
			m = "You Selected the Following Quantity of Resources:\n" + m + "\n\nClick OK to Submit an Order Form";
			return confirm(m);
		} else {
			return true;
		}
	} else {
		return true;
	}
}

