for (var state in reg) { (function (st, state) { st[0].style.cursor = "pointer"; st[0].onmouseover = function () { st.animate({fill: st.color, stroke: "#ccc"}, 500); st.toFront(); }; st[0].onmouseout = function () { st.animate({fill: "#333", stroke: "#666"}, 500); st.toFront(); }; if (state == "nsw") { st[0].onmouseover(); } })(reg[state], state); } Explain if it’s not in the scrap in the part what is being moved and how this wrapping function works, especially its parameters and what the brackets with parameters are at the end
THX