﻿this.KHF=function(e) { 
  e=document.getElementById('keyboard_europeanlatin_help');
  if (typeof e.onselectstart!="undefined") //IE route
    e.onselectstart=function(){return false;};
  else
  {
    e.style.MozUserSelect="none";
    e.style.KhtmlUserSelect="none";
    e.style.UserSelect="none";
  }
  var ch = e.getElementsByTagName('td');      

  for(var i = 0; i < ch.length; i++)
  {               
    if(ch[i].attributes['o'])
    {                                                         
      var so = ch[i].attributes['o'].value, sc = ch[i].attributes['c'].value;
      ch[i].title = 'The following combinations are available: '+so;
      var ce = function(tag){return document.createElement(tag);}
      var sx = '<table><tr class="key">', sy = '<tr class="out">';
      var e2 = ce('div');
      for(var j = 0; j < sc.length; j++)
      {
        sx += '<th>'+ch[i].attributes['x'].value + sc.charAt(j)+'</th>';
        sy += '<td>'+so.charAt(j)+'</td>';
      }
      e2.innerHTML = sx+'</tr>'+sy+'</tr></table>';
      
      var es = e2.style;
      es.background = '#f3ffdf';
      es.border = 'solid 1px #ad4a28';
      es.padding = '2px';
      es.display = 'none';
      es.position = 'absolute';
      es.left = (ch[i].offsetLeft+4)+'px';
      es.top = '24px';
      e2.onclick = function() { KeymanWeb.KT(); window.event.cancelBubble=true; return false; }
      
      ch[i].kmw_subitems = e2;
      ch[i].appendChild(e2);
      ch[i].onmouseover = function() { this.style.background = KeymanWeb_KeyHoverColor; this.kmw_subitems.style.left=this.offsetLeft+4+'px'; this.kmw_subitems.style.top=(this.offsetParent.offsetTop+this.offsetTop+this.offsetHeight-2)+'px'; this.kmw_subitems.style.display = 'block'; return false; }
      ch[i].onmouseout = function() { this.style.background = ''; this.kmw_subitems.style.display = 'none'; return false; }
    }
    else
    {
      ch[i].onmouseover = function() { this.style.background = KeymanWeb_KeyHoverColor; return false; }
      ch[i].onmouseout = function() { this.style.background = ''; return false; }
    }
        
    ch[i].onclick = function(e) { with(this) { if(attributes['x']) KeymanWeb.KT(attributes['x'].value,0); else KeymanWeb.KT(innerHTML); } if(!e)e=window.event;if(e) e.cancelBubble=true; }
    ch[i].onmousedown = function(e) { KeymanWeb.KSF(); if(!e)e=window.event;if(e) e.cancelBubble=true; }
  }

  e.onclick=function() { KeymanWeb.KT(''); return false; }
  e.onmousedown=function() { KeymanWeb.KSF(); return false; }
}