function createAjaxObject ()
{
	var ajaxobj = null;
	if (window.XMLHttpRequest) {
		ajaxobj = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try { ajaxobj = new ActiveXObject("Msxml2.XMLHTTP"); }
		catch (e) {
			try { ajaxobj = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) { }
		}
	}
	return ajaxobj;
}

function encodeField (string)
{
	return escape(this._utf8_encode(string));
}

function _utf8_encode (string)
{
	string = string.replace(/\r\n/g,"\n");
	var utftext = "";
	for (var n = 0; n < string.length; n++) {
		var c = string.charCodeAt(n);
		if (c < 128) {
			utftext += String.fromCharCode(c);
		}
		else if(c < 2048) {
			utftext += String.fromCharCode((c >> 6) | 192);
			utftext += String.fromCharCode((c & 63) | 128);
		}
		else {
			utftext += String.fromCharCode((c >> 12) | 224);
			utftext += String.fromCharCode(((c >> 6) & 63) | 128);
			utftext += String.fromCharCode((c & 63) | 128);
		}
	}
	return utftext;
}
	
