
function detectBrowser()
{
var browser=navigator.appName;
var brow;
if (browser=="Netscape"){
	return brow="netscape";
}

if (browser=="Microsoft Internet Explorer"){

	return brow="mis";

}
}




function lookup(inputString) {


				if(inputString.length == 0) {
					// Hide the suggestion box.
					//$('#suggestions').hide();
					document.getElementById('suggestions').style.zIndex='-3';
				} else {
					$.post("rpc3.php", { queryString: ""+inputString+"" }, function(data){
						if(data.length >0) {
							$('#suggestions').show();
							$('#autoSuggestionsList').html(data);
							document.getElementById('suggestions').style.zIndex='30';
						}
					});
				}

			} // lookup

function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("document.getElementById('suggestions').style.zIndex='-30';", 200);
	if (detectBrowser() == "netscape"){
		document.getElementById('suggestions').style.left='378';							
	}
	else if (detectBrowser() == "mis"){
		document.getElementById('suggestions').style.left='383';
	}
}

function lookupAuthor(inputString1) {
				if(inputString1.length == 0) {
					document.getElementById('suggestions1').style.zIndex='-3';
				} else {
					$.post("rpc2.php", {queryString2: ""+inputString1+""}, function(data){
						if(data.length >0) {
							$('#suggestions1').show();
							$('#autoSuggestionsList1').html(data);
							document.getElementById('suggestions1').style.zIndex='30';
						}
					});
				}
			} // lookup
function fillAuthor(thisValue1) {
	$('#inputString2').val(thisValue1);
	setTimeout("document.getElementById('suggestions1').style.zIndex='-30';", 200);
	if (detectBrowser() == "netscape"){
		document.getElementById('suggestions1').style.left='378';							
	}
	else if (detectBrowser() == "mis"){
		document.getElementById('suggestions1').style.left='383';
	}
				
}

function checkvalues(books){
	var books=document.tabForm.page_books.value;
}

function lookupTags(inputString2) {
				if(inputString2.length == 0) {
					// Hide the suggestion box.
					//$j('#suggestions1').hide();
					document.getElementById('suggestions2').style.zIndex='-3';
				} else {
					$.post("rpc1.php", {queryString1: ""+inputString2+""}, function(data){
						if(data.length >0) {
							$('#suggestions2').show();
							$('#autoSuggestionsList2').html(data);
							document.getElementById('suggestions2').style.zIndex='30';
						}
					});
				}
			} // lookup

function fillTags(thisValue) {
	$('#inputString1').val(thisValue);
	setTimeout("document.getElementById('suggestions2').style.zIndex='-30';", 200);
	if (detectBrowser() == "netscape"){
		document.getElementById('suggestions2').style.left='378';							
	}
	else if (detectBrowser() == "mis"){
		document.getElementById('suggestions2').style.left='383';
	}
}


function lookupInstr(inputString) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestionsInstr').hide();
		} else {
			$.post("rpcInstr.php", {queryStringInstr: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestionsInstr').show();
					document.getElementById('suggestionsInstr').style.zIndex='30';
					document.getElementById('suggestionsInstr').style.position='absolute';
					if (detectBrowser() == "netscape"){
						document.getElementById('suggestionsInstr').style.top='280px';
						document.getElementById('suggestionsInstr').style.left='278px';
					}
					else if (detectBrowser() == "mis")
					{
						document.getElementById('suggestionsInstr').style.top='292px';
						document.getElementById('suggestionsInstr').style.left='275px';
					}
					
					$('#autosuggestionsInstrList').html(data);
				}
			});
		}
	} // lookup
	
	function fillInstr(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestionsInstr').hide();", 200);

	if (detectBrowser() == "netscape"){
		document.getElementById('suggestionsInstr').style.left='378';
		document.getElementById('suggestionsInstr').style.position='absolute';		
	}
	else if (detectBrowser() == "mis"){
		document.getElementById('suggestionsInstr').style.left='383';
	}

}
