function mailto(name,place)
{
  document.write("<a href='mailto:" + name + "@" + place + "'>");
}

function openWindow(file,w,h,s)
{
  options = "width=" + w + ",height=" + h + ",resizable=1,scrollbars=" + s;
  window.open(file,"",options);
}

function audioPlayer(id,title,file)
{
    document.write("<p id='audioplayer_" + id + "'>Error trying to run audio player script.</p>");
    document.write("<script type='text/javascript'>");
    AudioPlayer.embed("audioplayer_" + id,
    {
        titles    : title,
        soundFile : file
    });
    document.write("</script>");
    document.write("<br><br>");
}

function goTo(url)
{
  window.location.href = url;
}

function slideArrows(prv,nxt)
{
  var strPRV = "onclick=goTo('" + prv + "')> ";
  var strNXT = "onclick=goTo('" + nxt + "')> ";

  document.write("<form id=slidebuttons>");
  document.write("<input class=buttontext type=button value=' << '");
  document.write(strPRV);
  document.write("<input class=buttontext type=button value=' X '");
  document.write("onclick=window.close()> ");
  document.write("<input class=buttontext type=button value=' >> '");
  document.write(strNXT);
  document.write("</form>");
}

function showSlide(num,tot)
{
  var prv = num - 1;
  var nxt = num + 1;

  if (num == 1)
    prv = tot;
  if (num == tot)
    nxt = 1;

  var strPRV = "onclick=goTo('slide_" + prv + ".html')> ";
  var strNXT = "onclick=goTo('slide_" + nxt + ".html')> ";

  document.write("<h4>(" + num + " of " + tot + ")</h4> ");
  document.write("<form id=slidebuttons>");
  document.write("<input class=buttontext type=button value=' << '");
  document.write(strPRV);
  document.write("<input class=buttontext type=button value=' X '");
  document.write("onclick=window.close()> ");
  document.write("<input class=buttontext type=button value=' >> '");
  document.write(strNXT);
  document.write("</form>");

  document.write("<img src='slide_" + num + ".jpg' border=0><br><br> ");
}

var timeout    = 100;
var closetimer = 0;
var ddmenuitem = 0;

// Show sub-menu.
//
function smShow(id)
{
    // Cancel previously scheduled hide.
    smCancelHideTimer();

    // Hide previosly opened sub-menu.
    smHide();

    // Get the new sub-menu and show it.
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible';
}

// Hide sub-menu.
//
function smHide()
{
    if(ddmenuitem)
        ddmenuitem.style.visibility = 'hidden';
}

// Hide sub-menu based on timer.
//
function smHideTimer()
{
    closetimer = window.setTimeout(smHide, timeout);
}

// Cancel hide based on timer.
//
function smCancelHideTimer()
{
    if (closetimer)
    {
        window.clearTimeout(closetimer);
        closetimer = null;
    }
}

// Hide sub-menu when click-out
document.onclick = smHide;

