// validation for form
// BEGIN ***************************************************************************************
function validate(img, ans_1, email) {
	// is checking for which img was displayed
	switch (img) {
		case 0:
			ans_2 = 4;
			break;
		case 1:
			ans_2 = 5;
			break;
		case 2:
			ans_2 = 5;
			break;
		case 3:
			ans_2 = 4;
			break;
		case 4:
			ans_2 = 2;
			break;
		case 5:
			ans_2 = 2;
			break;
	}
	// checks for valid email address and then if question was answered correctly
	if ((email.indexOf(".") > 2) && (email.indexOf("@") > 0)) {
		if (ans_2 == ans_1) {
			document.contact.verify.value = 'yes';
			document.contact.submit();
		} else {
			alert('The human verification question is incorrect!  Please try again.');
		}
	} else {
		alert('Your email seems to be incorrect or missing.  Please try typing it again.');
	}
}
// END *****************************************************************************************

// [Begin] iframe auto height adjust *********************************************************************************************
function setIframe() {
var elem_ht = document.getElementById("dummy").offsetHeight+300;
if (elem_ht < 1050) elem_ht=1050;
document.getElementById("container").innerHTML = "<iframe frameborder=\"0\" id=\"iframe\" src=\"http://idx.filogix.com/idx/NEAB/search_residential_submit.html?key=111494.1089961\" style=\"height:"+elem_ht+"px; width:772px; background:white;\" scrolling=\"no\"></iframe>";
}

function hideDIV() {
document.getElementById("dummy").style.visibility = "hidden";	
}
// [End] iframe auto height adjust *********************************************************************************************