function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function testAjax() {

  var xhp;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xhp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xhp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        {
        xhp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
	return xhp;

} 
function startAllLists() {
startList('MainMenu');
startList('ClientMenu');
}

function startList(navElem) {
if ((document.getElementById) && (document.getElementById(navElem)) ) {
navRoot = document.getElementById(navElem);
navRoot.className+=" menu";
document.getElementById('leftMenu').style.visibility='visible';
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.className+=" out";

node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", " out");
   }
   }
  }
 }
}
window.onload=startAllLists;

function resizeOuterWrapper() {
	if (!document.getElementById('outerWrapper')) return false;
	document.getElementById('outerWrapper').style.height=Math.floor((document.documentElement.clientHeight*.95))+'px';
}
function resizeCustomPageDiv() {
	if (!document.getElementById('customPageDiv')) return false;
	var H=document.documentElement.clientHeight;
	var W=document.documentElement.clientWidth;
	var cpd=document.getElementById('customPageDiv');
	cpd.style.height=Math.floor((H-130))+'px';
	if (W < 750) { 
		cpd.style.width=(W-300)+'px';
	}
	else {
		cpd.style.width='500px';
	}
	
}
