function getElem(elem)
{
	if(dom)
		return document.getElementById(elem);
	if(ie)
		return document.all[elem];
}

function getWidth(elem)
{
	if(dom)
	{
			var menuWidth = document.defaultView.getComputedStyle(elem, '').getPropertyValue("width");
			return parseInt(menuWidth.substring(0, menuWidth.indexOf("p")));
	}
	if(ie)
		return document.all.sidemenu.offsetWidth;
}

function init()
{
	if(!nn4)
	{
		var sidemenu = getElem("sidemenu");
		if(sidemenu)
		{
			var content = getElem("content");
			var crumb = getElem("breadcrumb");
			var width = getWidth(sidemenu) + 20;
			 
			if(dom)
			{
				var margin = 0 - width;
				var crumbMargin = margin + 5;
			}
			if(ie)
			{
				var margin = (0 - width) / 2;
				var crumbMargin = 0 - width + 5;
			}
			
			content.style.paddingLeft = width + "px";
			sidemenu.style.marginLeft = margin + "px";
			crumb.style.marginLeft = crumbMargin + "px";
		}
	}
}


var nn4 = (document.layers) ? true : false
var ie = (document.all) ? true : false
var dom = (document.getElementById && !document.all) ? true : false

window.onload = init;