function lookup(inputString) {
		if(inputString.length < 2) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	function fill(thisValue) {
		if(document.getElementById('suggestions2').style.display == 'none')
		{
		
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
		
		}
		
		if(document.getElementById('suggestions').style.display == 'none')
		{
		
		$('#inputString2').val(thisValue);
		setTimeout("$('#suggestions2').hide();", 200);
		
		}
	}
	
	
	
	function lookup2(inputString2) {
		
		if(inputString2.length < 2) {
			// Hide the suggestion box.
			$('#suggestions2').hide();
		} else {
			$.post("rpc2.php", {queryString: ""+inputString2+""}, function(data){
				if(data.length >0) {
					$('#suggestions2').show();
					$('#autoSuggestionsList2').html(data);
				}
			});
		}
	} // lookup
	
	
	/*
	
	function fill2(thisValue) {
		
		$('#inputString2').val2(thisValue);
		setTimeout("$('#suggestions2').hide();", 200);
	}
	
	*/
	
function placesuggestionbox(field)
{
	var searchfield = document.getElementById(field);
	var contentobj = document.getElementById("suggestions");
	var xpos=findPosX(searchfield);
	var ypos=findPosY(searchfield);
	ypos=ypos + (32*1);
	contentobj.style.top=ypos+"px";
	contentobj.style.left=xpos+"px";
	contentobj.style.display="block";
}

function placesuggestionbox2(field)
{
	var searchfield = document.getElementById(field);
	var contentobj = document.getElementById("suggestions2");
	var xpos=findPosX(searchfield);
	var ypos=findPosY(searchfield);
	ypos=ypos + (32*1);
	contentobj.style.top=ypos+"px";
	contentobj.style.left=xpos+"px";
	contentobj.style.display="block";
}


function findPosX(obj)
{
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
}

function findPosY(obj)
{
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
}	