/* Wichtig für Jörg: Die xxxWMTT Funktionen sind nur proforma hier, weil man damit Drag&Drop realisieren kann, wenn man denn will :-) */


function get_dom_object(id) {
  if(id) {
    if(document.all) {
      return document.all[id];
    } else if (document.getElementById) {
      return document.getElementById(id);
    } else {
      return false;
    }
  }
}




function display_object(id) {
  var dom_object = null;
  if(id) {
    dom_object = get_dom_object(id);
    if(dom_object) {
      dom_object.style.display = 'block';
    }
  }
}


function hide_object(id) {
  var dom_object = null;
  if(id) {
    dom_object = get_dom_object(id);
    if(dom_object) {
      dom_object.style.display = 'none';
    }
  }
}


function display_cityselector() {
  display_object('cityselector');
  display_object('cityselector-shadow');
}


function hide_cityselector() {
  hide_object('cityselector');
  hide_object('cityselector-shadow');
}





var mx = 0;
var my = 0;
var moving_object = null;
var wmtt = null;
var sourceTB = null;
//document.onmousemove = updateWMTT;
function updateWMTT(e) {  
    var sL;
    var sT;
    // -------------------------------------------------------------------------------------
    // Ermitteln der ScrollLeft und ScrollTop Postition, also der Information, wie weit der 
    // Inhalt des Fensters bereits gescrollt wurde... Gilt für den IE - weitere Infos unter
    // http://de.selfhtml.org/javascript/objekte/window.htm
    if(document.documentElement) {
      sL = document.documentElement.scrollLeft;
      sT = document.documentElement.scrollTop;
    } else if(document.body) {
      sL = document.body.scrollLeft;
      sT = document.body.scrollTop;
    }
    // -------------------------------------------------------------------------------------
    
    mx = (document.all) ? (event.clientX + sL) : e.pageX;
    my = (document.all) ? (event.clientY + sT)  : e.pageY;
    
    // -------------------------------------------------------------------------------------
    // Mittels des document.all Objekts wird festgestellt, ob es sich um den akt.
    // Browser um einen IE handelt, der die Scroll-Komponente mit eingerechnet bekommen
    // muss. Beim FF und Co. ist dies nicht notwendig, da die Top/Left Position unab-
    // hängig von der gescrollten Entfernung dargestellt wird.
    x = (document.all) ? (event.clientX + sL) : e.pageX;  
    y = (document.all) ? (event.clientY + sT)  : e.pageY;
    
    if (wmtt != null) {
      if(wmtt.style.display == 'block') {
          // wmtt.innerHTML = 'sL = ' + sL + ' - sT = ' + sT;
          wmtt.style.left = (x + 92) + "px";  
          wmtt.style.top  = (y - 200) + "px";  
      }
    }
    
    
    if(moving_object != null) {
      if(moving_object.style.display == 'block') {
          moving_object.style.left = (x + 10) + "px";  
          moving_object.style.top  = (y + 10) + "px";  
      }
    
    }
    // -------------------------------------------------------------------------------------
}  
function showWMTT(id) {
  var current_id = 'text' + id;
  sourceTB = document.getElementById(current_id);
  wmtt = document.getElementById('infotext');
  wmtt.innerHTML = sourceTB.innerHTML;
  wmtt.style.display = "block";
}  
function hideWMTT() {  
    wmtt.style.display = "none";  
}



