// Author: Christian Bertermann, Sebastian Kraiker
// This file is automatically included by javascript_include_tag :defaults

function show_info(event, info_text) {//erstellt und zeigt Info-Box
   var box_width = 300;
//   $('body').insert(new Element('div',{'class':'info_note','id':'info_box'}));
   document.body.appendChild(new Element('div',{'id':'info_box'}));
   $('info_box').innerHTML = info_text;
   $('info_box').style.position = "absolute";
   $('info_box').style.width = box_width + "px";
   $('info_box').className = 'info_note';

   var yoffset;
    if (navigator.userAgent.search(/MSIE/) != -1) {
       // is IE
       yoffset = document.documentElement.scrollTop;
    } else {
       yoffset = window.pageYOffset;
    }
    var x = (event.clientX-10);
    var overFlowX = x + box_width - document.body.offsetWidth;
    x = overFlowX > 0 ? x - overFlowX : x;

   $('info_box').style.left = x + "px";
   $('info_box').style.top  = (event.clientY + 25 + yoffset) + "px";
}

function remove_info() {//entfernt Info-Box
						$('info_box').remove();
}