123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2005, 2017
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- function eventManager(event) {
- // Member variables
- this.theEvent = event;
- if (!this.theEvent)
- this.theEvent = window.event;
- // Methods
- this.cancelBubble = function() {
- this.theEvent.cancelBubble = true;
- this.theEvent.returnValue = false;
- if (this.theEvent.stopPropagation) {
- this.theEvent.stopPropagation();
- }
- }
- this.preventDefault = function() {
- if (this.theEvent.stopPropagation) {
- this.theEvent.preventDefault();
- }
- }
- this.getSrc = function() {
- if (typeof this.theEvent.srcElement != "undefined") {
- return this.theEvent.srcElement; //IE event source
- } else {
- return this.theEvent.originalTarget; //Netscape event source
- }
- }
- }
- function doEvent (event, cmd) {
- var mgr = new eventManager(event);
- mgr.cancelBubble();
- eval(cmd);
- }
- function doEventCmd (event, cmd) {
- var mgr = new eventManager(event);
- mgr.cancelBubble();
- doit(cmd);
- }
- function attrib(name,value) {
- this.name = name;
- this.value = value;
- }
- var nodeMap = new Array();
- var nodeMapLength = 0;
- var timeoutSet = false;
- // To compensate for Microsoft KB 269802
- function insertIMGNode(container, src, className, attributes, containersDoc) {
- var doc = containersDoc;
- if (!doc) {
- doc = document;
- if (!topparent.getGlobal("nn7") && !topparent.getGlobal("safari"))
- doc = container.document;
- }
- var node = doc.createElement("IMG");
- node.className = className;
- for (var i = 0; i < attributes.length; i++) {
- node.setAttribute(attributes[i].name,attributes[i].value);
- }
- if (topparent.getGlobal("nn7") || topparent.getGlobal("safari"))
- node.src = src;
- else
- setIconSrc(node,src);
- container.appendChild(node);
- return node;
- }
- function setIconSrc(node, src) {
- node.style.visibility = 'hidden';
- storeNode(node,src);
- if (!timeoutSet) {
- timeoutSet = true;
- window.setTimeout("setNodeSrcs();", 1);
- window.setTimeout("showNodes();timeoutSet = false;", 1);
- }
- }
- function storeNode(node,src) {
- node.setAttribute("theSrc",src);
- nodeMap[nodeMapLength++] = node;
- }
- function setNodeSrcs() {
- for (var i = 0; i < nodeMapLength; i++) {
- nodeMap[i].src = nodeMap[i].getAttribute("theSrc");
- }
- }
- function showNodes() {
- while (nodeMapLength) {
- nodeMap[nodeMapLength - 1].style.visibility = 'visible';
- nodeMapLength--;
- }
- }
- function isLoadingImages() {
- return (nodeMapLength != 0);
- }
- function getPageOffsetLeft(obj) {
- var left = obj.offsetLeft;
- var oParent = obj.offsetParent;
- while (oParent) {
- left += oParent.offsetLeft;
- oParent = oParent.offsetParent;
- }
- return left;
- }
- function getPageOffsetTop(obj) {
- var top = obj.offsetTop;
- var oParent = obj.offsetParent;
- while (oParent) {
- top += oParent.offsetTop;
- oParent = oParent.offsetParent;
- }
- return top;
- }
|