/*
//hoverintent plugin
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);

//xmenu plugin
function showm() { $(this).children('ul').slideDown('fast'); }
function hidem() { $(this).children('ul').slideUp('fast'); }
;(function($){
	$.fn.xmenu = function(op){
		var flvl = $(this).children('ul').children('li'); var flvllength = flvl.length; $(flvl).addClass('flvl');
		$(flvl).hoverIntent({
			over: showm,
			timeout: 200,
			out: hidem
		});
	}
})(jQuery);


function toggleDescription() {
	var showed = $("#hero-banner .description").css("display");
	if (showed == "block") {
		$("#hero-banner .description").css("display","none");
	} else {
		$("#hero-banner .description").css("display","block");
	}
}

function domagic() {
	$("#menu li:not(.current-menu-item)").hover(
		function() { 
			$(this).css("background","url(/wp-content/themes/chest/images/bg-nav-left.gif) left 10px no-repeat");
			$(this).children("a:first").css("background","url(/wp-content/themes/chest/images/bg-nav-right.gif) right 10px no-repeat").css("color","#939292");
		},
		function() {
			$(this).css("background","");
			$(this).children("a:first").css("background","").css("color","#939292");
		}
	);
	$("#cont.sub .ngg-gallery-thumbnail-box:nth-child(5n+7), #default_products_page_container.wpsc_container .wpsc_default_product_list:nth-child(5n)").css("margin-right","0");
	$("#fmenu li:first-child a").css("border-left","none");
	$("a.hp-services-btn").click(function() {
		$(this).siblings(".hp-services").slideToggle();
	});
    $("#crumbs a").each(function() {
		var string = $(this).attr('href');
		var output = string.replace("%wpsc_product_category%","category");
		$(this).attr("href",output);
	});

}*/
