  var FM_LEFT       = 0x00000001;  
  var FM_BOTTOM     = 0x00000002;  
  var FM_RIGHT      = 0x00000004;  
  var FM_TOP        = 0x00000008;  
  var FM_TOPLEFT    = 0x00000010;  
  var FM_BOTTOMLEFT = 0x00000020;
  var FM_BOTTOMRIGHT= 0x00000040;
  var FM_RTL        = 0x00000080;
  var FM_NOSHADOW   = 0x00000100;
  var FM_EVAL       = 0x00000200;
  var FM_FIXEDPOS   = 0x00000400;


  var FM_OFFSET   = 350
  var FM_MAXWIDTH = 350

  var nFMStyle = 0
  var nFMDefaultStyle = eval("FM_EVAL | FM_RTL | FM_BOTTOMLEFT")
  var bFM = false
  var bForceFM = false
  var bDisableFM = false
  var FM_nFixedPosX = 0;
  var FM_nFixedPosY = 0;
  var FM_bSticky = false;
  var FM_bDrag = false;
  var FM_nDragStartX;
  var FM_nDragStartY;


var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)

//---------------------------------

  document.onmousemove = OnMouseMove;

  var oLastObj = null
  //---------------------------------

  function FM_StartDrag (obj, event)
  //       ~~~~~~~~~~~~
  {
    obj.setCapture(true)
    FM_nDragStartX = event.screenX;
    FM_nDragStartY = event.screenY;
    FM_bDrag = true
  }
  //---------------------------------------------------------------

  function FM_ContinueDrag (event)
  //       ~~~~~~~~~~~~~~~
  {
    if (FM_bDrag)
    {
      divFM.style.left  = divFM.offsetLeft + event.screenX - FM_nDragStartX;
      divFM.style.top   = divFM.offsetTop + event.screenY - FM_nDragStartY;
      FM_nDragStartX = event.screenX;
      FM_nDragStartY = event.screenY;
      FM_AdjustShadow();
    }  
  }
  //---------------------------------------------------------------

  function FM_EndDrag (obj)
  //       ~~~~~~~~~~
  {
    obj.releaseCapture()
    FM_bDrag = false
  }
  //-----------------------------------------------------------------

  function OnMouseMove ()
  //       ~~~~~~~~~~~
  {
    if (bDisableFM || FM_bSticky)
      return;
    var oElement = event.srcElement
    
    if (!bForceFM)
    {
      while (oElement != null && typeof(oElement.FM) != "string" && (!bFM || (oElement != divFM )))
        oElement = oElement.parentElement;

      if (!bFM || (oElement != divFM ))
      {
        if (oElement != null)
        {
          if (oElement != oLastObj)
          {
            var nStyle = nFMDefaultStyle
            FM_Hide()
            if (typeof(oElement.FMSTYLE) == "string")
              nStyle = eval(oElement.FMSTYLE)
            if (typeof(oElement.FMPOS) == "string")
            {
              nStyle |= FM_FIXEDPOS;
              var s = oElement.FMPOS
              FM_nFixedPosX = eval(s.substr(0,s.indexOf(",")))
              FM_nFixedPosY = eval(s.substr(s.indexOf(",")+1))
            }
            
            if ((nStyle & FM_EVAL) != 0)
              FM(eval(oElement.FM), nStyle, eval(oElement.FMTITLE))
            else  
              FM(oElement.FM, nStyle, oElement.FMTITLE)
          }   
        }
        else
        if (bFM)
          FM_Hide()
        oLastObj = oElement
      }  
      if (!bFM)
        return;
    }    


    //var nMouseX = event.x;
    //var nMouseY = event.y; 

if (IE) {
   var nMouseX = event.clientX + document.body.scrollLeft;
   var nMouseY = event.clientY + document.body.scrollTop;
}else {
   var nMouseX = e.pageX;
   var nMouseY = e.pageY;
}  

    var nNewPosX;
    var nNewPosY;
    var nHeight;
    var nWidth;

    if (document.body.currentStyle.direction == "rtl")
    {
      sOverflow = document.body.style.overflow

      if (sOverflow == "visible" || sOverflow == "hidden")
        bScrollBar = false
      else  
      if (sOverflow == "" || sOverflow == "scroll")
        bScrollBar = true
      else
      if (document.body.scrollHeight > document.body.clientHeight)
        bScrollBar = true
      else  
        bScrollBar = false
      if (bScrollBar)
        nMouseX -= 18;

      nMouseX += (document.body.scrollLeft - (document.body.scrollWidth - document.body.clientWidth))  
    }

    if ((nFMStyle & FM_RTL) == FM_RTL)
    {
      TheText.align = "right"
      TheText.dir = "rtl"
    }  
    else  
    {
      TheText.align = "left"
      TheText.dir = "ltr"
    }  

    nHeight = divFM.offsetHeight;
    nWidth  = divFM.offsetWidth;
    
    if (nFMStyle & FM_FIXEDPOS)
    {
      nNewPosX = FM_nFixedPosX;
      nNewPosY = FM_nFixedPosY;
    }
    else


    switch (nFMStyle & (FM_LEFT | FM_RIGHT | FM_TOP | FM_BOTTOM | FM_BOTTOMLEFT | FM_BOTTOMRIGHT | FM_TOPLEFT))
    {
      case FM_TOP :
        nNewPosX = nMouseX - nWidth/2;
        nNewPosY = nMouseY
        break;
      case FM_RIGHT :
        nNewPosX = nMouseX + 3;
        nNewPosY = nMouseY
        break;
      case FM_BOTTOMRIGHT :
        nNewPosX = nMouseX + 3;
        nNewPosY = nMouseY
        break;
      case FM_LEFT :
        nNewPosX = nMouseX - 10 - nWidth;
        nNewPosY = nMouseY
        break;
      case FM_TOPLEFT :

        nNewPosX = nMouseX - 10 - nWidth;
        nNewPosY = nMouseY
        break;
      case FM_BOTTOMLEFT :
         //nNewPosX = nMouseX - 10 - nWidth;
         //nNewPosY = nMouseY+ FM_OFFSET;
     
        nNewPosX = -1* (nMouseX+30) ;
        nNewPosY = nMouseY
        break;
      default :
        nNewPosX = nMouseX - nWidth/2;
        nNewPosY = nMouseY
        break;
    }








    // make sure the message is not running out of the BOTTOM of the screen
    if (nNewPosY + nHeight - 5> document.body.clientHeight)
      nNewPosY = document.body.clientHeight - nHeight + 5
    // make sure the message is not running out of the RIGHT of the screen
    if (nNewPosX + nWidth + 7 > document.body.clientWidth)
      nNewPosX = document.body.clientWidth - (nWidth + 7)
    // make sure the message is not running out of the LEFT of the screen
    if (document.body.currentStyle.direction == "rtl")
    {
      if (nNewPosX < (document.body.scrollLeft - (document.body.scrollWidth - document.body.clientWidth)))
        nNewPosX = (document.body.scrollLeft - (document.body.scrollWidth - document.body.clientWidth))
    }    
    else
    {
      if (nNewPosX < 0)
        nNewPosX = 0
    }
    // make sure the message is not running out of the TOP of the screen
    if (nNewPosY <-4)
      nNewPosY = -4
    // make sure the cursor is not in the message area
    if ((nNewPosY <= nMouseY &&   (nNewPosY + nHeight) >= nMouseY) && (nNewPosX <= nMouseX &&   (nNewPosX + nWidth) >= nMouseX))
      nNewPosY = nMouseY - nHeight - 20
      
    if (document.body.currentStyle.direction == "rtl")
      divFM.style.left  = nNewPosX 
    else  
      divFM.style.left  = nNewPosX  + document.body.scrollLeft;
    divFM.style.top        = nNewPosY + document.body.scrollTop;
    divFM.style.visibility = "visible";
    if ((nFMStyle & FM_NOSHADOW) == 0)
    {
      FM_AdjustShadow()
      
        ///divShadow.style.visibility = "visible";
      
    }
  }
  //---------------------------------

  function FM_AdjustShadow ()
  {
    //divShadow.style.width  = divFM.offsetWidth  - 5
    //divShadow.style.height = divFM.offsetHeight - 5
    //divShadow.style.left   = divFM.offsetLeft   + 4
    //divShadow.style.top    = divFM.offsetTop    + 6
  }
  
  
  
  //---------------------------------

  function FM_MakeSticky (bSticky)
  //       ~~~~~~~~~~~~~
  {
    if (FM_bSticky == bSticky)
      return;
    FM_bSticky = bSticky  
    if (FM_bSticky)
      if (!bFM)
        FM_bSticky = false;
      else
      {
        FMSticky.style.display = ""
        FM_AdjustShadow();
      }  
    else    
    if (bFM)
      FMSticky.style.display = "none"
  }
  //---------------------------------

  function FM (sHtml, nStyle, sTitle)
  //       ~~
  { 
    if (bDisableFM)
      return;
    if (typeof(divFM) != "object")
    {
	
	var nMouseX = event.x;
    var nMouseY = event.y; 
		
			
      var sCode = "<TABLE id=divFM style='position:absolute;LEFT: 193px;TOP:330px; z-index:100; visibility:hidden' cellspacing=0 cellpadding=0>" +
        '  <tr id="FMSticky">' +
           '  <td></td>' +
        '  </tr>' +
        '  <tr>' +
           '  <td width=16 height=48><img src=http://www.yad-mordechai.co.il/images/tl.gif alt= width=16 height=48 border=0></td>' +
           '  <td id=TheTitle height=48 class=textW14  background=http://www.yad-mordechai.co.il/images/tp.gif align=center></td>' +
           '  <td width=16 height=48><img src=http://www.yad-mordechai.co.il/images/tr.gif alt= width=16 height=48 border=0></td>' +
        '  </tr>' +		
		
        '  <tr>' +
            '  <td background=http://www.yad-mordechai.co.il/images/lp.gif><img src=http://www.yad-mordechai.co.il/images/lp.gif alt= width=16 height=16 border=0></td>' +
            '  <td id=TheText class=textB12 bgcolor=#FCF1E6 align=right dir=rtl valign=top></td>' +
            '  <td background=http://www.yad-mordechai.co.il/images/rp.gif><img src=http://www.yad-mordechai.co.il/images/rp.gif alt= width=16 height=16 border=0></td>' +
        '  </tr>' +
        '  <tr>' +
           '  <td width=16 height=16><img src=http://www.yad-mordechai.co.il/images/bl.gif alt= width=16 height=16 border=0></td>' +
           '  <td height=16 background=http://www.yad-mordechai.co.il/images/bp.gif></td>' +
           '  <td width=16 height=16><img src=http://www.yad-mordechai.co.il/images/br.gif alt= width=16 height=16 border=0></td>' +
        '  </tr>' +
        "</TABLE> "
		
		
		
		
		
		
                 
      var oTable = document.createElement("TABLE")
      oTable     = document.body.insertBefore(oTable)
      oTable.outerHTML = sCode
    }  
    divFM.style.width = ""
    divFM.style.height = ""
    TheText.innerHTML  = sHtml;
	TheTitle.innerHTML = sTitle;
	
    if (divFM.offsetWidth > FM_MAXWIDTH)
      divFM.style.width = FM_MAXWIDTH
    
	
	
    if ((nFMStyle & FM_RTL) == FM_RTL)
    {
      TheText.align = "right"
      TheText.dir = "rtl"
    }  
    else  
    {
      TheText.align = "left"
      TheText.dir = "ltr"
    }  

    nFMStyle     = nStyle
    bFM          = true
  }
  //---------------------------------
  
  function FM_Force (sHtml, nStyle)
  //       ~~~~~~~~
  {
    if (bDisableFM)
      return;
    FM (sHtml, nStyle)
    bForceFM = true
  }
  //---------------------------------

  function FM_Disable (bDisable)
  //       ~~~~~~~~~~
  {
    bDisableFM = bDisable
  }
  //---------------------------------

  function FM_Hide ()
  //       ~~~~~~~
  {
    if (!bFM)
      return;
    TheText.innerHTML = "out"  
    //divShadow.style.visibility = "hidden";
    divFM.style.visibility = "hidden";
    
    FMSticky.style.display = "none"
    bFM = false
    bForceFM = false
    FM_bSticky = false
  }











var oDv   = document.createElement("div"); 
var dvHdr = document.createElement("div");



function showfloat(img,w){
    oDv.style.position="absolute";
    oDv.appendChild(dvHdr);
    oDv.style.visibility='visible';
    document.body.appendChild(oDv);	
    dvHdr.innerHTML=img;
	dvHdr.style.width=272;
	dvHdr.style.border='0px solid #A5CFE9';
	dvHdr.style.padding='3';
	dvHdr.style.background='#0D6928';
	dvHdr.style.filter='alpha(opacity=85)';
	dvHdr.style.opacity='0.85';
	oDv.style.top  = 200
	oDv.style.left = 0
}



function hidefloat(){
   oDv.style.visibility ='hidden'
}




