function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
function addUnLoadEvent(func) {
  var oldonunload = window.onunload;
  if (typeof window.onunload != 'function') {
    window.onunload = func;
  } else {
    window.onunload = function() {
      if (oldonunload) {
        oldonunload();
      }
      func();
    }
  }
}
function getRefToDiv(divID,oDoc)
{
	if(document.getElementById)
		return document.getElementById(divID);
	if(document.all )
		return document.all[divID];
	if(!oDoc)
		oDoc = document;
	if( document.layers )
	{
		if( oDoc.layers[divID] )
			return oDoc.layers[divID];
		else
		{
			//repeatedly run through all child layers
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ )
			{
				//on success, return that layer, else return nothing
				y = getRefToDiv(divID,oDoc.layers[x].document);
			}
			return y;
		}
	}
	return false;
}
function toggleSection(SectionID)
{
	var thisSection = getRefToDiv(SectionID);
	if(thisSection.style)
	{
		//DOM & proprietary DOM
		if(thisSection.style.display == "none")
			thisSection.style.display = "inline";
		else
			thisSection.style.display = "none";
	}
	else
	{
	    //layers syntax
		if(thisSection.visibility == "hide")
			thisSection.visibility = "show";
		else
			thisSection.style.visibility = "hide";
	}
}