/*

// add new effect to the tabs
$.tools.tabs.addEffect("slide", function(i, done) {

	// 1. upon hiding, the active pane has a ruby background color
	this.getPanes().slideUp().css({backgroundColor: "#b8128f"});

	// 2. after a pane is revealed, its background is set to its original color (transparent)
	this.getPanes().eq(i).slideDown(function()  {
		$(this).css({backgroundColor: 'transparent'});

		// the supplied callback must be called after the effect has finished its job
		done.call();
	});
});*/


$(".product_tabs").tabs(".product_tabs div", {tabs: 'h2.h1_banner', effect: 'slide', initialIndex: 0});


//Contact Form Validation

jQuery.validator.addMethod('phoneUK', function(phone_number, element) {
return this.optional(element) || phone_number.length > 9 &&
phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
}, 'Must be a valid phone number.');

$("#contact").validate({

	rules: {
		fromName: "required",
		email: {
			required: true,
			email: true
		},
		emailconf: {
			required: true,
			equalTo: "#email"
		},
		phone: "phoneUK",
		message: "required",
		recaptcha_response_field: "required"
	}

});

$("#newsletter").validate({

	rules: {
		fromName: "required",
		email: {
			required: true,
			email: true
		},
		emailconf: {
			required: true,
			equalTo: "#email"
		},
		recaptcha_response_field: "required"
	}

});

$(document).ready(function(){
    $(".select_manufacturer").change(function(){
        $(".search_manufacturer").submit();
    });
});
