// JavaScript Document
function OpenWindow ( url , title){
			var win;
			win = window.open( url, title, 'toolbar=no,menubar=no,status=no,width=320,height=240,resizable=no,scrollbars=no' );
			if( win != null ) { win.creator = win; }
		}
		
		
function popImage (name, title){
			var win;
		//	alert("testing");
		//	try{
			// javascript:void(0)"
			win = window.open( "/map.aspx", "kyabobomap","toolbar=no,menubar=no,status=no,width=596,height=730,resizable=no,scrollbars=no" );
		//	}catch(ex){}
			
			if( win != null ) {	
				win.creator = win;
			}			
}

function sendMail()
{
if(document.getElementById("name").value==""){
document.getElementById("themessage").innerHTML = "<font color='#990000'><strong>Please enter your name.</strong></font>"
document.getElementById("name").focus()
}else{
if(document.getElementById("email").value==""){
document.getElementById("themessage").innerHTML = "<font color='#990000'><strong>Please enter your email address.</strong></font>"
document.getElementById("email").focus()
}else{
if(document.getElementById("message").value==""){
document.getElementById("themessage").innerHTML = "<font color='#990000'><strong>Please enter a message.</strong></font>"
document.getElementById("message").focus()
}else{
if(document.getElementById("email").value.indexOf("@")<0||document.getElementById("email").value.indexOf(".")<0){
document.getElementById("themessage").innerHTML = "<font color='#990000'><strong>The email address you entered does not seem to be valid.</strong></font>"
document.getElementById("email").focus()
}else{



var xmlhttp =  new XMLHttpRequest();
thelocation = "sendmail.asp"

xmlhttp.open("POST", thelocation, true);




xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');



submitstring = "name=" + document.getElementById("name").value  + "&email=" + document.getElementById("email").value + "&phone=" + document.getElementById("phone").value + "&message=" + document.getElementById("message").value


xmlhttp.send(submitstring);

xmlhttp.onreadystatechange = function() {
	

    if (xmlhttp.readyState == 4) {

			if (xmlhttp.status == 200){
			document.getElementById("themessage").innerHTML = "<font color='#006633'><strong>Your message has been sent!</strong></font>"
			document.getElementById("contactForm").reset()
			}
		}
	}
}
}}}
}
