}
}
- /* retrieves the hint for given hint number */
- function getHint(i) {
- return hints[i] || null;
- }
-
- function click(e) {
- /* for sites that are interested in mouseover before click */
- mouseEvent(e, "mouseover");
- /* this is the w3.org definition for DOM-Level 2 events */
- mouseEvent(e, "mousedown");
- mouseEvent(e, "mouseup");
- mouseEvent(e, "click");
+ function click(e, ctrl) {
+ mouseEvent(e, "mouseover", ctrl);
+ mouseEvent(e, "mousedown", ctrl);
+ mouseEvent(e, "mouseup", ctrl);
+ mouseEvent(e, "click", ctrl);
}
- function mouseEvent(e, name) {
+ function mouseEvent(e, name, ctrl) {
var evObj = e.ownerDocument.createEvent("MouseEvents");
- evObj.initMouseEvent(name, true, true, e.contentWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ evObj.initMouseEvent(
+ name, true, true, e.contentWindow,
+ 0, 0, 0, 0, 0,
+ ctrl !== undefined ? ctrl : false, false, false, false, 0, null
+ );
e.dispatchEvent(evObj);
}