﻿var contact = new function () {
	this.init = function () {
		var $form = $('#ContactRequestForm');


		//setup all the in-textbox labels
		$('#ContactRequestForm :text').jLabel();
		$('textarea').jLabel().siblings('label').css('top', '-96px');

		$form.submit(function () {
			if ($form.valid()) {
				$form.ajaxSubmit({
					type: 'POST',
					dataType: 'html',
					resetForm: true,
					success: function (html) {
						$('.contact-us-lf').html(html);
					},
					error: function (a, b, c) {
						$('#error-summary').slideDown(200);
					}
				});
			}
			return false;
		});
	}
};
