// JavaScript Document
function sendform() {
	var ans = false;
	var type = 0;
	if (document.getElementById('behind').value == 0) {
		if (document.getElementById('creditrating').selectedIndex == 1 || document.getElementById('creditrating').selectedIndex == 2) {
			type = 0;			
		}
		else if (document.getElementById('creditrating').selectedIndex == 3 || document.getElementById('creditrating').selectedIndex == 4) {
			ans = confirm('Based on your information, we can match you with Loan Modification professionals who may help you modify your existing loan. Click OK to be matched with loan modification professionals.');
			if (ans)
				type = 1;
		}
	}
	else {
		ans = confirm('Based on your information, we can match you with Loan Modification professionals who may help you modify your existing loan. Click OK to be matched with loan modification professionals.');
		if (ans)
			type = 1;
	}
	document.getElementById('changetype').value = type;
}
var temp_list = new Array();
function modifyBal(inp1, sel1) {
	
	
	len2 = temp_list.length;
	for (j=len2-1; j>=0; j--) {
		sel1.options.add(temp_list.pop());		
	}
	
	len1 = sel1.options.length;  
	
	for (i=len1-1;i>1 ;i-- )  {  
  	if (sel1.options[i].value > (0.9*inp1.value))  {  
			temp_list.push(sel1.options[i]);
			sel1.options[i] = null;  
  		//or  
  		//sel1.remove(i);  
    	//break;  
			//counter++;
  	}  
	}  
}
