//************************************************//
//   Copyright 2005 All Rights Reserved	  	      //
//   standard.js                                  //
//   Ryan White 06-02-2006                        //
//************************************************//

function externalLinks() 
{
  if (document.getElementsByTagName)
  {
    var anchors = document.getElementsByTagName("a");

    for (var i=0; i<anchors.length; i++) 
    {
      var hrefValue  = anchors[i].href.toString();
      var expression = /(jacksons)|(validator)/; 
    
      if ( !( hrefValue.match(expression) ) )
      {  
         anchors[i].onclick = function(){return openWin(this.href)};
      }
    }
  }
}  

function openWin(pageHref) 
{
  show = window.open(pageHref);
  show.window.focus();

  return false;
}

function levelling() 
{
  if((!document.getElementById) && document.all)                   // .all returned, enter lamo browser mode
  {
    document.getElementById = function(id)                         // replace getElementById with a mod hack
    {
      element = document.all[id];                                  // attempt to "get" the element by its id
       
      if(element)                                                  // something found, continue                                           
      { 
        if((!element.id)||(element.id != id))                      // if not an exact match digress further
        {
          if(element.length)                                       // if returned collection like behaviour
          {
            for(var k = 0; k<element.length ;k++)
            {
              if((element[k].id)&&(element[k].id == id))           // find a valid member and an id specific match within collection 
              {
                return element[k];
              }
            }
          }
        } 
        else                                                       // return match, not null, not name match, not collection 
        {
          return element;
        }     
      }
           
      return null;                                                 // no much at all return null 
    };
  }
}


function printMail()
{
  var a = '%6f%72%64%65%72%73';
  var A = 'o'+'r'+'d'+'e'+'r'+'s';
  var b = '%40';
  var B = '@';
  var c = '%6a%61%63%6b%73%6f%6e%73';
  var C = 'j'+'a'+'c'+'k'+'s'+'o'+'n'+'s';
  var d = '%2e%63%6f%6d%2e%61%75';
  var D = '.'+'c'+'o'+'m'+'.'+'a'+'u';
  var e = 'm'+'a'+'i'+'l'+'t'+'o'+':';
  
  var element = document.getElementById('mail-addr');
  
  while(element.firstChild) 
     element.removeChild(element.firstChild);
     
  var ref = document.createElement('a');
  ref.setAttribute('href', e+a+b+c+d);
  
  element.appendChild(ref);
  ref.appendChild(document.createTextNode(A+B+C+D)); 
}

////////////////////////////////////////////////////