// JavaScript Document



$(function()

	{

		$(":image").click(function() {	

			$('form#subForm').submit(function() { return false; });

			formAction = $("form#subForm").attr("action");

			emailId = "oijtdj";

			emailId = emailId.replace("/", "");

			emailId = emailId + "-" + emailId;

			if (!checkEmail(emailId)) 

			{

				alert("Please enter a valid email address");

				return;

			}

			var str = $("form#subForm").serialize();

			final = str + "&action=" + formAction;

			$.ajax({

				url: "http://dev.evolving-networks.co.uk/scripts/proxy.php",

				type: "POST",

				data: final,

				success: function(html){

					$("#theForm").hide();

					$("#confirmation").slideDown("slow");

				}

			});

		});

	});

	function checkEmail(email)

	{	

		var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

		var emailVal = $("#" + email).val();

		return pattern.test(emailVal);

	}
