<!--
var type1;

String.prototype.trim = function()
{
  	var pattern = !arguments[0] ? /^\s+|\s+$/g
              : new RegExp('^['+arguments[0]+']+|['+arguments[0]+']+$', 'g')
  	return this.replace(pattern, '')
}

function initXMLHttp() 
{
	if( window.ActiveXObject )
	{
		//Internet Explorer
	
		try 
		{
			type1 = "Msxml2.XMLHTTP";
			return new ActiveXObject(type1);
		} 
		catch (e) 
		{
			try 
			{
				type1 = "Microsoft.XMLHTTP";
				return new ActiveXObject(type1);
			} 
			catch (E) 
			{
				xmlHttp = false;
				return null;
			}
		}

	}
	else if( window.XMLHttpRequest )
	{
		//Not Internet Explorer
		type1 = "XMLHttpRequest";
		return new XMLHttpRequest();
	}
	else
	{
		return null;
	}
}

function OpenXMLRPC( url, method, msg ) 
{
	var xmlHttp;
	var output;
	var res = false;
	maxIndex = 0;
	
	xmlHttp = initXMLHttp();
	xmlHttp.open("POST", url, false);
	
 	xmlHttp.onreadystatechange = function() 
	{
 		if (xmlHttp.readyState == 4) 
		{
 			if (xmlHttp.status == 200) 
			{
 				if (xmlHttp.responseText.trim() != "") 
				{
 					
 					var dom = new ActiveXObject("Microsoft.XMLDOM");
					dom.async="false";
					
					if( xmlHttp.responseText != false )
					{
						res = xmlHttp.responseText;
					}
  				} 
   			}
  		}
	}
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(msg);

	if( res == false )
	{
		return false;
	}
	else
	{
		return res;
	}
}
//-->