// Team javascript




function load_team(url){
	var req = new Request.HTML({url:'team/'+url+'.html',method:'get', 
		onSuccess: function(html) {
			//Clear the text currently inside the results div.
			$('teamContentBox').set('text', '');
			//Inject the new DOM elements into the results div.
			$('teamContentBox').adopt(html);
			
			
			var pSlide = new Fx.Slide('profile');
			pSlide.hide();
			
			if($("pMore_english")){
				//two profiles
				
				var pSlideEnglish = new Fx.Slide("profile_english");
				pSlideEnglish.hide();
				
				
				$('pMore').addEvent('click', function(e){
					e.stop();
					pSlide.slideIn();
					
					if(pSlideEnglish.open){
						pSlideEnglish.slideOut();
					}
				});	
				
				
				$('pMore_english').addEvent('click', function(e){
					e.stop();
					pSlideEnglish.slideIn();
					
					if(pSlide.open){
						pSlide.slideOut();	
					}
					
				});
			}else{
				//just one				
				$('pMore').addEvent('click', function(e){
					e.stop();
					pSlide.slideIn();
				});	
			}
			
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			$('teamContentBox').set('text', 'The request failed.');
		}
	});

	req.send();

	

}

