function findPeople(searchField, SFtype) {
	SFtype = SFtype || 0;
	searchValue = searchField.value;
	peopleBox = document.getElementById('peopleHolder');
	peopleLetters = document.getElementById('letters').getElementsByTagName('a');
	for(i=0; i<peopleLetters.length; i++) {
		peopleLetters[i].style.color="#dddddd";
		peopleLetters[i].style.textDecoration='none';
	}
	if(SFtype==1) {
		LNletter = searchField.href.substring(searchField.href.length-1, searchField.href.length);
		searchValue = (LNletter!='e' && LNletter!='/') ? "#lastname_"+LNletter : "";
		if(searchValue!='') {
			searchField.style.color="#cc0000";
			searchField.style.textDecoration="underline";
			menuItems = document.getElementById('left_content').getElementsByTagName('li');
			for(i=0; i<menuItems.length; i++) {
				if(menuItems[i].className=="highlight") {
					menuItems[i].className="searching_placeholder";
					break;
				}
			}
		} else {
			menuItems = document.getElementById('left_content').getElementsByTagName('li');
			for(i=0; i<menuItems.length; i++) {
				if(menuItems[i].className=="searching_placeholder") {
					menuItems[i].className="highlight";
					break;
				}
			}
		}
	} else if(searchField.value!='' && searchField.value.length<2) {
		menuItems = document.getElementById('left_content').getElementsByTagName('li');
		for(i=0; i<menuItems.length; i++) {
			if(menuItems[i].className=="highlight") {
				menuItems[i].className="searching_placeholder";
				break;
			}
		}
	} else if(searchField.value=='') {
		menuItems = document.getElementById('left_content').getElementsByTagName('li');
		for(i=0; i<menuItems.length; i++) {
			if(menuItems[i].className=="searching_placeholder") {
				menuItems[i].className="highlight";
				break;
			}
		}
	}
	var params = "searchParameters="+searchValue;
	var ajaxRequest;
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			if (ajaxRequest.status == 200) {
				if (peopleBox.hasChildNodes()) {
					while (peopleBox.childNodes.length >= 1) {
						peopleBox.removeChild(peopleBox.firstChild);       
					} 
				}
				//alert(ajaxRequest.responseText);
				returnedNames = ajaxRequest.responseXML;
				if(!returnedNames) { //no matches
					peopleBox.appendChild(document.createElement('p').appendChild(document.createTextNode('No results matching those parameters.')));
				} else { //matches found
					peoples = returnedNames.getElementsByTagName('person');
					for(i=0;i<peoples.length;i++) {
						if(i%2==0) {
							peopleRow = document.createElement('div');
							peopleRow.style.verticalAlign = 'top';
						}
						personHolder = document.createElement('div'); //create box
						personHolder.className = "peopleCard";
						if(i%2==0) {
							personHolder.style.cssFloat = 'left';
							personHolder.style.styleFloat = 'left';
						}
						if(i%2==1) {
							personHolder.style.cssFloat = 'right';
							personHolder.style.styleFloat = 'right';
						}
						if(i%4==0 || i%4==1) personHolder.style.backgroundColor = '#EEEEEE';
						
						personThumb = document.createElement('img'); //create image
						personThumb.className = "peopleThumb";
						personThumb.src = "/people_info/img_adjust.php?id="+peoples[i].getElementsByTagName('id')[0].firstChild.data+"&size=sml";
						personThumb.alt = peoples[i].getElementsByTagName('lastname')[0].firstChild.data+", "+peoples[i].getElementsByTagName('firstname')[0].firstChild.data;
						personThumb.height = "80";
						personThumb.width = "73";
						
						personThumbLink = document.createElement('a'); //create link around image
						personThumbLink.className = "peopleThumbLink";
						personThumbLink.href = "/people/"+peoples[i].getElementsByTagName('id')[0].firstChild.data;
						personThumbLink.appendChild(personThumb); //add image to link
						personHolder.appendChild(personThumbLink); //add image and link to box
						
						personNameLink = document.createElement('a'); //create person link
						personNameLink.href = "/people/"+peoples[i].getElementsByTagName('id')[0].firstChild.data;
						personNameLink.appendChild(document.createTextNode(peoples[i].getElementsByTagName('lastname')[0].firstChild.data+", "+(peoples[i].getElementsByTagName('salutation')[0].hasChildNodes() ? peoples[i].getElementsByTagName('salutation')[0].firstChild.data : "")+" "+peoples[i].getElementsByTagName('firstname')[0].firstChild.data)); //append person name to link
						
						personName = document.createElement('div'); //create person name holder
						personName.className = "peopleName";								
						personName.appendChild(personNameLink); //add person name link to person name
						personHolder.appendChild(personName); //add person name to box
						
						personInfo = document.createElement('div'); //create person info area
						personInfo.className = "peopleInfo";
						
						if(peoples[i].getElementsByTagName('email')[0].hasChildNodes() && peoples[i].getElementsByTagName('email')[0].firstChild!=null) { //add email, if applicable
							personEmail = document.createElement('a');
							personEmail.href = "mailto:"+peoples[i].getElementsByTagName('email')[0].firstChild.data;
							personEmail.appendChild(document.createTextNode(peoples[i].getElementsByTagName('email')[0].firstChild.data));
							personInfo.appendChild(personEmail);
							personInfo.appendChild(document.createElement('br'));
						}
						
						if(peoples[i].getElementsByTagName('rank')[0].hasChildNodes() && peoples[i].getElementsByTagName('rank')[0].firstChild!=null) { //add rank, if applicable
							personRank = document.createElement('span');
							personRank.className = "peopleRank";
							personRank.appendChild(document.createTextNode(peoples[i].getElementsByTagName('rank')[0].firstChild.data));
							personInfo.appendChild(personRank);
							personInfo.appendChild(document.createElement('br'));
						}
						if(peoples[i].getElementsByTagName('title')[0].hasChildNodes() && peoples[i].getElementsByTagName('title')[0].firstChild!=null) {  //add title, if applicable
							personTitle = document.createElement('span');
							if(peoples[i].getElementsByTagName('rank')[0].hasChildNodes() && peoples[i].getElementsByTagName('rank')[0].firstChild!=null) personTitle.className = "peopleTitle";
							else personTitle.className = "peopleRank";
							personTitle.appendChild(document.createTextNode(peoples[i].getElementsByTagName('title')[0].firstChild.data));
							personInfo.appendChild(personTitle);
							personInfo.appendChild(document.createElement('br'));
						}
						personInfo.appendChild(document.createElement('br'));
						
						if(!(peoples[i].getElementsByTagName('title')[0].hasChildNodes() && peoples[i].getElementsByTagName('rank')[0].firstChild!=null) || !(peoples[i].getElementsByTagName('title')[0].hasChildNodes() && peoples[i].getElementsByTagName('rank')[0].firstChild!=null)) personInfo.appendChild(document.createElement('br'));
						
						if(peoples[i].getElementsByTagName('location')[0].hasChildNodes() && peoples[i].getElementsByTagName('location')[0].firstChild!=null) {  //add room number, if applicable
							personInfo.appendChild(document.createTextNode(peoples[i].getElementsByTagName('location')[0].firstChild.data)); //add room number
							
						}
						
						if(peoples[i].getElementsByTagName('phone')[0].hasChildNodes() && peoples[i].getElementsByTagName('phone')[0].firstChild!=null) {  //add phone number, if applicable
							if (peoples[i].getElementsByTagName('location')[0].hasChildNodes() && peoples[i].getElementsByTagName('location')[0].firstChild.data != ' '){
								redpipe = document.createElement('span'); 
								redpipe.className = "red_pipe";
								redpipe.appendChild(document.createTextNode("\u00a0 |\u00a0 "));
								personInfo.appendChild(redpipe); //add red pipe element
							}
							
							personInfo.appendChild(document.createTextNode(peoples[i].getElementsByTagName('phone')[0].firstChild.data)); //add phone number
						}
						personHolder.appendChild(personInfo); //add person info to box
						
						peopleRow.appendChild(personHolder);
						if((i+1)%2==0 || i==peoples.length-1) {
							peopleBox.appendChild(peopleRow);
						}
						//peopleBox.appendChild(personHolder); //add person box to people list
					}
				}
			}
		}
	}
	
	ajaxRequest.open("POST", '/people_info/content/findPeople.php', true);
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", params.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	ajaxRequest.send(params);
}
