﻿jQuery(function() {
		// show a simple loading indicator
		var loader = jQuery('<div id="loader"><img src="administrator/themes/graphista/html/images/loading.gif" alt="loading..." /></div>')
			.css({position: "absolute", top: "800px", left: "400px"})
			.appendTo("body")
			.hide();
		jQuery().ajaxStart(function() {
			loader.show();
			$("#comshow").fadeTo("slow", 0.1);
		}).ajaxStop(function() {
			loader.hide();
			$("#comshow").show();
		}).ajaxError(function(a, b, e) {
			throw e;
		});
		var v = jQuery("#commentform").validate({
			submitHandler: function(form) {
				jQuery(form).ajaxSubmit({
					target: "#result"
				});
			}
		});
		jQuery("#reset").click(function() {
			v.resetForm();
		});
	});
