var loadtimer;
function writeemail(username, domain, tld)
{
  document.write("<a href=\"mailto:");
  document.write(username);
  document.write("@");
  document.write(domain);
  document.write(".");
  document.write(tld);
  document.write("\">");
  document.write(username);
  document.write("@");
  document.write(domain);
  document.write(".");
  document.write(tld);
  document.write("</a>");
}

function setBigPicOld(that)
{
  document.getElementById("photofull").src=that.src;
}
function setBigPic(that)
{
  document.getElementById("photofull").src=that.src.replace("-th.jpg","-full.jpg");
}

function uploadStart()
{
  document.getElementById("uploadstatus").innerHTML="Loading..";
  loadtimer=setInterval(incrementLoader,300);
  return(true);
}
function uploadFinish(status)
{
  clearInterval(loadtimer);
  document.getElementById("uploadstatus").innerHTML=status;
  //return(true);
}
function incrementLoader()
{
  var statdiv=document.getElementById("uploadstatus");
  var statmsg=statdiv.innerHTML;
  if(statmsg.slice(0,7)!="Loading") return;
  statmsg+=".";
  if(statmsg.length>12) statmsg="Loading";
  statdiv.innerHTML=statmsg;
}
function uploadEmerg()
{ //This procedure prints an error message as the status, just in case there
  //is an error in the PHP script and the JavaScript never runs.
  switch(document.getElementById("uploadstatus").innerHTML.slice(0,7))
  {
    case "Loading":
      uploadFinish("Internal Script Error");
    case "Waiting": break;
  }
}
