var daIPE_mailtosdecoded = false;

function decodeOctal(octal) {

    endstring = "";
    startstring = octal;
    while (octal != "") {
      temp = octal.substr(0, 4);
      octal = octal.substr(4);
      tempint = (parseInt(temp.substr(1,1)) * 64) + (parseInt(temp.substr(2,1)) * 8) + (parseInt(temp.substr(3,1)));
      endstring = endstring + String.fromCharCode(tempint);

    }
    return endstring;
       

}

function nia(message) {

  niac(message, "#FFFFED");

}

function niac(message, color) {

  // non interupting alert
  var i = 0;
  var tempi = "temp_alert_div" + i;
  try {
    while (top.document.getElementById(tempi)) {
      i++;
      tempi = "temp_alert_div" + i;
    }
  } catch(e) { } 
  
  if (i>0) {
    var newheight = parseInt(top.document.getElementById("temp_alert_div" + (i-1)).style.top) + parseInt(top.document.getElementById("temp_alert_div" + (i-1)).offsetHeight) + 3; 
  } else { 
    var newheight = 150; 
  }
  var a_div = top.document.body.appendChild(document.createElement("DIV"));
  a_div.style.position = "absolute";
  a_div.style.top = newheight+"px";
  a_div.style.left = "200px";
  a_div.style.border = "1px solid black";
  a_div.style.backgroundColor = color;
  a_div.innerHTML = message;
  a_div.id = tempi;
  var tstring = "top.document.body.removeChild(top.document.getElementById('"+tempi+"'))"; 
  setTimeout(tstring, 15000);

}


function daIPE_decodeAllMailtos() {

  mailtos = document.getElementsByTagName("A");
  for (a in mailtos) {
    mailto = mailtos[a];
    text = mailto.toString();
    
    try {
      if (text.substr(0, 8) == "mailto:\\") {
	mailto.href = "mailto:" + decodeOctal(text.substr(7));
	mailto.onmouseover = "";
      } else {
      }
    } catch(e) {}
  }
  daIPE_mailtosdecoded = true;
  
}


function daIPE_decodeWrap() {

    if (!daIPE_mailtosdecoded) {

	daIPE_decodeAllMailtos();

    }

}


