<!--//

var strings = new Object();
var returnv

var xmlhttp = false;
//IE?
try
{
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
	try
	{
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (E)
	{
		xmlhttp = false;
	}
}
//no ie
if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	xmlhttp = new XMLHttpRequest();

function setstring( naam, value )
{
	strings[naam] = value;
}

function getstring( naam )
{
	return strings[naam];
}

function pageGET(serverPage, objID)
{
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			returnv = decode(objID, xmlhttp.responseText);
		}
	}
	xmlhttp.send(null);
}

function pagePOST(url, objID, parameters) {
	xmlhttp.open('POST', url, true);
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp.setRequestHeader("Content-length", parameters.length);
	xmlhttp.setRequestHeader("Connection", "close");
	xmlhttp.send(parameters);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
		{
			returnv = decode(objID, xmlhttp.responseText);
		}
	}
}

function decode(objID, content)
{
	if( content.indexOf("<coded>") == 0 )
	{
		contentu = content.substring( content.indexOf("\n")+1, content.length);
		conarr = contentu.split(";\r\n");
		for(i=0;i<conarr.length;i++)
		{
			if( conarr[i] > "" && conarr[i].indexOf("=") > 0 )
			{
				splitnr = conarr[i].indexOf("=");
				keyn = conarr[i].substring(0, splitnr);
				keyv = conarr[i].substring(splitnr+1, conarr[i].length);
				if(keyn=="content")
				{
					if(objID=="return")
						return keyv; 
					else
						var obj = document.getElementById(objID).innerHTML = keyv;
				}
				else if(keyn > "" && keyv > "" )
				{
					strings[keyn] = keyv;
				}
			}
		}
	}
	else
	{
		if(objID=="")
			return content;
		else
			document.getElementById(objID).innerHTML = content;
	}
}

//-->
