jQuery(document).ready(function($) {
	// validate signup form on keyup and submit
	var validator = $("#bidrequest1").validate({
		rules: {
			name: "required",
			phone: "required",
			email: {
				required: true,
				email: true
			},
			address: "required",
			city: "required",
			jobDescription: "required"	
		},
		messages: {
			name: "Enter your first and last name",
			phone: "Enter your phone number",
			email: {
				required: "Please enter a valid email address",
				minlength: "Please enter a valid email address"
			},
			address: "Enter the job address",
			city: "Enter the job city",
			jobDescription: "Enter some info about the job"
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
				error.appendTo( element.next() );

		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function() {
			$("#dialog").dialog({
	   			bgiframe: true,
				modal: true,
				buttons: {
					Ok: function() {
						$(this).dialog('close');
					}
				}
			});
  			$("#BidRequestDialog").dialog('close');
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});
jQuery(document).ready(function($) {
	// validate signup form on keyup and submit
	var validator = $("#bidrequest2").validate({
		rules: {
			name: "required",
			phone: "required",
			email: {
				required: true,
				email: true
			},
			address: "required",
			city: "required",
			jobDescription: "required"	
		},
		messages: {
			name: "Enter your first and last name",
			phone: "Enter your phone number",
			email: {
				required: "Please enter a valid email address",
				minlength: "Please enter a valid email address"
			},
			address: "Enter the job address",
			city: "Enter the job city",
			jobDescription: "Enter some info about the job"
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
				error.appendTo( element.next() );

		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function() {
			$("#dialog").dialog({
	   			bgiframe: true,
				modal: true,
				buttons: {
					Ok: function() {
						$(this).dialog('close');
					}
				}
			});
  			$("#BidRequestDialog").dialog('close');
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});
jQuery(document).ready(function($) {
	// validate signup form on keyup and submit
	var validator = $("#contactform").validate({
		rules: {
			contactname: "required",
			contactemail: {
				required: true,
				email: true
			}		
		},
		messages: {
			contactname: "Enter your first and last name",
			contactemail: {
				required: "Please enter your email address",
				minlength: "Please enter a valid email address"
			}
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
				error.appendTo( element.next() );

		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function() {
			$("#dialog").dialog({
	   			bgiframe: true,
				modal: true,
				buttons: {
					Ok: function() {
						$(this).dialog('close');
					}
				}
			});
  			$("#BidRequestDialog").dialog('close');
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});

		
		
jQuery(document).ready(function($) {		
		$('#RequestBid').click(function() {
			$('#BidRequestDialog').dialog('open');
		})
		});
jQuery(document).ready(function($) {		
		$("#BidRequestDialog").dialog({
			bgiframe: true,
			autoOpen: false,
			height: 650,
			width:750,
			modal: true,
			buttons: {
				Cancel: function() {
					$(this).dialog('close');
				}
			}
		});
	});