var xmlhttp;

function loadXMLDoc(url) {
	xmlhttp = null;

	try { // code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp = new XMLHttpRequest();
	} catch (e) {

		try { // code for IE6, IE5
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	xmlhttp.onreadystatechange = state_Change;
	xmlhttp.open("GET", url, true);
	xmlhttp.send(null);
}

function state_Change() {
	if(xmlhttp.readyState == 4) { // 4 = "loaded"
		if(xmlhttp.status == 200) { // 200 = "OK"
			document.getElementById('content').innerHTML = xmlhttp.responseText;
		}
		else {
			alert("Problem retrieving data:" + xmlhttp.statusText);
		}
	}
}

function checkEmail(form) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = form.email.value;
   if(adress == 'your@email.com') {
      alert('Please enter your email adress!');
      return false;
   }
   else if(reg.test(address) == false) {
      alert('Please enter valid email adress!');
      return false;
   }
	else {
		return true;
	}
}

