﻿var dynamicText = new Class({
    initialize: function () {
        if (!$("infoLine"))
            return;
        $$(".dynamicText").each(function (elt) {

            var txt = elt.get("rel") == "" ? elt.get("title") : elt.get("rel");
            if(txt != "")
                elt.addEvents({
                    "mouseenter": this._showText.pass(txt, this),
                    "mouseleave": this._hideText
                });
        }, this);
    },
    _showText: function (txt) {
        
        $("infoLineDynamic").set("html", txt);
        $("infoLine").addClass("dynamic");
    },
    _hideText: function () {
        $("infoLineDynamic").set("html", "");
        $("infoLine").removeClass("dynamic");
    }
});
