window.profile = window.profile || {};

jQuery.noConflict();

(function($) {

$(function() {
		   
	profile = (function() {
		function initialize() {
			$("h2")
				.css("cursor", "pointer")
				.click(function() {
					slideDown($(this).next().attr("id"), this);
					return false;
				});
				
			$(".profil_content").slice(1).css("display", "none");
		}
		
		function slideDown(id, headline) {
			var $el = $("#"+id);
			var $h2 = $(headline);
			
			if(!$el.is(":visible")) {
				$(".profil_content:visible").slideUp("slow").prev().removeClass("active"); // altes Profil verstecken
				
				$h2.addClass("active");
				$el.slideDown("slow", function() {   // neues zeigen
					$("#wrap").trigger("resize");    // und bei wrap die hoehe neu berechnen
				});
			}
		}
		
		return {
			init: initialize,
			show: slideDown
		}
	})();
	
	profile.init();
	
});
})(jQuery);