function $(e){return document.getElementById(e);}
function h(e){return $(e).offsetHeight;}

function i()
{
	if($('phonehead'))
	{
		var c1=h('left');c2=h('content'),c3=h('right');
		var cmax=Math.max(c1,c2,c3);
		var d1=cmax-c1,d2=cmax-c2,d3=cmax-c3;
		
		if (d1>-4)$('left').style.height=h('left')+d1+4+'px';
		if (d2>0)$('content').style.height=h('content')+d2+'px';
		if (d3>-4)$('right').style.height=h('right')+d3+4+'px';
		
		if ($('apps'))
		{
			var e = $('apps').getElementsByTagName('li');
			var over=function(){this.className='hover';},
				out=function(){this.className='';},
				clicked=function(){window.location.href=this.getElementsByTagName('a')[0].href;};
			
			for(i=0,l=e.length;i<l;i++)
			{
				e[i].onmouseover=over;
				e[i].onmouseout=out;
				e[i].onclick=clicked;
			}
		}
	}
	else
		setTimeout(i,100);
}

if (document.all)
	i();
else if ((document.addEventListener)&&(navigator.userAgent.indexOf('Safari')==-1))
	document.addEventListener("DOMContentLoaded",i,null);
else
	window.i();
	
