window.addEvent('domready', SetHints );

/**
  * show/hide description text
  * @return void
  */
function ShowDescription(cServiceID)
{
    oDesc = $(cServiceID + "_desc");
    
    oSlide = new Fx.Slide(cServiceID + "_desc");
    if (oDesc.getStyle("display")=="none")
    {
        oSlide.hide();
        oDesc.setStyle("display", "block");
    }
    
    oSlide.toggle();
}

var oHint;

/**
 * dynamicaly set a events
 * @return void
 */
function SetHints()
{
    $$(".price_sub").each( function (e) {DefineAEvents(e);} );
}

function DefineAEvents(oElement)
{
    oElement.addEvent("mouseover", function(e) {e.stop(); ShowHint(oElement)} );
    oElement.addEvent("mouseout", function(e) {HideHint(oElement)} );
}

/**
 * show column description
 * @return void
 */
function ShowHint(oParent)
{
    oHint = new Element("div", 
        {
            "style":
                "position:absolute; margin: 1em 0 0 1em; background-color: #FFFFFF; z-index: 200; border: 1px solid #000000; padding: 0.5em; border-bottom: 2px solid #000000; border-right: 2px solid #000000;"
        }
        );
    oHint.set("html", oParent.get("title"));
    oParent.set("title", "");

    oParent.getParent().appendChild(oHint);
    
}

/**
 * show column description
 * @return void
 */
function HideHint(oParent)
{
    oParent.set("title", oHint.get("html"));
    //alert(oHint);
    oHint.destroy();
}
