$(function () {
	$.getScript("/assets/templates/default/scripts/jquery.csspngfix.src.js");

	if ($("div.feedback.form").length > 0) {
		CaptureSubmit();
		SetResetForm();
	}
});

/* -------------------------------------------------------------------------------- */

function CaptureSubmit () {
	$("div.feedback.form").find("form").submit(function () {
		var is_empty = false;

		$("div.feedback.form").find(".asterisk").each(function () {
			var val = $.trim($(this).val());
			if (val == "") {
				is_empty = true;
				$(this).addClass("error-input");
			}
		});

		if (is_empty) {
			return false;
		}

		return true;
	});
}

function SetResetForm () {
	$("div.feedback.form").find("input[type=button]").click(function () {
		$("div.feedback.form").find("input[type=text], select, textarea").each(function () {
			$(this).val("");
			$(this).removeClass("error-input");
		});
	});
}

/* -------------------------------------------------------------------------------- */

