$(function() {
	$('#language_switch').click(function(){
		if($('#language_switch').hasClass('open'))
		{
			$('#language_switch').removeClass('open');
		}
		else
		{
			$('#language_switch').addClass('open');
			return false;
		}
	});
	// Downloads Archive
	$("#klima_archive a.button").click(function(){
		//
		$("#spa_archive .button_box").removeClass('active');
		$(this).parent().addClass('active');
		//
		$("div.archive").fadeOut('100', function(){
			$("div.archive.klima_archive").fadeIn('slow');	
		});
	});
	$("#spa_archive a.button").click(function(){
		//
		$("#klima_archive .button_box").removeClass('active');
		$(this).parent().addClass('active');
		//
		$("div.archive").fadeOut('fast', function(){
			$("div.archive.spa_archive").fadeIn('slow');
		});
	});
	//
	var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-7074034-15']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
	// add js to check if js is active
	$("body").addClass('js');
	
	var message = $("#message");
	if(message.html() != null)
	{	
		var msg_bg = $("#message_bg");
		$("#message_bg").remove();
		$("#container").after(msg_bg);
		$("#message_bg").width($("body").width()).height($("body").height()).fadeIn('fast');
		message.css({'top':250,'left':($("body").width()/2)-200});
		msg_bg.click(function(){
			msg_bg.remove();
		});
	}
});
