$(document).ready(function() {
	if (document.images) {
		var h1 = newImage(SITE_URL + "images/homepage/youthadventure-on.png");
		var h2 = newImage(SITE_URL + "images/homepage/evolveacademy-on.png");
		var h3 = newImage(SITE_URL + "images/homepage/custom_family_bttn_on.png");
		var h3 = newImage(SITE_URL + "images/contact/send-message-on.png");

		preloadFlag = true;
	}
});


btnNewsletterSignUpSend_Click = function(btnSend)
{
	var txtEmail = document.getElementById("txtNewsletterEmail");

	if (txtEmail.value == "") { alert("Please enter valid e-mail addresses."); return; }

	var parameters = "";

	var ajax = getAJAXObject();

	if (ajax)
	{
		ajax.onreadystatechange = function() { if (ajax.readyState == 4) { alert(ajax.responseText); } }

		parameters  = "email=" + escape(txtEmail.value);

		ajax.open("POST", "/newsletterSignUpMail.php", true);
		ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax.setRequestHeader("Content-length", parameters.length);
		ajax.setRequestHeader("Connection", "close");

		ajax.send(parameters);

		txtEmail.value = "";
	}
	else
	{
		alert("Your browser does not support our scripts.  Please upgrade your browser.");
	}
}


function getAJAXObject()
{
	var xmlHttp;
	
	// Firefox, Opera 8.0+, Safari
	try { xmlHttp = new XMLHttpRequest(); }
	catch (e)
	{
		// Internet Explorer
		try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e)
		{
			try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

	return xmlHttp;
}
