/* MiniBasket hover */
$("span.basketlink").hoverIntent (
	function () {
		$(this).find("div.minibasket").slideDown(250);
	},
	function () {
		$(this).find("div.minibasket").slideUp(100);
	}
);


/* MiniBasket colorfade */
var originalBG = $(".minibasket_content tr td").css("background-color");
var fadeColor = "#ffffff";
$(".minibasket_content tr").hover(
	function() {
		$(this).children().animate({backgroundColor:fadeColor}, 250)
	},
	function(){
		$(this).children().animate({backgroundColor:originalBG}, 250)
	}
);


/* Inputfields onFocus */
$('.topbar .default-value').each(function() {
    var default_value = this.value;
    $(this).focus(function() {
	$(this).css({'color' : '#2c2c2c', 'font-style' : 'normal'});
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
	    $(this).css({'color' : '#666', 'font-style' : 'italic'});
            this.value = default_value;
        }
    });
});


/* Remove tooltip from shopmenu and href from 1st level */
$(".shopmenu a").removeAttr("title");


/* Shopmenu accordian */
function initMenu() {
$('.shopmenu > ul > li > a').click(
	function() {
		var checkElement = $(this).next();
		if(checkElement.is('ul') && checkElement.is(':visible')) {
			$(checkElement).slideUp(150);
			return false;
		}
		if(checkElement.is('ul') && !checkElement.is(':visible')) {
			$('.shopmenu > ul > li > ul:visible').slideUp(150);
			$('.shopmenu > ul > li.active').removeClass('active');
			checkElement.slideDown(150);
			$(this).parent().addClass('active');
			return false;
		}
	}
);
}
$(document).ready(function() {initMenu();});