
(function(d){d.fn.extend({accordion:function(){return this.each(function(){var $ul=$(this);if($ul.data('accordiated'))return false;$.each($ul.find('ul, li>div'),function(){$(this).data('accordiated',true);$(this).hide()});$.each($ul.find('a'),function(){$(this).click(function(e){activate(this);return void(0)})});var c=(location.hash)?$ul.find('a[href='+location.hash+']')[0]:'';if(c){activate(c,'toggle');$(c).parents().show()}function activate(a,b){$(a).parent('li').toggleClass('active').siblings().removeClass('active').children('ul, div').slideUp('fast');$(a).siblings('ul, div')[(b||'slideToggle')]((!b)?'fast':null)}})}})})(jQuery);

$(document).ready(function(){
$(".profilemenu ul li a").click(function() {
		$(".profilemenu ul li a.current").removeClass("current");
		$(this).addClass("current");
		var current_id = $(this).parent().attr("id");
		var curview = $(this).attr("title");
		var $pdiv = ".profilemenu #"+current_id+" div";
		$.ajax({
						   type: "GET",
						   url: "controller/profilecontent.php",
						   data: 'view='+current_id,
						   beforeSend:function(){$(".loading","#profil").html("Loading "+curview+"..."); $(".loading","#profil").show();},
						   success: function(msg){
							$($pdiv).ajaxComplete(function(event, request, settings){
								$(".loading","#profil").hide();
								if(msg != '')$($pdiv).html(msg);
							});
						   }
						 });
	});
});

	$(document).ready(function () {
		$('.profilemenu ul').accordion();
	});

