function $()
{
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++)
	{
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
	}
	return elements;
}
var xmlhttp = false;
function getHTTPReq(url,destinationid)
{
	if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
	else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
	if (xmlhttp)
	{
		xmlhttp.open("GET",url,true);
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState==4)
			{
				if (xmlhttp.status==200) { $(destinationid).innerHTML = xmlhttp.responseText; }
				else { $(destinationid).innerHTML = 'Fail'; }
			}
		}
		if (window.XMLHttpRequest) { xmlhttp.send(null); }
		else if (window.ActiveXObject) { xmlhttp.send(); }
	}
}

function postHTTPReq(url,query,destinationid)
{
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
		if (xmlhttp.overrideMimeType) { xmlhttp.overrideMimeType('text/html'); }
	}
	else if (window.ActiveXObject)
	{
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                } 
                catch (e)
		{
			try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } 
			catch (e) {}
		}
	}
	if (xmlhttp)
	{
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState==4)
			{
				if (xmlhttp.status==200) { $(destinationid).innerHTML = xmlhttp.responseText; }
				else { $(destinationid).innerHTML = 'Fail'; }
			}
		}
		xmlhttp.open("POST",url,true)
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlhttp.setRequestHeader("Content-length", query.length);
		xmlhttp.setRequestHeader("Connection", "close");
		xmlhttp.send(query);
	}
}

function post(url,id,destinationid)
{
	var q;
	q = 'var='+encodeURI($('id').value);
	postHTTPReq(url,q,destinationid);
}

function selectContent(id)
{
	$(id).focus();
	$(id).select();
	var ua = navigator.userAgent;
	if(ua.indexOf('MSIE')!=-1)
	{
		CopiedTxt = document.selection.createRange();
		CopiedTxt.execCommand("Copy");
	}
}

function doNothing( )
{
	return true;
}
window.onerror = doNothing;