function $(id){return document.getElementById(id);}
function calcPosition(id, domObj)
{
	var obj = id ? $(id) : domObj;
	var curleft = curtop = 0;
	if (obj.offsetParent)
	{
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	return new function(){this.Left = curleft; this.Top  = curtop};
}
function AddEventListener(obj, event, func)
{
	if (typeof(obj.addEventListener) != "undefined")
		obj.addEventListener(event, func, true);
	else
		obj.attachEvent("on" + event, func);
	return func;
}
function RemoveEventListener(obj, event, func)
{
	if (typeof(obj.removeEventListener) != "undefined")
		obj.removeEventListener(event, func, true);
	else
		obj.detachEvent("on" + event, func);
}
function inlineBlock(objId, verticalAlign, width, height)
{
	var obj = $(objId);
	try
	{
		obj.style.display = "-moz-inline-box";
	}
	catch(e)
	{
		obj.style.display = "inline";
		obj.style.display = "inline-block";
	}
	obj.style.verticalAlign = (typeof(verticalAlign) == "undefined" || !verticalAlign) ? "middle" : verticalAlign;
	obj.style.width = (typeof(width) == "undefined" || !width) ? "auto" : width;
	obj.style.height = (typeof(height) == "undefined" || !height) ? "auto" : height;
}
function isIE() { // Private method
  return navigator.userAgent.indexOf("MSIE") > -1;
}