function protectAddress( name, account, domain )	{
	var tag1 = "mai"
	var tag2 = "lto:" 
	document.write("<a h" + "ref=" + tag1 + tag2 + account + "@" + domain + ">"+name +"</a>");
	}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

// show/hide menu stuff starts here:

function addEvent(func){
  if (!document.getElementById | !document.getElementsByTagName) return
  var oldonload=window.onload
  if (typeof window.onload != 'function') {window.onload=func}
  else {window.onload=function() {oldonload(); func()}}
}

addEvent(hideAll)

function hideAll(){
  var obj,nextdiv,anchor,content

  // get all divs
  obj=document.getElementsByTagName('div')

  // run through them
  for (var i=0;i<obj.length;i++){

    // if it has a class of reportLink
    if(/reportLink/.test(obj[i].className)){

      // get the adjacent div
      nextdiv=obj[i].nextSibling
      while(nextdiv.nodeType!=1) nextdiv=nextdiv.nextSibling

      // hide it
      nextdiv.style.display='none'
    //create a link
      anchor=document.createElement('a')

      // copy original reportLink text and add attributes
      content=document.createTextNode(obj[i].firstChild.nodeValue)
      anchor.appendChild(content)
      anchor.href='#reports'
      anchor.title='Click to show reports'
      anchor.className="reportLink"
      anchor.nextdiv=nextdiv
      anchor.onclick= function(){
                        showHide(this.nextdiv);
                        changeTitle(this);
                        return false
                      }

      // replace div with created link
      obj[i].replaceChild(anchor,obj[i].firstChild)
    }
  }
}


function changeTitle(obj){
  if(obj)
    obj.title = obj.title=='Click to show reports' ? 'Click to hide reports' : 'Click to show reports'
}

function showHide(obj){
  if(obj)
    obj.style.display = obj.style.display=='none' ? 'inline' : 'none'
}
