function removeDashBoard(_method) {
  try {
    if (top.location != this.location) {
      if (!_method) {
        if (this.window.name != "url") { var win = window.open(this.document.location.href, "url"); }
      } else{
        var win = window.open("about:blank", "dot_tk_dashboard", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=100%,height=1px,screenX=0,screenY=0");
        if (win) { win.scrollTo(0, 0); win.resizeTo(0, 0); }
      }
    }
  } catch(e) { return; }
}
/* try { window.setTimeout("removeDashBoard(0);", 10); } catch(e) { } */

function hide(_id, _st) {
  try {
    if (typeof(_id) == "string") { var _obj = document.getElementById(_id); } else { var _obj = _id; }
    if (_obj) {
      if (_st.toString() == "") { return ((_obj.style.display == "none") ? true : false); }
      else { _st = (_st ? "none" : ""); _obj.style.display = _st; return (_st ? false : true); }
    }
  } catch(e) { return; }
}

function chat(_nick) {
  try {
    var _url = (location.protocol + "//" + location.host + "/chat/");
    if ((_nick != null) && (_nick != "")) { var _url = (_url + "?nick=" + _nick); }
    window.open(_url, "WJTKChat", "width=665px, height=515px, channelmode=0, directories=0, fullscreen=0, location=0, menubar=0, resizable=1, scrollbars=1, status=0, titlebar=1, toolbar=0", true);
  } catch(e) { return; }
}

function plusminus(_id, _root) {
  try {
    if (typeof(_id) == "string") { var _obj = document.getElementById(_id); } else { var _obj = _id; }
    if ((_obj) && (_root)) {
      var _st = hide(_obj, ((_root.alt == '[+]') ? false : true));
      _root.src = ('images/ico_' + (_st ? 'minus' : 'plus') + '.gif');
      _root.alt = (_st ? '[-]' : '[+]');
    }
  } catch(e) { return; }
}

function scrollDiv(_obj, _st) {
  try {
    if (_obj) {
      _obj.stop();
      if ((_st == true) && (_obj.scrollWidth > _obj.offsetWidth)) { _obj.start(); }
    }
  } catch(e) { return; }
}

function pointer(_pr, _y) {
  try {
    var _pr = ((typeof(_pr) == "string") ? document.getElementById(_pr) : _pr);
    if (_pr) { _pr.style.cursor = ((_y == true) ? "pointer" : "default"); }
  } catch(e) { return; }
}

function toTarget(_ev) {
  try {
    return ((_ev.relatedTarget) ? _ev.relatedTarget : _ev.toElement);
  } catch(e) { return true; }
}

try { var _tm_opz = 0; window.setTimeout("hide('img_opz', true);", 500); } catch(e) { }
function options(_ev, _desc, _desc_hide) {
  try {
    var _id = ((_desc == "") ? "div_opz" : "div_opz_desc");
    var _obj = document.getElementById(_id);
    if (_obj) {
      if ((_desc == "") && (_desc_hide == true)) {
        if (_tm_opz) { window.clearTimeout(_tm_opz); }
        hide(_obj, false); _tm_opz = window.setTimeout("hide('div_opz', true);", 1500);
      } else {
        if ((_desc == "") && (_desc_hide == false)) {
          var _ev = toTarget(_ev);
          if (_tm_opz) { window.clearTimeout(_tm_opz); }
          if ((_ev == _obj) || (_ev.parentNode == _obj) || (_ev == 'undefined') || (_ev.id == 'div_opz') || (_ev.id == 'div_opz_desc') || (_ev.name == 'div_opz_obj')) { hide(_obj, false); } else { hide(_obj, true); }
        } else {
          var _ev = toTarget(_ev);
          if (((_ev.id == 'img_opz') || (_ev.id == 'div_opz_desc')) && (_desc_hide)) { _desc_hide = false; }
          _obj.innerHTML = _desc; hide(_obj, _desc_hide);
        }
      }
    }
  } catch(e) { }
}

function homepage() {
  try {
    var _man = ("\r\n\r\nSi dovra' procedere alla impostazione manuale dal proprio Pannello delle Opzioni specificando '" + location.protocol + "//" + location.host + "' come sito-pagina iniziale.");
    var _ua = navigator.userAgent.toUpperCase();
    if ((_ua.indexOf("MSIE") > 0) && (_ua.indexOf("OPERA") <= 0) && (_ua.indexOf("GECKO") <= 0) && (_ua.indexOf("WEBTV") <= 0)) {
      return true;
    } else if ((_ua.indexOf("OPERA") != -1) || (_ua.indexOf("GECKO") != -1)) {
      alert(unescape("Questo Browser non permette di impostare una Home-Page con una sintassi Javascript!" + _man));
    } else {
      alert(unescape("Impossibile impostare una Home-Page per il Browser '" + navigator.userAgent + "' poiche' non si conosce la sintassi Javascript!" + _man));
    }
    return false;
  } catch(e) { return false; }
}

function favorites() {
  try {
    if ((window.sidebar) && (window.sidebar.addPanel)) {
      if (navigator.userAgent.lastIndexOf("Netscape") != -1) {
        window.sidebar.addPanel(document.title, (location.protocol + "//" + location.host), "");
      } else {
        window.sidebar.addPanel(document.title, (location.protocol + "//" + location.host), "");
      }
    }
    if ((window.external) && ((navigator.platform == "Win32") || ((window.ScriptEngine) && (ScriptEngine().indexOf('InScript') + 1)))) {
      window.external.AddFavorite(location.href.replace(/#.*/, ""), document.title);
    }
    return false;
  } catch(e) { return false; }
}

function Focus() {
  try {
    var _jchat = document.getElementById("jchat"); if (_jchat) { _jchat.requestSourceFocus(); }
  } catch(e) { return; }
}

function Guida() {
  try {
    return false;
  } catch(e) { return false; }
}

function Help() {
  try {
    return false;
  } catch(e) { return false; }
}

function init(e) {
  try {
    var inputs = document.getElementsByTagName("input");
    var images = document.getElementsByTagName("img");
    for (var _i = 0; (_i < inputs.length); _i++) { inputs[_i].align = "absmiddle"; }
    for (var _i = 0; (_i < images.length); _i++) {
      if ((images[_i].align != "left") && (images[_i].align != "right")) { images[_i].align = "absmiddle"; }
    }
  } catch(e) { return false; }
}

try {
  window.onload = function() { init(); }
  document.oncontextmenu = new Function("return false;");
  document.onselectstart = new Function("return true;");
  document.ondragstart = new Function("return false;");
} catch(e) { }