﻿/***************************/
//@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){
		var toCheck = e.target.id;
		if(toCheck != "bhosting" && toCheck != "phosting" && toCheck != "domains" && toCheck != "efilter" && toCheck != "vps"){
                  toCheck = e.target.parentNode.id;
                }
		switch(toCheck){
			case "bhosting":
				//change status & style menu
				$("#bhosting").addClass("active");
				$("#phosting").removeClass("active");
				$("#phosting").addClass("off");
				$("#domains").removeClass("active");
				$("#domains").addClass("off");
				$("#efilter").removeClass("active");
				$("#efilter").addClass("off");
				$("#vps").removeClass("active");
				$("#vps").addClass("bottom");
				//display selected division, hide others
				$("div.bhosting").fadeIn();
				$("div.phosting").css("display", "none");
				$("div.domains").css("display", "none");
				$("div.efilter").css("display", "none");
				$("div.vps").css("display", "none");
			break;
			case "phosting":
				//change status & style menu
				$("#bhosting").removeClass("active");
				$("#bhosting").addClass("top");
				$("#phosting").addClass("active");
				$("#domains").removeClass("active");
				$("#domains").addClass("off");
				$("#efilter").removeClass("active");
				$("#efilter").addClass("off");
				$("#vps").removeClass("active");
				$("#vps").addClass("bottom");
				//display selected division, hide others
				$("div.phosting").fadeIn();
				$("div.bhosting").css("display", "none");
				$("div.domains").css("display", "none");
				$("div.efilter").css("display", "none");
				$("div.vps").css("display", "none");
			break;
			case "domains":
				//change status & style menu
				$("#bhosting").removeClass("active");
				$("#bhosting").addClass("top");
				$("#phosting").removeClass("active");
				$("#phosting").addClass("off");
				$("#domains").addClass("active");
				$("#efilter").removeClass("active");
				$("#efilter").addClass("off");
				$("#vps").removeClass("active");
				$("#vps").addClass("bottom");
				
				//display selected division, hide others
				$("div.domains").fadeIn();
				$("div.bhosting").css("display", "none");
				$("div.phosting").css("display", "none");
				$("div.efilter").css("display", "none");
				$("div.vps").css("display", "none");
			break;
			
			case "efilter":
				//change status & style menu
				$("#bhosting").removeClass("active");
				$("#bhosting").addClass("top");
				$("#phosting").removeClass("active");
				$("#phosting").addClass("off");
				$("#domains").removeClass("active");
				$("#domains").addClass("off");
				$("#efilter").addClass("active");
				$("#vps").removeClass("active");
				$("#vps").addClass("bottom");
				
				//display selected division, hide others
				$("div.efilter").fadeIn();
				$("div.bhosting").css("display", "none");
				$("div.phosting").css("display", "none");
				$("div.domains").css("display", "none");
				$("div.vps").css("display", "none");
			break;
			
			case "vps":
				//change status & style menu
				$("#bhosting").removeClass("active");
				$("#bhosting").addClass("top");
				$("#phosting").removeClass("active");
				$("#phosting").addClass("off");
				$("#domains").removeClass("active");
				$("#domains").addClass("off");
				$("#efilter").removeClass("active");
				$("#efilter").addClass("off");
				$("#vps").addClass("active");
				
				
				//display selected division, hide others

				$("div.vps").fadeIn();
				$("div.bhosting").css("display", "none");
				$("div.phosting").css("display", "none");
				$("div.domains").css("display", "none");
				$("div.efilter").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});