// Let's make document.getElementById shorter ;-) (by-id)
function bid(name)
{
	return document.getElementById(name);
}

// Tooltip
function toolTip()
{
	// Add :->
	for(var i=0,d,dE,D=document,span;d=D.getElementsByTagName('*')[i++];)
	{
		if(d.getAttribute('title'))
		{
			d.onmouseover=function(e)
			{
				if(this.getAttribute('title')!=undefined)
				{
					var e=e||event;
					box=D.createElement('span');
					box.id='tooltip';
					box.appendChild(D.createTextNode(this.getAttribute('title')));
					with(box.style)
					{
						position='absolute';
						top=e.clientY+(dE=D.documentElement).scrollTop+15+'px';
						left=e.clientX+dE.scrollLeft+15+'px';
					}
					// Old box? (Gecko [maybe not only] bug) - part 1
					if(this.title!=null&&this.title!='')
					{
						this.title_ex=this.title;
					}
					this.title='';
					D.body.appendChild(box);
				}
			}
			d.onmouseout=function()
			{
				if(this.getAttribute('title')!=undefined&&this.title_ex!=undefined)
				{
					this.title=this.title_ex;
					D.body.removeChild(box);
					// Old box? (Gecko [maybe not only] bug) - part 2
					if(bid('tooltip')!=null)
					{
						D.body.removeChild(bid('tooltip'));
					}
				}
			}
		}
	}
}

// Upload
function upload()
{
	document.title='[Upload in progress] '+document.title;
	setTimeout("bid('uploadBox').innerHTML='<b>'+bid('fileName').value+'</b> upload in progress, please wait... <input type=\"button\" value=\"Cancel\" onclick=\"parent.location.href=parent.location;\">';",100);
}

// <body> onload
function bodyStart()
{
	toolTip();
	bid('swap-box').innerHTML='<iframe id="swap" src="/null"></iframe>';
}
