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