// Javascript functions to encode email address to avoid being collected by spam mail robots
// by Dr X B Chen

<!--
function email_encoded2(linktext,name,domain,end){
document.write("<a href=\"mailto:" + name + "@" + domain + "." + end + "\">");
document.write(linktext + "</a>");
}

function email_encoded(name,domain,end){
document.write("<a href=\"mailto:" + name + "@" + domain + "." + end + "\">");
document.write(name + "@" + domain + "." + end + "</a>");
}

// Example:
// value1 = 3; value2 = 4;
// messageBox("text message %s and %s", value1, value2);
// this message box will display the text "text message 3 and 4"
function messageBox()
{
  var i, msg = "", argNum = 0, startPos;
  var args = messageBox.arguments;
  var numArgs = args.length;
  if(numArgs)
  {
    theStr = args[argNum++];
    startPos = 0;  endPos = theStr.indexOf("%s",startPos);
    if(endPos == -1) endPos = theStr.length;
    while(startPos < theStr.length)
    {
      msg += theStr.substring(startPos,endPos);
      if (argNum < numArgs) msg += args[argNum++];
      startPos = endPos+2;  endPos = theStr.indexOf("%s",startPos);
      if (endPos == -1) endPos = theStr.length;
    }
    if (!msg) msg = args[0];
  }
  alert(msg);
}

function msg(messageStr){
alert(messageStr);
}

// jump function
// example
//onChange="MM_jumpMenu('parent',this,0)"

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// -->
