+\r
+ function submitClicked(e, f) {\r
+ if(!(browserTester('chrome') || browserTester('safari'))) {\r
+ $("input.submit")[0].disabled=true;\r
+ }\r
+ window.removeEventListener('beforeunload', beforeUnload, true);\r
+ if (f) {\r
+ f.submit();\r
+ }\r
+ }\r
+\r
+ function beforeUnload(e) {\r
+\r
+ if($("textarea#editor")[0].value != "") {\r
+ return yourWorkWillBeLost(e);\r
+ }\r
+\r
+ var commentBoxes = $("textarea.commentBox");\r
+ for(var index = 0; index < commentBoxes.length; index++) {\r
+ if(commentBoxes[index].value != "") {\r
+ return yourWorkWillBeLost(e);\r
+ }\r
+ }\r
+ }\r
+ window.addEventListener('beforeunload', beforeUnload, true);\r