


if (navigator.appName == 'Netscape') {
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = netscapeMouseMove;

}

function shClass()
{

  if (navigator.appName == 'Netscape')
  {
   document.getElementById("shadow").className = "NNshadow";

  }

  if (navigator.appName == 'Microsoft Internet Explorer')
  {
   document.getElementById("shadow").className = "IEshadow";

  }

  if (navigator.appName == 'Opera')
  {
   document.getElementById("shadow").style.display = "none";
  }
}



function netscapeMouseMove(e) {

    //if (e.pageX != document.test.x.value && e.pageY != document.test.y.value) {
     if (document.getElementById('container'))
     {
  	   document.getElementById('container').style.left = e.pageX+9 ; // - (window.outerWidth-window.innerWidth);
	     document.getElementById('container').style.top =  e.pageY+9 ;//-(window.outerHeight-window.innerHeight);
     }

    //}
}

function microsoftMouseMove() {

  if (document.getElementById('container'))
  {
  	document.getElementById('container').style.left = window.event.x + document.body.scrollLeft +7;
	  document.getElementById('container').style.top =  window.event.y + document.body.scrollTop +7;
  }

}

function hint_on(id, aCaption, aText)
{

  Init(id);


  if (document.getElementById('H_hintCaption').hasChildNodes())
  {
    el = document.getElementById('H_hintCaption').childNodes[0];
    el.parentNode.removeChild(el);
  }

  if (document.getElementById('H_hintText').hasChildNodes())
  {
    el = document.getElementById('H_hintText').childNodes[0];
    el.parentNode.removeChild(el);
  }


  if (document.getElementById('S_hintCaption').hasChildNodes())
  {
    el = document.getElementById('S_hintCaption').childNodes[0];
    el.parentNode.removeChild(el);
  }

  if (document.getElementById('S_hintText').hasChildNodes())
  {
    el = document.getElementById('S_hintText').childNodes[0];
    el.parentNode.removeChild(el);
  }

  ht = document.createElement("SPAN");
  hc = document.createElement("SPAN");

  st = document.createElement("SPAN");
  sc = document.createElement("SPAN");

  ht.innerHTML = aText;
  hc.innerHTML = aCaption;

  st.innerHTML = aText;
  sc.innerHTML = aCaption;

  document.getElementById('H_hintCaption').appendChild(hc);
  document.getElementById('H_hintText').appendChild(ht);

  document.getElementById('S_hintCaption').appendChild(sc);
  document.getElementById('S_hintText').appendChild(st) ;

  document.getElementById('container').style.display='';

  document.getElementById('S_hintFrame').style.visibility='hidden';
}



function hint_off()
{
  document.getElementById('container').style.display='none';
}



function Init(id)
{

  if (navigator.appName == 'Microsoft Internet Explorer') {

    if (document.getElementById(id).onmousemove == null){ 		
      document.getElementById(id).onmousemove = microsoftMouseMove;
      Hint();

      }
  }

  if (navigator.appName == 'Netscape') {
    Hint();
    
  }
}

//------------------ hint rajzolo fuggvenyek-------


function Hint()
{

  containerLeyer = document.createElement("DIV");
  containerLeyer.setAttribute("id","container");

	hintLayer = document.createElement("DIV");
  hintLayer.setAttribute("id","hint");
  hintContent = CreateHint("H_");
  hintLayer.appendChild(hintContent);
  
  
  shadowLayer = document.createElement("DIV");
  shadowLayer.setAttribute("id","shadow");
  shadowContent = CreateHint("S_");
  shadowLayer.appendChild(shadowContent);

  containerLeyer.appendChild(hintLayer);
  containerLeyer.appendChild(shadowLayer);

	document.getElementsByTagName('BODY')[0].appendChild(containerLeyer);


  document.getElementById("H_hintTextRow").className = "hintTextRow";
  document.getElementById("H_hintCaptionRow").className = "hintCaptionRow";
  document.getElementById("H_hintFrame").className = "hintFrame";
  
  document.getElementById("S_hintTextRow").className = "hintTextRow";
  document.getElementById("S_hintCaptionRow").className = "hintCaptionRow";
  document.getElementById("S_hintFrame").className = "hintFrame";

  shClass(); //browser függő shadow class hozzárendelés

  document.getElementById('container').style.display='';


  return containerLeyer;
}

function CreateHint(n)
{


      hintFrame       = document.createElement("TABLE");
      hintFrameHead   = document.createElement("THEAD");
      hintFrameBody   = document.createElement("TBODY");
      hintCaptionRow  = document.createElement("TR");
      hintTextRow     = document.createElement("TR");
      hintCaptionCell = document.createElement("TD");
      hintTextCell    = document.createElement("TD");

      hintFrame.setAttribute("width","100%");
      hintFrame.setAttribute("id",n+"hintFrame");

      hintFrameHead.setAttribute("id",n+"hintCaptionRow");
      hintFrameBody.setAttribute("id",n+"hintTextRow");

      hintCaptionCell.setAttribute("id",n+"hintCaption");
      hintTextCell.setAttribute("id",n+"hintText");

        hintFrame.appendChild(hintFrameHead);
          hintFrameHead.appendChild(hintCaptionRow);
            hintCaptionRow.appendChild(hintCaptionCell);

        hintFrame.appendChild(hintFrameBody);
          hintFrameBody.appendChild(hintTextRow);
           hintTextRow.appendChild(hintTextCell);


      hintFrame.cellSpacing='0';
      hintFrame.cellPadding='3';

      
      return hintFrame;
}


