
/**
 * Post the "Was this information helpful?" form using AJAX and display a 
 * success message. This script does not read the server's response after the 
 * form has been posted - so errors are just ignored.
 *
 * Requires: JQuery
 */
var PageRatings = {
	FORM_ACTION: "/_assets/php/page-ratings-wrapper_form.php",
	SUCCESS_MESSAGE: "<div id=\"evaluation\" class=\"evaluation\"><h3>Your feedback has been submitted. </h3> <p>Thank you for your comments; they will be considered for future improvements.</p></div>",
	DEBUG: false,
	
	vote: function(number) {
		var data = {
			Vote: number,
			url: document.location.toString(),
			return_url: document.location.toString()
		};
		/* $.post(this.FORM_ACTION, data, this._callback, "html"); */
		
		$.post("/_assets/php/page-ratings-wrapper_form.php", $("#feedbackForm").serialize());
		
		// Show the success message
		$(".evaluation").hide();
		$(".thankyou").append(this.SUCCESS_MESSAGE);
	},
	
	_callback: function(response, status) {
		if (PageRatings.DEBUG) {
			alert("Response: " + response + "\n\n" + "Status: " + status);
		}
	}
};

function valbutton(feedbackForm) {


   
        PageRatings.vote(1);


}









