// JavaScript Document


function submitAPIRs() {
	var compareLenders = document.compareLenders;
	var apirs = "";
	for (i=0; i < compareLenders.elements.length; i++) {
		if (compareLenders.elements[i].type == 'text') {
			var apir = compareLenders.elements[i].value;
			if (apir.length > 0) {
				if (apirs.length > 0) apirs = apirs + ",";
				apirs = apirs + apir;
			}
		}
	}
	
	if (apirs.length == 0) {
		alert("Error: no APIRs specified");
		return false;
	}
	
	newurl = '/compare-lenders/' + apirs + '/';
	//alert(newurl);
	window.location= newurl;
}


