jQuery(document).ready(function() {
	jQuery("h3 a.toggle").click(function () {
    jQuery(this).parent("h3").next("div.order").slideToggle("normal")
	jQuery(this).parent("h3").toggleClass('open');
	return false;
    });
	
	jQuery('#topmenu ul.menu > li').hover(
       function() {  
            jQuery(this).children('ul.sub-menu').stop(true, true).fadeIn(500);
			jQuery(this).css('background','#eaeaea');
        },   
        function() {  
            jQuery(this).children('ul.sub-menu').stop(true, true).fadeOut(300);
			jQuery(this).css('background','none');
    });
	
	jQuery('div.featured-item').fadeOut(0);
		jQuery('div.featured-item:first').fadeIn(1000);
		jQuery('#scroll-menu a:first').css('background','#fff');
		
		jQuery('#scroll-menu a').click(function changeItem() {
		var item = jQuery(this).attr('rel');
		if(jQuery(item).is(':hidden')) {
				jQuery('div.featured-item').fadeOut('normal');
				jQuery('#scroll-menu a').css('background','#ddd');
				jQuery(item).fadeIn('normal');
				jQuery(this).css('background','#fff');
		}
		return false;
		});
		
		jQuery('.dblue_list a')
		.mouseover(function(){jQuery(this).stop().animate({marginLeft:"15px"}, {duration:200})
		})
		.mouseout(function(){
			jQuery(this).stop().animate({marginLeft:"8px"}, {duration:200})
		});

	jQuery("#li--5 label span").text('Kod-pocztowy');

/*	jQuery.validator.addMethod("phonePL", function(phone_number, element) {
		return this.optional(element) || phone_number.length > 8 &&
			phone_number.match(/^\+?[0-9\s|-]{9,15}$/);
	}, "test");

	jQuery.validator.addMethod("zipPL", function(phone_number, element) {
		return this.optional(element) || phone_number.length > 5 &&
			phone_number.match(/^[xx-xxx]|[0-9]{2}\-[0-9]{3}$/);
	}, "test");

	jQuery("#cformsform, #cforms2form").validate({
	  rules: {
			Telefon: {
			required: true,
			phonePL: true
			},
			Email: {
			required: true,
			email: true
			}
		}	
	});
	jQuery("#Kod-pocztowy").rules("add", {
		zipPL: true
	});

	jQuery("#Kod-pocztowy2").rules("add", {
		zipPL: true
	}); */

	/* jQuery("#cformsform").rules("remove", "messages"); */
});
