summaryrefslogtreecommitdiff
path: root/program/js/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/common.js')
-rw-r--r--program/js/common.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js
index 5049061b4..4b877bac3 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -650,3 +650,20 @@ if (bw.ie)
return o;
}
}
+
+
+// Fire event on specified element
+function exec_event(element,event)
+{
+ if (document.createEventObject) {
+ // dispatch for IE
+ var evt = document.createEventObject();
+ return element.fireEvent('on'+event,evt)
+ }
+ else {
+ // dispatch for firefox + others
+ var evt = document.createEvent("HTMLEvents");
+ evt.initEvent(event, true, true); // event type,bubbling,cancelable
+ return !element.dispatchEvent(evt);
+ }
+}