jQuery(document).ready(function(){
	timeOut = 200;
	jQuery('.totop').click(function () {
		scroll(0,0);
		return false;
	});
		jQuery('#header .box').click(function () {		location.href = jQuery(this).attr('href');	});
	jQuery('input[type="submit"], #menu li').mouseover(function () { jQuery(this).addClass('hover'); });
	jQuery('input[type="submit"], #menu li').mouseout(function () { jQuery(this).removeClass('hover'); });	jQuery('#menu > li > ul').hide();	jQuery('#menu > li').hoverIntent(hoverIn,hoverOut, {interval: 100});
		jQuery('#menu > li > a:first-child').each(function () {		if (jQuery(this).next('ul').size() > 0 )  jQuery(this).attr('href',jQuery(this).next('ul').children('li:first-child').children('a').attr('href'));	});		jQuery('#menu > li > a:first-child').click(function () {		if (jQuery(this).next('ul').size() > 0 )  location.href = jQuery(this).next('ul').children('li:first-child').children('a').attr('href');	});	
	jQuery('#featured').after('<div id="featured-nav" />').cycle({ 
		fx:     'scrollHorz', 
		speed:  1200, 
		timeout: 6000,  
		pager:  '#featured-nav', 
		cleartypeNoBg: true
	});
	if (jQuery('#featured .featured').size() <= 1) jQuery('#featured-nav').remove();    
	//jQuery('#featured-nav a').mouseover(function () { jQuery(this).click(); });
	
	// jQuery('#bottom a')
        // .css( {backgroundPosition: "0px 0px"} )
        // .mouseover(function(){
            // $(this).stop().animate({backgroundPosition:"(0px -60px)"}, {duration:timeOut})
        // })
        // .mouseout(function(){
            // $(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:timeOut, complete:function(){
                // $(this).css({backgroundPosition: "0px 0px"})
            // }})
        // });
	
	// jQuery('.category_list_expand > ul > li > a').not('.category_list_expand > ul > li.current_category > a').click(function () {
		// jQuery(this).parents('li').find('ul').animate({height: 'toggle'}, timeOut);
		// jQuery(this).parents('li').hasClass('.hover_category') ? jQuery(this).parents('li').removeClass('.hover_category') : jQuery(this).parents('li').addClass('.hover_category');
		// return false;
	// });
	// jQuery('.category_list_expand > ul > li.current_category > a').click(function () {
		// return false;
	// });
	if ( jQuery.browser.msie ) {		if (jQuery.browser.version != '6.0') {
		} 		} else {	}
	if ( /chrome/.test( navigator.userAgent.toLowerCase() ) ) {
	} 	
	if ( /safari/.test( navigator.userAgent.toLowerCase() ) ) {
		jQuery('.column_right ul.bulks').css('margin-left','-38px');
	} 
	if ( jQuery.browser.opera ) {
	} 	
	
	
	jQuery('#menu .page-item-201 ul').remove();
	jQuery("#contactform").validate({
		rules: {
			imie: {
				required: true,
				minlength: 2
			},
			nazwisko: {
				required: true,
				minlength: 2
			},
			email: {
				required: true,
				email: true
			},
			czy_zgoda: {
				required: true
			},
			telefon: {
				required: true,				
				minlength: 9,			
				maxlength: 12,
				digits: true
			},
		},
        errorPlacement: function(error, element) {
            error.appendTo( element.parents('p') );
        }
	});
});



function hoverIn(){ jQuery(this).children('ul').animate({height: 'toggle'}, timeOut);}
function hoverOut(){ jQuery(this).children('ul').animate({height: 'toggle'}, timeOut);}
