<!--
	function validateSpecificRequest() {
		document.frmSpecificRequest.submit();
	}
	
	function addToBasket() {
		$('#frmAddBasket').submit();
	}

	$(document).ready(function() {
		
		// Process specific fabric request
		// ===============================
		
		$("a#toggleSpecificRequest").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
					
					// Validate the form and submit.
					// =============================
					$("#frmSpecificRequest").bind("submit", function() {
						
							if ($("#fr_name").val().length < 1 || $("#fr_phone").val().length < 1 || $("#fr_email").val().length < 1 ) {
								$("#form_error").show();
								//$.fancybox.resize();
								return false;
							}
							
							
							if ( echeck($('#fr_email').val()) == false ) {
								if ( $('#isValidEmail').val() == 0 ) {
									$('#form_error').append('<p>Please enter a valid email address.</p>');
								}
								$("#form_error").show();
								$.fancybox.resize();
								$('#isValidEmail').val('1')
								return false;
							}
							
							$("#form_error").hide();
						
							$.fancybox.showActivity();
						
							$.ajax({
								type	: "POST",
								cache	: false,
								url		: "/requests/fabric-send.php",
								data	: $(this).serializeArray(),
								success: function(data) {
									$.fancybox.hideActivity;
									$.fancybox(data);
								}
							});
							
							setTimeout($.fancybox.close,4500);
						
							return false;
						});
				},
				'onClosed'		: function() {
				$("#form_error").hide();
			}
		});
		
		// Process newsletter request
		// ===============================
		
		$("a.toggleNewsletterRequest").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
					
					// Validate the form and submit.
					// =============================
					$("#frmNewsletter").bind("submit", function() {
						
							if ($("#n_name").val().length < 1 || $("#n_email").val().length < 1 ) {
								$("#form_error").show();
								//$.fancybox.resize();
								return false;
							}
							
							
							if ( echeck($('#n_email').val()) == false ) {
								if ( $('#isValidEmail').val() == 0 ) {
									$('#form_error').append('<p>Please enter a valid email address.</p>');
								}
								$("#form_error").show();
								$.fancybox.resize();
								$('#isValidEmail').val('1')
								return false;
							}
							
							$("#form_error").hide();
						
							$.fancybox.showActivity();
						
							$.ajax({
								type	: "POST",
								cache	: false,
								url		: "/requests/newsletter-send.php",
								data	: $(this).serializeArray(),
								success: function(data) {
									$.fancybox.hideActivity;
									$.fancybox(data);
								}
							});
							
							setTimeout($.fancybox.close,4500);
						
							return false;
						});
				},
				'onClosed'		: function() {
				$("#form_error").hide();
			}
		});


		// Process measuring service request
		// =================================
		$("a#toggleMeasurementRequest").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
					
					// Validate the form and submit.
					// =============================
					$("#frmMeasuringRequest").bind("submit", function() {

							if ($("#m_name").val().length < 1 || $("#m_phone").val().length < 1 || $("#m_email").val().length < 1 ) {
								$("#form_error").show();
								//$.fancybox.resize();
								return false;
							}
							
						
							if ( echeck($('#m_email').val()) == false ) {
								if ( $('#isValidEmail').val() == 0 ) {
									$('#form_error').append('<p>Please enter a valid email address.</p>');
								}
								$("#form_error").show();
								$.fancybox.resize();
								$('#isValidEmail').val('1')
								return false;
							}

							if ( $('#m_service_required').val().length == 0 ) {
								if ( $('#isSelected').val() == 0 ) {
									$('#form_error').append('<p>Please choose a measuring service.</p>');
								}
								$("#form_error").show();
								$.fancybox.resize();
								$('#isSelected').val('1')
								return false;
							}

							$("#form_error").hide();
						
							$.fancybox.showActivity();
						
							$.ajax({
								type	: "POST",
								cache	: false,
								url		: "/requests/measure-send.php",
								data	: $(this).serializeArray(),
								success: function(data) {
									$.fancybox.hideActivity;
									$.fancybox(data);
								}
							});
							
							setTimeout($.fancybox.close,4500);
						
							return false;
						});
				},
				'onClosed'		: function() {
				$("#form_error").hide();
			}
		});
		
		
		// Process other services request
		// =================================
		$("a.toggleServicesRequest").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
					
					// Validate the form and submit.
					// =============================
					$("#frmServicesRequest").bind("submit", function() {

							if ($("#s_name").val().length < 1 || $("#s_phone").val().length < 1 || $("#s_email").val().length < 1 ) {
								$("#form_error").show();
								//$.fancybox.resize();
								return false;
							}
							
						
							if ( echeck($('#s_email').val()) == false ) {
								if ( $('#isValidEmail').val() == 0 ) {
									$('#form_error').append('<p>Please enter a valid email address.</p>');
								}
								$("#form_error").show();
								$.fancybox.resize();
								$('#isValidEmail').val('1')
								return false;
							}

							$("#form_error").hide();
						
							$.fancybox.showActivity();
						
							$.ajax({
								type	: "POST",
								cache	: false,
								url		: "/requests/services-send.php",
								data	: $(this).serializeArray(),
								success: function(data) {
									$.fancybox.hideActivity;
									$.fancybox(data);
								}
							});
							
							setTimeout($.fancybox.close,4500);
						
							return false;
						});
				},
				'onClosed'		: function() {
				$("#form_error").hide();
			}
		});


		// Process commercial projects request
		// ===================================
		$("a#toggleCommercialRequest").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
				
				// Validate the form and submit.
				// =============================
				$("#frmCommercialRequest").bind("submit", function() {
					
						if ($("#com_name").val().length < 1 || $("#com_phone").val().length < 1 || $("#com_email").val().length < 1 ) {
							$("#form_error").show();
							//$.fancybox.resize();
							return false;
						}
						
						
						if ( echeck($('#com_email').val()) == false ) {
							if ( $('#isValidEmail').val() == 0 ) {
								$('#form_error').append('<p>Please enter a valid email address.</p>');
							}
							$("#form_error").show();
							$.fancybox.resize();
							$('#isValidEmail').val('1')
							return false;
						}
						
						$("#form_error").hide();
					
						$.fancybox.showActivity();
					
						$.ajax({
							type	: "POST",
							cache	: false,
							url		: "/requests/commercial-send.php",
							data	: $(this).serializeArray(),
							success: function(data) {
								$.fancybox.hideActivity;
								$.fancybox(data);
							}
						});
						
						setTimeout($.fancybox.close,4500);
					
						return false;
					});
			},
			'onClosed'		: function() {
				$("#form_error").hide();
			}
		});
		
		$("a#toggleFabricCalculator").fancybox({
			'hideOnContentClick': false,
			'autoDimensions':	true,
			'width'			:	580,
			'height'		:	600,
			'padding'		:	0,
			'margin'		:	0,
			'scrolling'		:	'no',
			'overlayColor'	:	'#fff',
			'overlayOpacity':	0.8,
			'overlayShow'	:	true,
			'onComplete'	:	function() {
				
				// Validate the form and submit.
				// =============================
				$("#frmCommercialRequest").bind("submit", function() {
					
						if ($("#com_name").val().length < 1 || $("#com_phone").val().length < 1 || $("#com_email").val().length < 1 ) {
							$("#form_error").show();
							//$.fancybox.resize();
							return false;
						}
						
						
						if ( echeck($('#com_email').val()) == false ) {
							if ( $('#isValidEmail').val() == 0 ) {
								$('#form_error').append('<p>Please enter a valid email address.</p>');
							}
							$("#form_error").show();
							$.fancybox.resize();
							$('#isValidEmail').val('1')
							return false;
						}
						
						$("#form_error").hide();
					
						$.fancybox.showActivity();
					
						$.ajax({
							type	: "POST",
							cache	: false,
							url		: "/requests/commercial-send.php",
							data	: $(this).serializeArray(),
							success: function(data) {
								$.fancybox.hideActivity;
								$.fancybox(data);
							}
						});
						
						setTimeout($.fancybox.close,4500);
					
						return false;
					});
			},
			'onClosed'		: function() {
				$("#form_error").hide();
			}
		});
	});
-->
