// Parsing The Querystring with Javascript
// By Peter A. Bromberg, Ph.D.
// http://www.eggheadcafe.com/articles/20020107.asp
function quicksubscribe() {
    window.location = "http://service.govdelivery.com/service/multi_subscribe.html?code=MIOESF&login=" + document.getElementById("email_subscribe").value + "&origin=http://www.cityofsouthfield.com";
}


$(document).ready(function () {
    // Global "Enter" keypress override of default <form> action to submit.
	$("input").keypress(function(event) {
		if (event.which === 13)
		{
			event.preventDefault();
		}
	});
	
	$("#email_subscribe").keypress(function(event) {
		if (event.which === 13)
		{
			quicksubscribe();
		}
	});
	
	//Search  text fix
	$("#subscribe input[type*='text']").val("Enter e-mail for updates");
    $("#subscribe input[type*='text']").focus(function() {
        if ($("#subscribe input[type*='text']").val() == "Enter e-mail for updates") {
            $("#subscribe input[type*='text']").val("");
        }
    });
    $("#subscribe input[type*='text']").blur(function() {
        if ($("#subscribe input[type*='text']").val() == "") {
            $("#subscribe input[type*='text']").val("Enter e-mail for updates");
        }
    });
});