
//Drop down menu
jQuery(function($){
	$('.menu li:last-child > a').addClass('last-child');
	var dropMenuParent = $('ul ul','.menu').parent();
	dropMenuParent.each(function(){
	var dropMenu = $('>ul',this);
    dropMenu.hide().prev().addClass('dropMenuPrev');
    $(this).hover(function(){
    dropMenu.show().prev().addClass ('active');
    },function(){
    dropMenu.hide().prev().removeClass ('active');
    });
  });
});


jQuery(function($){
    $("#Navi ul li a img[src*='_on']").addClass("current");
    $("#Navi ul li a img,input[type='image']").hover(function(){
        if ($(this).attr("src")){
            $(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
        }
    },function(){
        if ($(this).attr("src") && !$(this).hasClass("current") ){
            $(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
        }
    });
});


//From Input
jQuery(function($){
	$('#contact input[type=text],#contact textarea').focus(function(){
		$(this).addClass('focus');
	}).blur(function(){
		$(this).removeClass('focus');
	});
});

//Scroll top
jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};  

jQuery(document).ready(function(){
    jQuery('#pagetop').click(function () {
        jQuery('html,body').animate({ scrollTop: 0 }, 800, 'quart');
    });
});

//category check

jQuery(document).ready( function($) {
  if(location.search.length > 1) {
    var cat = location.search.split("?cat=");
    if(cat[1])
      $('input#in-category-' + cat[1]).attr('checked', 'checked');
  }
});
