function toggle(id) {
  if(document.getElementById(id).style.display == 'none')
    document.getElementById(id).style.display = '';
  else
    document.getElementById(id).style.display = 'none';
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function popUp(URL) {
  var w = screen.availWidth;
  var h = screen.availHeight;
  var left = (w-500)/2;
  var top = (h-550)/2;
  var day = new Date();
  var id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=550,left = " + left + ",top = " + top + "');");
}

function addSmile(value) {
  document.getElementById('myBox').value += value;
  document.getElementById('myBox').focus();
  return true;
}