$(document).ready(function() { 
    $('#f2fFromMessage').css("display","none");
    $("#f2fFromMessage-label").click(function () { $("#f2fFromMessage").toggle(); });

    $("#f2f").ajaxForm({beforeSubmit: validateForwarding, success: showResponse, resetForm: true}); 

    function showResponse() {
        $("#f2f-feedback").replaceWith("<p id='f2f-feedback' class='feedback-positive'>Thanks for sharing!<\/p>");
    }

    function validateForwarding(formData, jqForm, options) {
        for (var i=0; i < formData.length; i++) { 
             if (formData[i].name == "__F2F__fromMessage"){
             }
             else if (formData[i].value == "" || formData[i].value == "Your email address" || formData[i].value == "Separate multiple addresses with commas") { 
                $("#f2f-feedback").replaceWith("<p id='f2f-feedback' class='feedback-negative'>Check your email address and the recipients<\/p>");
                return false; 
            } 
        } 
    }

	$("#f2f input.text").toggleVal();
	$("#searchForm input.text").toggleVal();
	$("#login input.emailAddress").toggleVal();
	$("#login input.password").toggleVal();
	$("#donate input.amount").toggleVal();	
	
}); 
