var firstTime = true; $(function() { // expose the form when it's clicked or cursor is focused var form = $(".expose").bind("click keydown", function() { if(firstTime){ $(this).expose({ // when exposing is done, change form's background color onLoad: function() { }, // when "unexposed", return to original background color onClose: function() { } }); firstTime= false; } else{ $.mask.close(); } }); $(".exposed").click(); // setTimeout(" $('.exposed').click()",2000); }); function wait(msecs) { var start = new Date().getTime(); var cur = start while(cur - start < msecs) { cur = new Date().getTime(); } }