//var sentemailaweber = false;

//Init 'Unobtrusive' JavaScript
addEvent(window, 'load', function() {
/*
	if ($("leadform") != null) {
		//On email blur (ie email entered)
		$("email").onblur = function() {
			sendemail_aweber($("email").value, $("email").value)
		}
	}

	if ($("contactform") != null) {
		//On email blur (ie email entered)
		$("contact_email").onblur = function() {
			sendemail_aweber($("contact_name").value, $("contact_email").value)
		}
	}
*/
});


//Subscribe to aweber list
function sendemail_aweber(name, email) {

	//If email specified
	if (email.length != 0) {

		//If have not already sent email
		//if (sentemailaweber == false) { //**************

			//Set aweber form target to the iframe
			$("aweberfrm").target = "aweberiframe";

			//Pass the aweber form the email address
			$("aweber_from").value = email;

			//Pass the aweber form the name
			$("aweber_name").value = name;

			//Post data to the iframe
			$("aweberfrm").submit();

		//}

	}

}

