// jQuery's function launched when everything is ready
$(document).ready(function() {
	
	// Focus first field
	$('#synonym').focus();
		
	
	// Attaches desired validation to form elements
	$("#survey").validate({
	    
	    errorElement: "p",
	    
	    errorPlacement: function(error, element) {
           element.parent().before(error);
        },
	    
		rules: {
			synonym: {
                required: true
//                remote: "/dicktionary/validator"
            },
            email: {
            	email: true
            }
	   },
	   
	   //onkeyup: true, // do not validate on every keystroke
	   //onfocusout: true
					  
	});
	
	
	// Make sure only numbers or letters are entered for the name(using jQuery
    // AlphaNumeric plug-in)
    $('#submittedBy').alphanumeric({allow:"., ()*&?%$#@!_-+="});
	   
}); // end ready