function signUp() 
{ 

	new Ajax.Request('emails/add/',
				{
					method: 'post',
					postBody: '&email=' + $F('email') + '&zip=' + $F('zip'),
					onComplete: function(tl) {
						if (tl.responseText.indexOf('success') != -1) {
							location.href = baseURL + 'data/module/emails/info';
						} else {
							if (tl.responseText != '') alert(tl.responseText);
						}
						
					}
				}
			);
}
	
var Site = {

		// Set some object wide variables
		// Initialisation function
		start : function() {
			if ($('signup_bt')) {
				Site.behaviour();
			}
		},
		
		// Use CSS selectors to assign page behaviours
		behaviour : function() {
		
			$('signup_bt').onclick = function() {
				signUp();
			}
			$('email').onfocus = function() {
				if ($F('email') == "email") {
					$('email').value = "";
				}
			}
			$('email').onblur = function() {
				if ($F('email') == "") {
					$('email').value = "email";
				}
			}
			$('zip').onfocus = function() {
				if ($F('zip') == "zip") {
					$('zip').value = "";
				}
			}
			$('zip').onblur = function() {
				if ($F('zip') == "") {
					$('zip').value = "zip";
				}
			}
		}
}

document.observe('dom:loaded', Site.start);	
