function goto_URL(Object) {
	window.location.href = object.options[object.selectedIndex].value;
}

function showImg(imgName, imgState) {
	document.images[imgName].src = eval(imgName + imgState + ".src");
}

function changeBG(whichOne, whichColor) {
	whichOne.bgColor = whichColor;
}

function contactReady() {
	var ok = true;
	
	if (isName(document.form1.name.value) == false) {
		alert(sContError1);
		document.form1.name.focus();
		ok = false;
	}
	
	if (ok == true) {
		if (isEmail(document.form1.email.value) == false) {
			alert(sContError2);
			document.form1.email.focus();
			ok = false;
		}
	}
	
	if (ok == true) {
		if (document.form1.question.value == "") {
			alert(sContError3);
			document.form1.question.focus();
			ok = false;
		}
	}
	
	if (ok == true) {
		document.form1.submit();
	}
}

function sendMLS() {
	if (document.mlsForm.mlsnum.value != "") {
		document.mlsForm.submit();
	}
	else {
		document.mlsForm.mlsnum.focus();
	}
}

function isEmail(str) {
	if (!str) return false;
	var iChars = "?*|,\":<>[]{}`\+=';()&$#%";
	
	for (var i=0; i < str.length; i++) {
		if (iChars.indexOf(str.charAt(i)) != -1)
			return false;
	}
	
	if (str.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
		return true;
	}
	else {
		return false;
	}
}

function isName(str) {
	if (!str) return false;
	var iChars = "?*|,\":<>[]{}`\+=;()@&$#%1234567890";
	
	for (var i=0; i < str.length; i++) {
		if (iChars.indexOf(str.charAt(i)) != -1)
			return false;
	}
	
	return true;
}

