var myConn = new XHConn();

if (!myConn) alert("XMLHTTP not available. Try a newer/better browser.");

var fnWhenDone = function (oXML) {
var xmldoc = oXML.responseXML;
var root_node = xmldoc.getElementsByTagName('bcontent').item(0);
var xml_data=root_node.firstChild.data;
alert
sav_title=""
sav_content="";
var sav_bcount=1;
if (xml_data=="nothing")
{
	sav_title="";
	sav_content="";
	hidetip();
}
else
{
	if (xml_data.indexOf("|||")>=0)
	{
		var tmp_data=xml_data.split("|||");
		sav_title=tmp_data[0];
		sav_content=tmp_data[1];
	}
	else
	{
		sav_title="Search Results Preview";
		sav_content=xml_data;
	}
	if (((sav_title!='') || (sav_content!='')) && (sav_callxml=="1"))
	{
		sav_bcount=sav_bcount+1;
		showtip(sav_title,sav_content);
	}
	else
	{
		sav_title="";
		sav_content="";
		hidetip();
	}
}

};

function runXML(new_callID,item)
{
save_callID=new_callID
if (sav_callxml=="1")
{
var x=0; 
for (x=0; x<sav_bcount; x++)
{
	if (""+new_callID==""+sav_callID[x])
	{
		sav_title=sav_btitle[x];
		sav_content=sav_bcontent[x];
		hidetip();
		showtip(sav_title,sav_content);
		sav_callxml="";
		return(true);
	}
}
myConn.connect("test.php", "POST", GetAllValues(document.ajaxSearch), fnWhenDone);
}
return(true);
}

function runXML1(new_callID,item)
{
sav_callxml=1;
myConn.connect("calls.php", "POST", "id="+item, fnWhenDone);
return(true);
}


							// ====================================================================
							// URLEncode Functions
							// Copyright Albion Research Ltd. 2002
							// http://www.albionresearch.com/
							// ====================================================================
							function URLEncode(eStr)
							{
							// The Javascript escape and unescape functions do not correspond
							// with what browsers actually do...
							var SAFECHARS = "0123456789" +					// Numeric
											"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
											"abcdefghijklmnopqrstuvwxyz" +
											"-_.!~*'()";					// RFC2396 Mark characters
							var HEX = "0123456789ABCDEF";
						
							var plaintext = eStr;
							var encoded = "";
							for (var i = 0; i < plaintext.length; i++ ) {
								var ch = plaintext.charAt(i);
									if (ch == " ") {
										encoded += "+";				// x-www-urlencoded, rather than %20
								} else if (SAFECHARS.indexOf(ch) != -1) {
										encoded += ch;
								} else {
										var charCode = ch.charCodeAt(0);
									if (charCode > 255) {
											alert( "Unicode Character '" 
																		+ ch 
																		+ "' cannot be encoded using standard URL encoding.\n" +
															"(URL encoding only supports 8-bit characters.)\n" +
													"A space (+) will be substituted." );
										encoded += "+";
									} else {
										encoded += "%";
										encoded += HEX.charAt((charCode >> 4) & 0xF);
										encoded += HEX.charAt(charCode & 0xF);
									}
								}
							} // for
						
								return encoded;
							};
	
