var d = String.fromCharCode(46);
var a = String.fromCharCode(64);
var g = String.fromCharCode(62);
var l = String.fromCharCode(60);
document.write(l + 'style type="text/css"' + g + '.noscript { display: none } ' + l + '/style' + g);

//At least old IE allows you to use behaviours to support :hover...
//doesn't work properly in firefox 2 without using javascript (although does in 3)
function showmenu(elem){
  elem.getElementsByTagName('ul')[0].style.display = 'block';
};
function hidemenu(elem){
  elem.getElementsByTagName('ul')[0].style.display = 'none';
};

function setform(day, month, year){
  if(document.getElementById){
    document.getElementById('day').selectedIndex = day;
    document.getElementById('month').selectedIndex = month;
    for(i=0;i<document.getElementById('year').options.length;i++){
      if(document.getElementById('year').options[i].value == year) document.getElementById('year').selectedIndex = i;
    };
    document.getElementById('team').focus();
    return true;
  }else return false;
};

function parsespans(){
  var spans = document.getElementsByTagName('span');
  var pattern = new RegExp("(^|\b)" + 'email' + "(\b|$)");
  for(var i = 0; i < spans.length; i++){
    if(pattern.test(spans[i].className)) convertemail(spans[i]);
  };
};
function convertemail(ipelem){
  var i = 0;
  var addr = getcontents(ipelem);
  
  if(addr.indexOf('@') > 0) ipelem.innerHTML = l + 'a href="mailto:' + addr + '"' + g + addr + l + '/a' + g;
};

function getcontents(ipelem){
  cont = '';
  if(ipelem.hasChildNodes()){ //Nasty cludge due to inconsistencies handling javascript within the node
    for(i = 0; i < ipelem.childNodes.length; i++){
      if(ipelem.childNodes[i].nodeValue != null) cont = cont + ipelem.childNodes[i].nodeValue;
    };
  }else if(typeof ipelem.innerText != undefined) cont = ipelem.innerText;
  else if(typeof ipelem.textContent != undefined) cont = ipelem.textContent;
  return cont;
};

if(window.attachEvent) window.attachEvent("onload", function(){parsespans()});
else if(window.addEventListener) window.addEventListener("load", function(){parsespans()}, false);
else document.addEventListener("load", function(){parsespans()}, false);

function dw(c){document.write(c);};

function togglefolder(elem){
  if(document.getElementById(elem)){
    ele = document.getElementById(elem);
    if(ele.style.display == 'none') ele.style.display = 'block';
    else ele.style.display = 'none';
    return true;
  };
  return false;
};

