function decryptEmail(address)
{
  var work = address;
  var result = "";
  var errcount = 10;
  while(work.length > 0)
  {
    errcount--;
    if (errcount == 0) return "Whoops!";
    var i = work.indexOf(",");
    var workNum;
    if (i > -1)
    {
      workNum = work.substring(0, i);
      work = work.substring(i + 1);
    }
    else
    {
      workNum = work;
      work = "";
    }
    errcount = 10;
    while (workNum > 0)
    {
      errcount--;
      if (errcount == 0) return "Whoops loop 2";
      var charValue = (workNum ^ 85) & 255;
      workNum >>>= 8;
      result = String.fromCharCode(charValue) + result;
    }
  }
  return result;
}

function decryptEmailHTML(address)
{
  var work = address;
  var result = "";
  var errcount = 10;
  while(work.length > 0)
  {
    errcount--;
    if (errcount == 0) return "Whoops!";
    var i = work.indexOf(",");
    var workNum;
    if (i > -1)
    {
      workNum = work.substring(0, i);
      work = work.substring(i + 1);
    }
    else
    {
      workNum = work;
      work = "";
    }
    errcount = 10;
    while (workNum > 0)
    {
      errcount--;
      if (errcount == 0) return "Whoops loop 2";
      var charValue = (workNum ^ 85) & 255;
      workNum >>>= 8;
      result = "&#" + charValue + ";" + result;
    }
  }
  return result;
}

function encryptedEmailAddressK()
{
  return "14904,556759862,556742196,789914932,1042625569";
}

function encryptedEmailAddressH()
{
  return "14904,556759862,556742196,789914932,1042625569";
}

function writeEmail()
{
  document.write(getEmailAddressHTML());
}

function popupEmail(address)
{
  var win = popup("", "emailWindow", 400, 120, 0);
  var doc = win.document;
  var email=decryptEmail(address);
  var emailHTML = decryptEmailHTML(address);
  doc.open("text/html", "replace");
  doc.write("<HTML><HEAD><TITLE>Spam-proof Email Link</TITLE>");
  doc.write("<LINK title=standard href='kr.css' type=text/css rel=stylesheet>");
  doc.write("<BODY CLASS='Popup'><DIV ALIGN='center'>");
  doc.write("<P>Email address is <A HREF='mailto:" + email + "'>" + emailHTML + "<A></P>");
  doc.write("<P><form><input type='button' name='close' value='Close Window' onclick='javascript:window.close()'></form></P>");
  doc.write("</DIV></BODY></HTML>");
  doc.close();
  win.focus();
}

function popup(URL, windowname, width, height, scrollbars)
{
    var xposition=200;
    var yposition=200;
    if ((parseInt(navigator.appVersion) >= 4 )){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    var args = 'width=' + width + ',' 
    + 'height=' + height + ',' 
    + 'location=0,' 
    + 'menubar=0,'
    + 'resizable=1,'
    + 'scrollbars=' + scrollbars + ','
    + 'status=0,' 
    + 'titlebar=0,'
    + 'toolbar=0,'
    + 'hotkeys=0,'
    + 'screenx=' + xposition + ','  //NN Only
    + 'screeny=' + yposition + ','  //NN Only
    + 'left=' + xposition + ','     //IE Only
    + 'top=' + yposition;           //IE Only

  var win = window.open(URL, windowname, args);
  return win;
}  





