function initHyphenator() {
	Hyphenator.config({
        classname : 'journal-content-article'        
    });
    Hyphenator.run();
}

function initTeam(){
	$("a.team-member").click(function(event) {
		event.preventDefault(); 
		var regex = /\/team\/profil\/(\d+)\//;
		var url = this.href;
		var id = url.match(regex)[1];				
		var ajax =  "/komdat-portlet/komdat-team-profil/view?userId=" + id;
		
		$.fancybox({
			'hideOnContentClick': false,
			'titleShow': false,
			'transitionIn': 'elastic',
			'transitionOut': 'elastic',
			'easingIn': 'easeOutBack',
			'easingOut': 'easeInBack',
			'href': ajax
		});	
		return false;
	});
	$("a.team-member").hover(function(){						
		$(this).children(".overlay-image").fadeToggle(1000);		
		$(this).children(".overlay-text").stop().animate({
			marginBottom: parseInt($(this).children(".overlay-text").css('margin-bottom'),0) == -19 ? 0 : -19
		});
	}, function() {
		$(this).children(".overlay-image").fadeToggle(1000);
		$(this).children(".overlay-text").stop().animate({
			marginBottom: parseInt($(this).children(".overlay-text").css('margin-bottom'),0) == -19 ? 0 : -19
		});
	});
	
}

function initCallbackButton(){
	$("#callback-button form").bind("submit", function(event){ 
        var inputElements = "#callback-button input:text";
		
        if($(inputElements).is(":hidden")) {
			event.preventDefault();
			$(inputElements).slideToggle("slow");
            return false;
		} else {
			return true;
		}
	});
}

function popup(width, height, url) {
	popupWindow = window.open(url, "", "width=" + width + ",height=" + height + ",status=yes,scrollbars=yes,resizable=yes");
	popupWindow.focus();
}
