<!--
/*  fn_general.js   general purpose routines

    function getElementsByClass (searchClass, tag, node)  returns array of matvhing elements
    function $(id)   returns dom object fro element id

    based on routines from Ajax Design Patterns by Michael Mahemoff 
    and Javascript Toolbox by Matt Kruse
    plus others

*/
function getElementsByClass (searchClass, tag, node) 
{
  var classElements = new Array();
  if ( node == null ) node = document;
  if ( tag == null ) tag = '*';

  var els = node.getElementsByTagName(tag);
  var elsLen = els.length;
  var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)");

  for (i = 0, j = 0; i < elsLen; i++) 
  {
    if ( pattern.test(els[i].className) ) 
    {
      classElements[j] = els[i];
      j++;
    }
  }
  return classElements;
}


function $(id) 
{
  if( document.getElementById ) 
    // this is the way the standards work
    return document.getElementById( id );  
  else if( document.all ) 
    // this is the way old msie versions work
    return document.all[id];  
  else if( document.layers ) 
    // this is the way nn4 works
    return document.layers[id]; 
}

var myimages=new Array()
function preloadimages()
{
  for (i=0;i<preloadimages.arguments.length;i++)
  {
    myimages[i]=new Image()
    myimages[i].src=preloadimages.arguments[i]
  }
}

//--->

