﻿/***************************/
//@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 "switzerland":
				//change status & style menu
				$("#switzerland").addClass("active");
				$("#italia").removeClass("active");
				$("#france").removeClass("active");
				//display selected division, hide others
				$("div.switzerland").fadeIn();
				$("div.italia").css("display", "none");
				$("div.france").css("display", "none");
			break;
			case "italia":
				//change status & style menu
				$("#switzerland").removeClass("active");
				$("#italia").addClass("active");
				$("#france").removeClass("active");
				//display selected division, hide others
				$("div.italia").fadeIn();
				$("div.switzerland").css("display", "none");
				$("div.france").css("display", "none");
			break;
			case "france":
				//change status & style menu
				$("#switzerland").removeClass("active");
				$("#italia").removeClass("active");
				$("#france").addClass("active");
				//display selected division, hide others
				$("div.france").fadeIn();
				$("div.switzerland").css("display", "none");
				$("div.italia").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});

});

function setActiveState()
{
  var activeState = gup('activeState');
  if (activeState=="sw"){
	$("#switzerland").addClass("active");
	$("#italia").removeClass("active");
	$("#france").removeClass("active");
	//display selected division, hide others
	$("div.switzerland").fadeIn();
	$("div.italia").css("display", "none");
	$("div.france").css("display", "none");
  }
  if (activeState=="it"){
	$("#switzerland").removeClass("active");
	$("#italia").addClass("active");
	$("#france").removeClass("active");
	//display selected division, hide others
	$("div.italia").fadeIn();
	$("div.switzerland").css("display", "none");
	$("div.france").css("display", "none");
  }
  if (activeState=="fr"){
	$("#switzerland").removeClass("active");
	$("#italia").removeClass("active");
	$("#france").addClass("active");
	//display selected division, hide others
	$("div.france").fadeIn();
	$("div.switzerland").css("display", "none");
	$("div.italia").css("display", "none");
  }
}

