Simplify Raphael JS code: display text in DIV on click event
I agree with tiffon it's better to extract a function, but I don't agree with the rest of their edits, so here's what I would have done (I also kept the style intact).

var initPath = (function () {
    var currentEl;

    function init(el, path) {
        path.attr({
            fill: "#0B0",
            stroke: "#fff",
            "stroke-width": 3,
        });

        path[0].style.cursor = "pointer";
        path[0].onmousedown = function () {
            currentEl &amp;&amp; (currentEl.style.display = "");

            path.toFront();
            path.paper.safari();

            el.style.display = "block";
            currentEl = el;
        };
    }

    return init;
})();

window.onload = function () {
    var R = Raphael("paper", 532, 500);
    var paths = {
        'btn_1': R.path("M 180,130 L 340,130, L 392,212, L 128,212 z"),
        'btn_2': R.path("M 128,212 L 392,212, L 435,280, L 85,280 z")
    };

    for (var id in paths) {
        initPath(document.getElementById(id), paths[id]);
    }
};


Firstly, I think st and state were confusing names, so I changed them to be path and id, respectively, and then changed id to el to avoid additional lookups.

I separated the infrastructure (current and initPath) from the usage (R, paths and the loop).

I also think an object literal looks better than a series of assignments, so I changed that.

Finally, I like it better if I move initPath and currentEl into a closure of their own—after all, they don't depend on window.onload anymore.

I left the inner init a named function so it is named in a stack trace, if there is an error.