/*
var tooltipTimout = 0;
var oTooltipDiv = 0;

function tooltip(tip,where)
{
   if(!oTooltipDiv)
   {
      oTooltipDiv = document.createElement("DIV");
      document.body.appendChild(oTooltipDiv);
      oTooltipDiv.className = 'tooltip';
      oTooltipDiv.style.position = 'absolute';
      oTooltipDiv.style.zIndex = 255;

      oTooltipDiv.onmouseover = hideTooltip;

   }

   if(tip=='') return hideTooltip();
   div = document.getElementById('tooltipdiv');
   div = oTooltipDiv;
   div.innerHTML = "<DIV>"+tip+"</DIV>";
   where.onmouseout=hideTooltipDelayed500;
   t = where.offsetHeight +5;
   l = 0;
   par = where;
   while(par)
   {
      if(par.offsetTop) t += par.offsetTop;
      if(par.offsetLeft) l += par.offsetLeft;
      par = par.offsetParent;
   }


   div.style.top = t;
   docWidth = window.document.body.scrollWidth;
   if(l < docWidth - 200)
   {  // Het past gewoon
      div.style.left = l
      div.style.width = Math.max(200,where.offsetWidth);
   }
   else
   {  // het past niet
      div.style.left = docWidth - 200 ;
      div.style.width = 200;
   }
   div.style.display = "";
   if(tooltipTimout) clearTimeout(tooltipTimout);
   hideTooltipDelayed(10000);
}

function hideTooltip()
{
   if(tooltipTimout) clearTimeout(tooltipTimout);
   tooltipTimout = 0;
   oTooltipDiv.style.display = "none";
}

function hideTooltipDelayed(time)
{
   if(tooltipTimout) clearTimeout(tooltipTimout);
   tooltipTimout = setTimeout('hideTooltip()',time);
}
function hideTooltipDelayed500(time) { hideTooltipDelayed(500); }


*/
var childWindow = 0;
var hasToCloseChild = 1;


function go( url )
{
   window.location=url;
}

function goPopup( url )
{
   if( window.name == 'srov_popup' )
   {  // we zitten al in een popup
      window.location = url;
   }
   else
   {
      popup( url );
   }
}

function goMain( url )
{
   if( window.name == 'srov_popup' )
   {  // we zitten in een popup
   // window.opener.closeChild = 0;
      window.opener.location =  url;
   }
   else
   {
      window.location = url;
   }
}

function goMainRedirect( url )
{
   if( window.name == 'srov_popup' )
   {  // we zitten in een popup
      window.opener.location =  url;
      window.close();
   }
   else
   {
      window.location = url;
   }
}

function popup( url )
{
   var xMax = null;
   var yMax = null;

   if (document.all)
   {
      xMax = screen.width;
      yMax = screen.height;
   }
   else
   {
      if (document.layers)
      {
         xMax = window.outerWidth;
         yMax = window.outerHeight;
      }
      else
      {
         xMax = 640;
         yMax = 480;
      }
   }

   var xOffset = (xMax - 400)/2;
   var yOffset = (yMax - 500)/2;

   childWindow = window.open( url, "srov_popup",
      "width=450, height=500, "+
      "location=0, menubar=0, resizable=1, scrollbars=1, toolbar=no, "+
      "left=" + xOffset + ", top=" + yOffset );
   childWindow.focus();

   hasToCloseChild=1;
}

function closeAndReloadParent( sUrl )
{
   if( window.opener )
   {
      if( sUrl )
      {
         window.opener.location.href = sUrl;
      }
      else
      {
         window.opener.location.reload();
      }
      window.close();
   }
   else
   {
      alert("Not an opened window.");
   }
}

function closeChild()
{
   if(hasToCloseChild && (childWindow!=0))
   {
      childWindow.close();
      childWindow = 0;
   }

}


function deorphanize()
{/*
   if((! window.opener) || window.opener.closed)
   {  // ouder is overleden. Dan wijzelf ook maar...
      // (Dat kan natuurlijk theatraler)
      window.close();
   }
   else//   */
   if(window.opener.childWindow == 0)
   {
      // pa leeft nog.
      // vertel hem dat we zijn kindje zijn.
      window.opener.childWindow = window;
      window.opener.hasToCloseChild=1;
   }
}



// zorg dat het kind altijd bekend is bij zij/haar ouder.
if( window.opener )
{
   window.setInterval("deorphanize()",100);
}


