function start_func( new_func )
  {
  var old_func = window.onload;
  if ( typeof window.onload != "function" )
    window.onload = new_func;
  else
    {
    window.onload = function()
      {
      old_func();
      new_func();
      }
    }
  }

function end_func( new_func )
  {
  var old_func = window.onunload;
  if ( typeof window.onunload != "function" )
    {
    window.onunload = new_func;
    }
  else
    {
    window.onunload = function()
      {
      old_func();
      new_func();
      }
    }
  }

if ( typeof(populate) == "function" )
  start_func(populate);
if ( typeof(banner_rotate_start) == "function" )
  start_func(banner_rotate_start);
if ( typeof(preload_images_start) == "function" )
  start_func(preload_images_start);
if ( typeof(ipoker_start) == "function" )
  start_func(ipoker_start);