var start_sort = 0;
function goTeamMember(ssort, msort, dir)
{
	var l1 = 0;
	var l2 = 0;
	
	if (start_sort=="") start_sort = ssort;
	
	
	var ajaxRequest;
  
	if (dir=='next')
	{
	  	start_sort++;
		if (start_sort>msort)
		{
			start_sort = 0;
		}
		l1 = "850px";
		l2 = "824px";
	}
	
	if (dir=='previous')
	{
		start_sort--;
		
		if (start_sort<0)
		{
			start_sort = msort;
		}
		l1 = "850px";
		l2 = "-824px"
	}
	
	
  
  $('#team-slide').animate({left: l1}, 600, function() {
		try{
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					alert("Your browser broke!");
					return false;
				}
			}
		}
		
		
		ajaxRequest.onreadystatechange = function()
		{
			if(ajaxRequest.readyState == 4)
			{
				$("#team-slide").html(ajaxRequest.responseText);
				$("#team-slide").css("left",l2);
				$("#team-slide").animate({left: '0px'}, 600, function() {});
			}
		}
		
		var queryString = "?dir="+escape(encodeURI(dir))+"&ssort="+escape(encodeURI(start_sort))+"&msort="+escape(encodeURI(msort));
		
		ajaxRequest.open("GET", "/assets/ajax/team.php" + queryString, true);
		ajaxRequest.send(null);
	});
}
