/* Creation date: 19/09/2004 */
/*creats a mailto: link on the fly, to prevent spam spiders from picking up
 *email addresses off the site.
 *user:    username part of the address
 *domain:  domain part of the address
 *link:    (optional) text to link to the address. if ommited, the address
 *         itself is displayed.
 *subject: (optional) subject line for the email message
 */
function email(user, domain, link, subject) {
  if (link == null) { //link user@domain
    showtext=user + "@" + domain;
  }
  else {
    showtext=link;
  }
  document.write("<a href=\"" + "mail" + "to:" + user + "@" + domain);
  if (subject != null) {
    document.write("?subject=" + subject);
  }
  document.write("\">" + showtext + "<\/a>");
}

/*function to randomly select a mirror from sourceforge.net.
 *randomizes among european and north american mirrors.
 *file - name of the file to download
 */
function getMirror(file) {
  var mirrors=new Array("mesh",     //Mesh,     germany, eu
                        "superb-east",//Superb, va,      us
                        "surfnet",  //surfnet,  holland, eu
						"easynews", //easynews, az,      us
                        "heanet",   //HEAnet,   ireland, eu
						"umn",      //MN univ,  mn,      us
						"switch",   //switch,   switzerland, eu
                        "belnet",   //belnet,   belgium, eu
						"internap", //internap, ga,      us
                        "puzzle",   //puzzle,   swiss,   eu
		                "kent");    //kent univ,kent, uk,eu
						
  var site=Math.round(Math.random()*10*1.1);//upper limit: 11, lower limit: 0
  window.open("http://prdownloads.sourceforge.net/hebmoz/" + file +
              "?use_mirror=" + mirrors[site]);
}
