function openPopupWindow( theURL,
		                      winName, 
							            features ) 
{ 
  window.open( theURL,
               winName,
               features );
}


/**
  This function allows a new onload function to be used but if there is an existing onload
  function this will be executed as normal including the new onload function.
  To use this function: 
  addOnLoadFunction( function()
  {
    ... code to execute
  });

  @param the new onload function. Not null.
*/ 

function addOnLoadFunction( newOnloadFunction )
{
  var oldonload = window.onload;

  // No existing onload function was found so use the new one specified.
  if ( typeof window.onload != 'function' )

  {
    window.onload = newOnloadFunction; 
  }
  else
  {
    // An existing onload function was found, execute both the old and the new function.
    window.onload = function()
    {
      oldonload();
      newOnloadFunction();
    }
  }
}



function writePlain( stringToWrite )
{  
  var plain = '';
  
  for( var i = 0; i < stringToWrite.length; ++i )
  {
    plain += String.fromCharCode( stringToWrite.charCodeAt( i ) - 1 );
  }
  document.write( plain );
}


