<!--
	function subscribe() {
		var img = document.getElementById('subscribe_img');
		var img2 = document.getElementById('subscribe_image');
		var email = document.getElementById('email').value;
		var text = document.getElementById('tmp_text');
		var xmlhttp;

		if (window.XMLHttpRequest) {
			// code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp = new XMLHttpRequest();
  	} else if (window.ActiveXObject) {
  		// code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	} else {
  		alert("Your browser does not support XMLHTTP!");
  	}
		xmlhttp.onreadystatechange=function() {
		}
		if (!isValid(email)) {
			alert('This is not a valid email address. Subscription failed');
			return;
		}
		// Ensure that this is a valid email address
		xmlhttp.open("GET", "subscribe.php?email=" + email, true);
		text.innerHTML = 'You are now subscribed to our mailinglist. You may unsubscribe at any time.';
		xmlhttp.send(null);
		img.src = 'images/ok.gif';
		img2.src= 'images/subscribed.gif';
		
	}
	function isValid(text) {
		var containsAt = false;
		var containsDot = false;
		for (var i = 0; i < text.length; i++) {
			if (!containsAt && text.charAt(i) == '@') {
				containsAt = true;
				continue;
			}
			if (containsAt && text.charAt(i) == '@') {
				containsAt = false;
			}
			if (!containsDot && text.charAt(i) == '.' && ( i == text.length - 4 || i == text.length - 3)) {
				containsDot = true;
			}
		}
		if (containsAt && containsDot) { 
			return true;
		} else {
			return false;
		}
	}	
// --> 
