function mInfoSubmit(){
sendMessage="y"
if (document.getElementById("mInfoEmail").value == ""){
	alert("You must enter an address to request additional information.")
	sendMessage="n"
}
if (document.getElementById("mInfoName").value == "" && sendMessage=="y"){
	alert("You must enter your name to request additional information.")
	sendMessage="n"
}
// check email address validity
if(!check_email(document.getElementById("mInfoEmail").value) && sendMessage=="y"){
alert("You must enter a valid email address to request additional information.");
document.getElementById("mInfoEmail").focus();
sendMessage="n"
} 
if (sendMessage == "y"){
	urlString="http://"+document.domain+"/idx/sendMoreInfoMessage.php?cid="+document.getElementById("mInfoClientID").value
	if (document.getElementById("mInfoInterestLevel").checked){
		urlString=urlString+"&mInfoInterestLevel=Y"
	} else {
		urlString=urlString+"&mInfoInterestLevel=N"
	}
	urlString=urlString+"&aid="+document.getElementById("mInfoAgentID").value
	urlString=urlString+"&mInfoName="+escape(document.getElementById("mInfoName").value)
	urlString=urlString+"&mInfoMessage="+escape(document.getElementById("mInfoMessage").value)
	urlString=urlString+"&mInfoEmail="+escape(document.getElementById("mInfoEmail").value)
	urlString=urlString+"&mInfoPhone="+escape(document.getElementById("mInfoPhone").value)
	urlString=urlString+"&mInfoListingNumber="+document.getElementById("mInfoListingNumber").value
	urlString=urlString+"&mInfoListPrice="+document.getElementById("mInfoListPrice").value
	urlString=urlString+"&mInfoListCity="+document.getElementById("mInfoListCity").value
	urlString=urlString+"&mInfoListThumb="+escape(document.getElementById("mInfoListThumb").value)
	urlString=urlString+"&mInfoListBID="+escape(document.getElementById("mInfoListBID").value)
	urlString=urlString+"&mInfoSty="+document.getElementById("mInfoSty").value
	thisURL=document.URL
	thisURL=thisURL.substr(0,thisURL.indexOf("cid"))
	thisURL=thisURL+"cid="+document.getElementById("mInfoClientID").value
	thisURL=thisURL+"&aid="+document.getElementById("mInfoAgentID").value
	urlString=urlString+"&mInfoURL="+escape(thisURL)
	document.getElementById("mInfoIframe").src=urlString
	//window.open(urlString)
}
}
function mInfoResponse(code){
if (code=="Mail sent"){
		document.getElementById("emailResponse").innerHTML="<font color='#ff0000'><b>Thank you for your request.</b><br><br>Your request for additional information has been received and will be replied to shortly.</font>"
		document.getElementById("mInfoName").value=""
		document.getElementById("mInfoPhone").value=""
		document.getElementById("mInfoEmail").value=""
		document.getElementById("mInfoMessage").value=""
}else {
	document.getElementById("emailResponse").innerHTML="<font color='#ff0000'>There has been an error in sending your request. If you continue to get this error please call the office for your additional information.</font>"
}
}
