jQuery(function(){
	//preload hover menu image
	$.preloadCssImages();

	//loads drop menu
	$("ul.sf-menu").superfish();

	$('.sf-menu li a').append('').each(function () {
	  var $span = $('> span.hover', this).css('opacity', 0);
	  $(this).hover(function () {
	    $span.stop().fadeTo(500, 1);
	  }, function () {
		$span.stop().fadeTo(500, 0);
	  });
	});
	
	//new window
	$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");

	//makes button links
	$("a.button").wrapInner("<span></span>");
	
	//products expanders
	$('.productCat ul').hide();
	$('.productCat h2 a').click(function() {

		var linkcheck = $(this).attr('href');
		if (linkcheck == "#") {
			$('.productCat ul').slideUp();
			var list = $(this).parent().next('ul');
			if (list.is(":hidden")) {
				list.slideDown();
			return false;
			} else {
				list.slideUp();
			return false;
			}
		}
	});
	
});
