// [SL:20030205]
// Bol menu scripts.

/*
 * [SL/PH:20040820] gebruik van currentStyle ipv style
 * [MS:20041209]	print fit
 */

function ToggleBolmenu()
{
	if('undefined' == typeof(OpenBol))
		return true;

	if('undefined' == typeof(ClosedBol))
		return true;
		
	var oOpenBol, oClosedBol

	if(window.document.getElementsByName)
	{
		oOpenBol	= window.document.getElementsByName('OpenBol');
		oClosedBol	= window.document.getElementsByName('ClosedBol');

		oOpenBol	= oOpenBol[oOpenBol.length - 1];
		oClosedBol	= oClosedBol[oClosedBol.length - 1];
	}
	else
	{
		oOpenBol	= OpenBol
		oClosedBol	= ClosedBol
	}

	oOpenBol.style.visibility	= 'visible';
	oClosedBol.style.visibility	= 'visible';

	if(oOpenBol.style.display == 'none')
	{
		//Open bol was verborgen, toon de open en verberg gesloten.
		oOpenBol.style.display		= 'block';
		oClosedBol.style.display	= 'none';
	}
	else
	{
		oOpenBol.style.display		= 'none';
		oClosedBol.style.display	= 'block';
	}
	return true;
}

function Print(containingElement)
{
      var strTemp, stdPath = "../"

      if('undefined' != typeof(OpenBol))
            OpenBol.style.display   = 'none';

      if('undefined' != typeof(ClosedBol))
            ClosedBol.style.display = 'block';

      if('undefined' != typeof(clsCookie))
      {
            strTemp = clsCookie('KRMenu').getValue('stdPath');
 
            if(strTemp)
                  stdPath = unescape(strTemp);
      }
	  
      window.open(stdPath + 'tools/print.asp?div=' + containingElement);
      return true;
}

function ToggleElement(oSourceObject, strObject)
{
// Als strObject leeg of null dan wordt er een copy-object aangemaakt voor positionering.
// Anders wordt het bestaande object zichtbaar/onzichtbaar gezet.

	var oNewobject;
	var blnUseCopy = (typeof(strObject) == 'string');

	blnUseCopy = (blnUseCopy && (null != strObject));

	if(blnUseCopy)
	{
		blnUseCopy = (strObject != '');
	}

	if(blnUseCopy)
	{
		if(typeof(window.document.getElementById) == 'object')
		{
			// DOM-way of life
			oNewobject = window.document.getElementById(strObject);
		}
		else
		{
			oNewobject = window.document.all[strObject];
		}

		if(oNewobject == null)
		{
			oNewobject = window.document.createElement(oSourceObject.tagName);

			if(typeof(oNewobject) == 'undefined')
				return false;

			oNewobject.id = strObject;
			oNewobject.name = strObject;
			oNewobject.style.display = 'none';

			window.document.body.appendChild(oNewobject);

			oNewobject.className = oSourceObject.className;
			oNewobject.innerHTML = oSourceObject.innerHTML;
		}
	}
	else
	{
		oNewobject = oSourceObject;
	}

	/*
	 * [SL/PH:20040820] gebruik van currentStyle ipv style
	 */
	if(oNewobject.currentStyle.display == 'none')
	{
		oNewobject.style.display = 'block';
	}
	else
	{
		oNewobject.style.display = 'none';
	}
}