var team={
	init:function(){
		var teamPopup=nPopup.newPopup({
				width:'400px',
				height:'auto',
				visible:false,
				scrollable:false,
				shadow:true,
				createInCertainDomEl:'content_main',
				top:'60px',
				left:'40px'
		});
		Event.observe(teamPopup.contentDiv, 'click', function(){
			this.hide();
		}.bindAsEventListener(teamPopup));
									  
		$$('a.team_link').each(function(l){
					Event.observe(l, 'click', function(event){
						teamPopup.clearContent();  
						teamPopup.addContent('Bitte warten...<br><br><br><br><br><br><br><br><br><br>');
						nUtils.setProgressState(teamPopup.contentDiv, true);
						if(this.href){
							var tpl;
							$A(this.href.substr(this.href.indexOf('?')+1, this.href.length).split('&')).each(function(el){
								var tmp=el.split("=");
								if(tmp[0]=='m' && tmp[1]){
									tpl=tmp[1];
								}
							});
							if(tpl){
								new Ajax.Request('/tpl/ueber_uns/team/mitarbeiter_popups/'+tpl,{
									method:'get',
									onSuccess:function(t){
										nUtils.setProgressState(teamPopup.contentDiv, false);
										teamPopup.clearContent();  
										teamPopup.addContent(t.responseText);
									}
								});
							}
							teamPopup.show();
							Event.stop(event);
						}
					}.bindAsEventListener(l));
				});
	}
}
