/*///////////////////////////////////////////////////////////////////////Ported to jquery from prototype by Joel Lisenby (joel.lisenby@gmail.com)http://joellisenby.comoriginal prototype code by Aarron Walter (aarron@buildingfindablewebsites.com)http://buildingfindablewebsites.comModified by Lee Tengum (ThatLeeGuy => lee@thatleeguy.com)http://thatleeguy.comDistrbuted under Creative Commons licensehttp://creativecommons.org/licenses/by-sa/3.0/us////////////////////////////////////////////////////////////////////////*/$(document).ready(function() {	$('#signup').submit(function() {		// update user interface		$('#response').html('Adding email address...');		$('#submit').attr('disabled',true);								email_address = $('#mce-EMAIL');           		email_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;           		if(!email_regex.test(email_address.val())){		    valid = false;		    $('#response').html("Not a valid email address");		}				else if($("#mce-SIF_CITY").val() == '--'){				valid = false;				$('#response').html("You need to choose a city");		} else {		// Prepare query string and send AJAX request		$.ajax({			url: '/signup/manage/submit/',			data: 'ajax=true&email=' + escape($('#mce-EMAIL').val())+ '&city=' + escape($('#mce-SIF_CITY').val()),			success: function(msg) {				$('#response').html(msg);					$.cookie("sif_city", escape($('#mce-SIF_CITY').val().toLowerCase()), { expires : 365 });					$.cookie("sif_email", 'Y', { expires : 365 });					$.cookie("sif_noredirect", 'Y', { expires : 365 });					$.cookie("sif_firstvisit", 'Y', { expires : 365 });									window.location.replace("http://www.saveitforward.com/deals/"+ escape($('#mce-SIF_CITY').val().toLowerCase()));							}		});			}			return false;	});});
