function show(id,type,obj){
	obj.blur();
	//if the class is for a closed contact
	if (obj.className == "c") {
		obj.className = "o";								//switch class to closed
		obj.parentNode.className = "wait";	//turn on spinner animation
		
		//if a nested UL already exists, display it
		if (obj.nextSibling != null && obj.nextSibling.style != null) {
			obj.nextSibling.style.display = '';
		} 
		//otherwise get details
		else {
			var ul = document.createElement("ul");									//add a UL element
			ul.className = "details";
			obj.parentNode.appendChild(ul);
			AjaxMethods.Show(id, type, ShowDetails_CallBack, obj);	//get folder list
		}
	}
	//if the class is for an open contact
	else if (obj.className != "c"){
		obj.className = "c";															//switch class to closed	
		obj.parentNode.lastChild.style.display = "none";	//hide the nested UL for revealing later
		obj.parentNode.style.background="none";						//turn off spinner animation
	}
}
function ShowDetails_CallBack(response){
	if (response.error != null) {
		error(response);
	} 
	else if (response.context != null) {
		response.context.parentNode.lastChild.innerHTML = response.value + response.context.parentNode.lastChild.innerHTML;
		response.context.parentNode.className='';
	}
}

function keyPressHandler(e) {
	var kC  = (window.event) ? event.keyCode : e.keyCode; 
	var Esc = (window.event) ? 27 : e.DOM_VK_ESCAPE;
	if(kC==Esc){
		var button = document.getElementById("searchButton");
		button.disabled = false;
		button.value = "search";
		document.getElementById("spinner").style.display = "none";
	}
}