﻿/***************************/
//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

$(document).ready(function(){
	$(".menu > li").click(function(e){
		switch(e.target.id){
			case "setmenu":
				//change status & style menu
				$("#setmenu").addClass("active");
				$("#single").removeClass("active");
				$("#drink").removeClass("active");
				//display selected division, hide others
				$(".setmenu").fadeIn();
				$(".single").css("display", "none");
				$(".drink").css("display", "none");
			break;
			case "single":
				//change status & style menu
				$("#setmenu").removeClass("active");
				$("#single").addClass("active");
				$("#drink").removeClass("active");
				//display selected division, hide others
				$(".single").fadeIn();
				$(".setmenu").css("display", "none");
				$(".drink").css("display", "none");
			break;
			case "drink":
				//change status & style menu
				$("#setmenu").removeClass("active");
				$("#single").removeClass("active");
				$("#drink").addClass("active");
				//display selected division, hide others
				$(".drink").fadeIn();
				$(".setmenu").css("display", "none");
				$(".single").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});


// Jump to anchor links
$(document).ready(function(){
  $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $(this.hash);
      $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top;
        $('html,body')
        .animate({scrollTop: targetOffset}, 1000);
       return false;
      }
    }
  });
});


// Back to top
$(function(){
     $(".toTop a").click(function(){
     $('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top }, 'slow','swing');
     return false;
     })
});



