summaryrefslogtreecommitdiff
path: root/swat2/style/qooxdoo/widgets/core/QxDom.js
blob: 34b35caa778688f23788bf4fc02042109f6138e8 (plain)
1
2
3
/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
var QxDOM=new Object;if(Boolean(document.defaultView)&&Boolean(document.defaultView.getComputedStyle)){QxDOM.getComputedStyleProperty=function(el,prop){return !el?null:el.ownerDocument?el.ownerDocument.defaultView.getComputedStyle(el,"")[prop]:el.style[prop];};}else if((new QxClient).isMshtml()){QxDOM.getComputedStyleProperty=function(el,prop){if(!el){return null;};if(el.parentNode){return el.currentStyle[prop];}else {var v1=el.runtimeStyle[prop];if(v1!=null&&typeof v1!="undefined"){return v1;};return el.style[prop];};};}else {QxDOM.getComputedStyleProperty=function(el,prop){return !el?null:el.style[prop];};};QxDOM.getComputedStyleSize=function(el,prop){return parseInt(QxDOM.getComputedStyleProperty(el,prop))||0;};QxDOM.getComputedMarginLeft=function(el){return QxDOM.getComputedStyleSize(el,"marginLeft");};QxDOM.getComputedMarginTop=function(el){return QxDOM.getComputedStyleSize(el,"marginTop");};QxDOM.getComputedMarginRight=function(el){return QxDOM.getComputedStyleSize(el,"marginRight");};QxDOM.getComputedMarginBottom=function(el){return QxDOM.getComputedStyleSize(el,"marginBottom");};QxDOM.getComputedPaddingLeft=function(el){return QxDOM.getComputedStyleSize(el,"paddingLeft");};QxDOM.getComputedPaddingTop=function(el){return QxDOM.getComputedStyleSize(el,"paddingTop");};QxDOM.getComputedPaddingRight=function(el){return QxDOM.getComputedStyleSize(el,"paddingRight");};QxDOM.getComputedPaddingBottom=function(el){return QxDOM.getComputedStyleSize(el,"paddingBottom");};QxDOM.getComputedBorderLeft=function(el){return QxDOM.getComputedStyleProperty(el,"borderLeftStyle")=="none"?0:QxDOM.getComputedStyleSize(el,"borderLeftWidth");};QxDOM.getComputedBorderTop=function(el){return QxDOM.getComputedStyleProperty(el,"borderTopStyle")=="none"?0:QxDOM.getComputedStyleSize(el,"borderTopWidth");};QxDOM.getComputedBorderRight=function(el){return QxDOM.getComputedStyleProperty(el,"borderRightStyle")=="none"?0:QxDOM.getComputedStyleSize(el,"borderRightWidth");};QxDOM.getComputedBorderBottom=function(el){return QxDOM.getComputedStyleProperty(el,"borderBottomStyle")=="none"?0:QxDOM.getComputedStyleSize(el,"borderBottomWidth");};QxDOM.getComputedOuterWidth=function(el){return QxDOM.getComputedBoxWidth(el)+QxDOM.getComputedMarginLeft(el)+QxDOM.getComputedMarginRight(el);};QxDOM.getComputedOuterHeight=function(el){return QxDOM.getComputedBoxHeight(el)+QxDOM.getComputedMarginTop(el)+QxDOM.getComputedMarginBottom(el);};QxDOM.getComputedBoxWidth=function(el){var h=el.offsetHeight;if(h==0){var o=el.style.height;el.style.height="1px";};var v=el.offsetWidth;if(h==0){el.style.height=o;};return v;};QxDOM.getComputedBoxHeight=function(el){var w=el.offsetWidth;if(w==0){var o=el.style.width;el.style.width="1px";};var v=el.offsetHeight;if(w==0){el.style.width=o;};return v;};if((new QxClient).isGecko()){QxDOM.getComputedAreaWidth=function(el){if(el.clientWidth!=0&&el.clientWidth!=(QxDOM.getComputedBorderLeft(el)+QxDOM.getComputedBorderRight(el))){return el.clientWidth;}else {return QxDOM.getComputedBoxWidth(el)-QxDOM.getComputedInsetLeft(el)-QxDOM.getComputedInsetRight(el);};};QxDOM.getComputedAreaHeight=function(el){if(el.clientHeight!=0&&el.clientHeight!=(QxDOM.getComputedBorderTop(el)+QxDOM.getComputedBorderBottom(el))){return el.clientHeight;}else {return QxDOM.getComputedBoxHeight(el)-QxDOM.getComputedInsetTop(el)-QxDOM.getComputedInsetBottom(el)};};}else {QxDOM.getComputedAreaWidth=function(el){return el.clientWidth!=0?el.clientWidth:(QxDOM.getComputedBoxWidth(el)-QxDOM.getComputedInsetLeft(el)-QxDOM.getComputedInsetRight(el));};QxDOM.getComputedAreaHeight=function(el){return el.clientHeight!=0?el.clientHeight:(QxDOM.getComputedBoxHeight(el)-QxDOM.getComputedInsetTop(el)-QxDOM.getComputedInsetBottom(el));};};QxDOM.getComputedInnerWidth=function(el){return QxDOM.getComputedAreaWidth(el)-QxDOM.getComputedPaddingLeft(el)-QxDOM.getComputedPaddingRight(el);};QxDOM.getComputedInnerHeight=function(el){return QxDOM.getComputedAreaHeight(el)-QxDOM.getComputedPaddingTop(el)-QxDOM.getComputedPaddingBottom(el);};if((new QxClient).isMshtml()){QxDOM.getComputedInsetLeft=function(el){return el.clientLeft;};QxDOM.getComputedInsetTop=function(el){return el.clientTop;};QxDOM.getComputedInsetRight=function(el){if(QxDOM.getComputedStyleProperty(el,"overflowY")=="hidden"||el.clientWidth==0){return QxDOM.getComputedBorderRight(el);};return Math.max(0,el.offsetWidth-el.clientLeft-el.clientWidth);};QxDOM.getComputedInsetBottom=function(el){if(QxDOM.getComputedStyleProperty(el,"overflowX")=="hidden"||el.clientHeight==0){return QxDOM.getComputedBorderBottom(el);};return Math.max(0,el.offsetHeight-el.clientTop-el.clientHeight);};}else {QxDOM.getComputedInsetLeft=function(el){return QxDOM.getComputedBorderLeft(el);};QxDOM.getComputedInsetTop=function(el){return QxDOM.getComputedBorderTop(el);};QxDOM.getComputedInsetRight=function(el){if(el.clientWidth==0){var ov=QxDOM.getComputedStyleProperty(el,"overflow");var sbv=ov=="scroll"||ov=="-moz-scrollbars-vertical"?16:0;return Math.max(0,QxDOM.getComputedBorderRight(el)+sbv);};return Math.max(0,el.offsetWidth-el.clientWidth-QxDOM.getComputedBorderLeft(el));};QxDOM.getComputedInsetBottom=function(el){if(el.clientHeight==0){var ov=QxDOM.getComputedStyleProperty(el,"overflow");var sbv=ov=="scroll"||ov=="-moz-scrollbars-horizontal"?16:0;return Math.max(0,QxDOM.getComputedBorderBottom(el)+sbv);};return Math.max(0,el.offsetHeight-el.clientHeight-QxDOM.getComputedBorderTop(el));};};QxDOM.getComputedScrollBarSizeLeft=function(el){return 0;};QxDOM.getComputedScrollBarSizeTop=function(el){return 0;};QxDOM.getComputedScrollBarSizeRight=function(el){return QxDOM.getComputedInsetRight(el)-QxDOM.getComputedBorderRight(el);};QxDOM.getComputedScrollBarSizeBottom=function(el){return QxDOM.getComputedInsetBottom(el)-QxDOM.getComputedBorderBottom(el);};QxDOM.getComputedScrollBarVisibleX=function(el){return QxDOM.getComputedScrollBarSizeRight(el)>0;};QxDOM.getComputedScrollBarVisibleY=function(el){return QxDOM.getComputedScrollBarSizeBottom(el)>0;};QxDOM.getScrollLeftSum=function(el){var sum=0;var p=el.parentNode;while(p.nodeType==1){sum+=p.scrollLeft;p=p.parentNode;};return sum;};QxDOM.getScrollTopSum=function(el){var sum=0;var p=el.parentNode;while(p.nodeType==1){sum+=p.scrollTop;p=p.parentNode;};return sum;};QxDOM.getComputedPageOuterLeft=function(el){return QxDOM.getComputedPageBoxLeft(el)-QxDOM.getComputedMarginLeft(el);};QxDOM.getComputedPageOuterTop=function(el){return QxDOM.getComputedPageBoxTop(el)-QxDOM.getComputedMarginTop(el);};QxDOM.getComputedPageOuterRight=function(el){return QxDOM.getComputedPageBoxRight(el)+QxDOM.getComputedMarginRight(el);};QxDOM.getComputedPageOuterBottom=function(el){return QxDOM.getComputedPageBoxBottom(el)+QxDOM.getComputedMarginBottom(el);};QxDOM.getComputedClientOuterLeft=function(el){return QxDOM.getComputedClientBoxLeft(el)-QxDOM.getComputedMarginLeft(el);};QxDOM.getComputedClientOuterTop=function(el){return QxDOM.getComputedClientBoxTop(el)-QxDOM.getComputedMarginTop(el);};QxDOM.getComputedClientOuterRight=function(el){return QxDOM.getComputedClientBoxRight(el)+QxDOM.getComputedMarginRight(el);};QxDOM.getComputedClientOuterBottom=function(el){return QxDOM.getComputedClientBoxBottom(el)+QxDOM.getComputedMarginBottom(el);};if((new QxClient).isMshtml()){QxDOM.getComputedClientBoxLeft=function(el){return el.getBoundingClientRect().left;};QxDOM.getComputedClientBoxTop=function(el){return el.getBoundingClientRect().top;};QxDOM.getComputedPageBoxLeft=function(el){return QxDOM.getComputedClientBoxLeft(el)+QxDOM.getScrollLeftSum(el);};QxDOM.getComputedPageBoxTop=function(el){return QxDOM.getComputedClientBoxTop(el)+QxDOM.getScrollTopSum(el);};}else if((new QxClient).isGecko()){QxDOM.getComputedClientBoxLeft=function(el){return QxDOM.getComputedClientAreaLeft(el)-QxDOM.getComputedBorderLeft(el);};QxDOM.getComputedClientBoxTop=function(el){return QxDOM.getComputedClientAreaTop(el)-QxDOM.getComputedBorderTop(el);};QxDOM.getComputedPageBoxLeft=function(el){return QxDOM.getComputedPageAreaLeft(el)-QxDOM.getComputedBorderLeft(el);};QxDOM.getComputedPageBoxTop=function(el){return QxDOM.getComputedPageAreaTop(el)-QxDOM.getComputedBorderTop(el);};}else {QxDOM.getComputedPageBoxLeft=function(el){var sum=el.offsetLeft;while(el.tagName!="BODY"){el=el.offsetParent;sum+=el.offsetLeft;};return sum;};QxDOM.getComputedPageBoxTop=function(el){var sum=el.offsetTop;while(el.tagName!="BODY"){el=el.offsetParent;sum+=el.offsetTop;};return sum;};QxDOM.getComputedClientBoxLeft=function(el){var sum=el.offsetLeft;while(el.tagName!="BODY"){el=el.offsetParent;sum+=el.offsetLeft-el.scrollLeft;};return sum;};QxDOM.getComputedClientBoxTop=function(el){var sum=el.offsetTop;while(el.tagName!="BODY"){el=el.offsetParent;sum+=el.offsetTop-el.scrollTop;};return sum;};};if((new QxClient).isMshtml()){QxDOM.getComputedClientBoxRight=function(el){return el.getBoundingClientRect().right;};QxDOM.getComputedClientBoxBottom=function(el){return el.getBoundingClientRect().bottom;};QxDOM.getComputedPageBoxRight=function(el){return QxDOM.getComputedClientBoxRight(el)+QxDOM.getScrollLeftSum(el);};QxDOM.getComputedPageBoxBottom=function(el){return QxDOM.getComputedClientBoxBottom(el)+QxDOM.getScrollTopSum(el);};}else {QxDOM.getComputedClientBoxRight=function(el){return QxDOM.getComputedClientBoxLeft(el)+QxDOM.getComputedBoxWidth(el);};QxDOM.getComputedClientBoxBottom=function(el){return QxDOM.getComputedClientBoxTop(el)+QxDOM.getComputedBoxHeight(el);};QxDOM.getComputedPageBoxRight=function(el){return QxDOM.getComputedPageBoxLeft(el)+QxDOM.getComputedBoxWidth(el);};QxDOM.getComputedPageBoxBottom=function(el){return QxDOM.getComputedPageBoxTop(el)+QxDOM.getComputedBoxHeight(el);};};if((new QxClient).isGecko()){QxDOM.getComputedPageAreaLeft=function(el){return el.ownerDocument.getBoxObjectFor(el).x;};QxDOM.getComputedPageAreaTop=function(el){return el.ownerDocument.getBoxObjectFor(el).y;};QxDOM.getComputedClientAreaLeft=function(el){return QxDOM.getComputedPageAreaLeft(el)-QxDOM.getScrollLeftSum(el);};QxDOM.getComputedClientAreaTop=function(el){return QxDOM.getComputedPageAreaTop(el)-QxDOM.getScrollTopSum(el);};}else {QxDOM.getComputedClientAreaLeft=function(el){return QxDOM.getComputedClientBoxLeft(el)+QxDOM.getComputedBorderLeft(el);};QxDOM.getComputedClientAreaTop=function(el){return QxDOM.getComputedClientBoxTop(el)+QxDOM.getComputedBorderTop(el);};QxDOM.getComputedPageAreaLeft=function(el){return QxDOM.getComputedPageBoxLeft(el)+QxDOM.getComputedBorderLeft(el);};QxDOM.getComputedPageAreaTop=function(el){return QxDOM.getComputedPageBoxTop(el)+QxDOM.getComputedBorderTop(el);};};QxDOM.getComputedClientAreaRight=function(el){return QxDOM.getComputedClientAreaLeft(el)+QxDOM.getComputedAreaWidth(el);};QxDOM.getComputedClientAreaBottom=function(el){return QxDOM.getComputedClientAreaTop(el)+QxDOM.getComputedAreaHeight(el);};QxDOM.getComputedPageAreaRight=function(el){return QxDOM.getComputedPageAreaLeft(el)+QxDOM.getComputedAreaWidth(el);};QxDOM.getComputedPageAreaBottom=function(el){return QxDOM.getComputedPageAreaTop(el)+QxDOM.getComputedAreaHeight(el);};QxDOM.getComputedClientInnerLeft=function(el){return QxDOM.getComputedClientAreaLeft(el)+QxDOM.getComputedPaddingLeft(el);};QxDOM.getComputedClientInnerTop=function(el){return QxDOM.getComputedClientAreaTop(el)+QxDOM.getComputedPaddingTop(el);};QxDOM.getComputedClientInnerRight=function(el){return QxDOM.getComputedClientInnerLeft(el)+QxDOM.getComputedInnerWidth(el);};QxDOM.getComputedClientInnerBottom=function(el){return QxDOM.getComputedClientInnerTop(el)+QxDOM.getComputedInnerHeight(el);};QxDOM.getComputedPageInnerLeft=function(el){return QxDOM.getComputedPageAreaLeft(el)+QxDOM.getComputedPaddingLeft(el);};QxDOM.getComputedPageInnerTop=function(el){return QxDOM.getComputedPageAreaTop(el)+QxDOM.getComputedPaddingTop(el);};QxDOM.getComputedPageInnerRight=function(el){return QxDOM.getComputedPageInnerLeft(el)+QxDOM.getComputedInnerWidth(el);};QxDOM.getComputedPageInnerBottom=function(el){return QxDOM.getComputedPageInnerTop(el)+QxDOM.getComputedInnerHeight(el);};if((new QxClient).isGecko()){QxDOM.getComputedScreenBoxLeft=function(el){var sum=0;var p=el.parentNode;while(p.nodeType==1){sum+=p.scrollLeft;p=p.parentNode;};return el.ownerDocument.getBoxObjectFor(el).screenX-sum;};QxDOM.getComputedScreenBoxTop=function(el){var sum=0;var p=el.parentNode;while(p.nodeType==1){sum+=p.scrollTop;p=p.parentNode;};return el.ownerDocument.getBoxObjectFor(el).screenY-sum;};}else {QxDOM.getComputedScreenBoxLeft=function(el){return QxDOM.getComputedScreenDocumentLeft(el)+QxDOM.getComputedPageBoxLeft(el);};QxDOM.getComputedScreenBoxTop=function(el){return QxDOM.getComputedScreenDocumentTop(el)+QxDOM.getComputedPageBoxTop(el);};};QxDOM.getComputedScreenBoxRight=function(el){return QxDOM.getComputedScreenBoxLeft(el)+QxDOM.getComputedBoxWidth(el);};QxDOM.getComputedScreenBoxBottom=function(el){return QxDOM.getComputedScreenBoxTop(el)+QxDOM.getComputedBoxHeight(el);};QxDOM.getComputedScreenOuterLeft=function(el){return QxDOM.getComputedScreenBoxLeft(el)-QxDOM.getComputedMarginLeft(el);};QxDOM.getComputedScreenOuterTop=function(el){return QxDOM.getComputedScreenBoxTop(el)-QxDOM.getComputedMarginTop(el);};QxDOM.getComputedScreenOuterRight=function(el){return QxDOM.getComputedScreenBoxRight(el)+QxDOM.getComputedMarginRight(el);};QxDOM.getComputedScreenOuterBottom=function(el){return QxDOM.getComputedScreenBoxBottom(el)+QxDOM.getComputedMarginBottom(el);};QxDOM.getComputedScreenAreaLeft=function(el){return QxDOM.getComputedScreenBoxLeft(el)+QxDOM.getComputedInsetLeft(el);};QxDOM.getComputedScreenAreaTop=function(el){return QxDOM.getComputedScreenBoxTop(el)+QxDOM.getComputedInsetTop(el);};QxDOM.getComputedScreenAreaRight=function(el){return QxDOM.getComputedScreenBoxRight(el)-QxDOM.getComputedInsetRight(el);};QxDOM.getComputedScreenAreaBottom=function(el){return QxDOM.getComputedScreenBoxBottom(el)-QxDOM.getComputedInsetBottom(el);};QxDOM.getComputedScreenInnerLeft=function(el){return QxDOM.getComputedScreenAreaLeft(el)+QxDOM.getComputedPaddingLeft(el);};QxDOM.getComputedScreenInnerTop=function(el){return QxDOM.getComputedScreenAreaTop(el)+QxDOM.getComputedPaddingTop(el);};QxDOM.getComputedScreenInnerRight=function(el){return QxDOM.getComputedScreenAreaRight(el)-QxDOM.getComputedPaddingRight(el);};QxDOM.getComputedScreenInnerBottom=function(el){return QxDOM.getComputedScreenAreaBottom(el)-QxDOM.getComputedPaddingBottom(el);};if((new QxClient).isGecko()){QxDOM.getComputedScreenDocumentLeft=function(el){return QxDOM.getComputedScreenOuterLeft(el.ownerDocument.body);};QxDOM.getComputedScreenDocumentTop=function(el){return QxDOM.getComputedScreenOuterTop(el.ownerDocument.body);};QxDOM.getComputedScreenDocumentRight=function(el){return QxDOM.getComputedScreenOuterRight(el.ownerDocument.body);};QxDOM.getComputedScreenDocumentBottom=function(el){return QxDOM.getComputedScreenOuterBottom(el.ownerDocument.body);};}else {QxDOM.getComputedScreenDocumentLeft=function(el){return el.document.parentWindow.screenLeft;};QxDOM.getComputedScreenDocumentTop=function(el){return el.document.parentWindow.screenTop;};QxDOM.getComputedScreenDocumentRight=function(el){};QxDOM.getComputedScreenDocumentBottom=function(el){};};QxDOM.getComputedPreferredSize=function(el){try{var elst=el.style;var _pa=el.parentNode;var _ne=el.nextChild;var _do=el.ownerDocument.body;var _el_w=isValidString(elst.width)?elst.width:"";var _el_h=isValidString(elst.height)?elst.height:"";var _el_p=isValidString(elst.position)?elst.position:"";var _el_d=isValidString(elst.display)?elst.display:"";var _el_v=isValidString(elst.visibility)?elst.visibility:"";_pa.removeChild(el);elst.width=elst.height="auto";elst.position="absolute";elst.display="inline";elst.visibility="hidden";_do.appendChild(el);var r={width:el.offsetWidth,height:el.offsetHeight};_do.removeChild(el);elst.width=_el_w;elst.height=_el_h;elst.position=_el_p;elst.display=_el_p;elst.visibility=_el_v;_ne?_pa.insertBefore(el,_ne):_pa.appendChild(el);return r;}catch(ex){throw new Error("Failed to detect preferred size for "+el+":"+ex);};};QxDOM.getComputedPreferredWidth=function(el){return QxDOM.getComputedPreferredSize(el).width;};QxDOM.getComputedPreferredHeight=function(el){return QxDOM.getComputedPreferredSize(el).height;};QxDOM.addClass=function(el,newClass){var n=el.className.add(newClass," ");if(n!=el.className){el.className=n;};};QxDOM.removeClass=function(el,oldClass){var n=el.className.remove(oldClass," ");if(n!=el.className){el.className=n;};};if((new QxClient).isMshtml()){QxDOM.setWidth=function(el,intValue){el.style.pixelWidth=intValue;};QxDOM.setHeight=function(el,intValue){el.style.pixelHeight=intValue;};}else {QxDOM.setWidth=function(el,intValue){el.style.width=intValue+"px";};QxDOM.setHeight=function(el,intValue){el.style.height=intValue+"px";};};QxDOM.getElementFromPoint=function(x,y){return QxDOM.getElementFromPointHandler(document.body,x,y);};QxDOM.getElementFromPointHandler=function(node,x,y,recursive){var ch=node.childNodes;var chl=ch.length-1;if(chl<0){return null;};var chc,subres,ret;do
{chc=ch[chl];ret=QxDOM.getElementFromPointChecker(chc,x,y);if(ret){if(typeof recursive=="boolean"&&recursive==false&&2==1){return chc;}else {subres=QxDOM.getElementFromPointHandler(chc,x-ret[0]-QxDOM.getComputedBorderLeft(chc),y-ret[2]-QxDOM.getComputedBorderTop(chc));return subres?subres:chc;};};}while(chl--);return null;};QxDOM.getElementFromPointChecker=function(chc,x,y){var xstart,ystart,xstop,ystop;if(chc.nodeType!=1){return false;};xstart=QxDOM.getOffsetLeft(chc);if(x>xstart){ystart=QxDOM.getOffsetTop(chc);if(y>ystart){xstop=xstart+chc.offsetWidth;if(xstop==xstart&&chc.className=="QxContainer"){xstop=xstart+chc._QxWidget.getAnyWidth();};if(x<xstop){ystop=ystart+chc.offsetHeight;if(y<ystop){return[xstart,xstop,ystart,ystop];};};};};return false;};QxDOM.getElementAbsolutePointChecker=function(chc,x,y){var xstart,ystart,xstop,ystop;if(!chc||chc.nodeType!=1){return false;};xstart=QxDOM.getComputedPageBoxLeft(chc);if(x>xstart){ystart=QxDOM.getComputedPageBoxTop(chc);if(y>ystart){xstop=xstart+chc.offsetWidth;if(xstop==xstart&&chc.className=="QxContainer"){xstop=xstart+chc._QxWidget.getAnyWidth();};if(x<xstop){ystop=ystart+chc.offsetHeight;if(y<ystop){return[xstart,xstop,ystart,ystop];};};};};return false;};if((new QxClient).isGecko()){QxDOM.getOffsetLeft=function(el){var val=el.offsetLeft;var pa=el.parentNode;var pose=QxDOM.getComputedStyleProperty(el,"position");var posp=QxDOM.getComputedStyleProperty(pa,"position");if(pose!="absolute"&&pose!="fixed"){val-=QxDOM.getComputedBorderLeft(pa);};if(posp!="absolute"&&posp!="fixed"){while(pa){pa=pa.parentNode;if(!pa||isInvalidString(pa.tagName)){break;};var posi=QxDOM.getComputedStyleProperty(pa,"position");if(posi=="absolute"||posi=="fixed"){val-=QxDOM.getComputedBorderLeft(pa)+QxDOM.getComputedPaddingLeft(pa);break;};};};return val;};QxDOM.getOffsetTop=function(el){var val=el.offsetTop;var pa=el.parentNode;var pose=QxDOM.getComputedStyleProperty(el,"position");var posp=QxDOM.getComputedStyleProperty(pa,"position");if(pose!="absolute"&&pose!="fixed"){val-=QxDOM.getComputedBorderTop(pa);};if(posp!="absolute"&&posp!="fixed"){while(pa){pa=pa.parentNode;if(!pa||isInvalidString(pa.tagName)){break;};var posi=QxDOM.getComputedStyleProperty(pa,"position");if(posi=="absolute"||posi=="fixed"){val-=QxDOM.getComputedBorderTop(pa)+QxDOM.getComputedPaddingTop(pa);break;};};};return val;};}else {QxDOM.getOffsetLeft=function(el){return el.offsetLeft;};QxDOM.getOffsetTop=function(el){return el.offsetTop;};};if((new QxClient).isMshtml()){QxDOM.addEventListener=function(e,t,f){e.attachEvent("on"+t,f);};QxDOM.removeEventListener=function(e,t,f){e.detachEvent("on"+t,f);};}else {QxDOM.addEventListener=function(e,t,f){e.addEventListener(t,f,false);};QxDOM.removeEventListener=function(e,t,f){e.removeEventListener(t,f,false);};};if((new QxClient).isMshtml()){QxDOM.getWindowInnerWidth=function(w){if(!w){w=window;};if(w.document.documentElement&&w.document.documentElement.clientWidth){return w.document.documentElement.clientWidth;}else if(w.document.body){return w.document.body.clientWidth;};return 0;};QxDOM.getWindowInnerHeight=function(w){if(!w){w=window;};if(w.document.documentElement&&w.document.documentElement.clientHeight){return w.document.documentElement.clientHeight;}else if(w.document.body){return w.document.body.clientHeight;};return 0;};QxDOM.getClientScrollLeft=function(w){if(!w){w=window;};if(w.document.documentElement&&w.document.documentElement.scrollLeft){return w.document.documentElement.scrollLeft;}else if(w.document.body){return w.document.body.scrollTop;};return 0;};QxDOM.getClientScrollTop=function(w){if(!w){w=window;};if(w.document.documentElement&&w.document.documentElement.scrollTop){return w.document.documentElement.scrollTop;}else if(w.document.body){return w.document.body.scrollTop;};return 0;};}else {QxDOM.getWindowInnerWidth=function(w){return(w||window).innerWidth;};QxDOM.getWindowInnerHeight=function(w){return(w||window).innerHeight;};QxDOM.getClientScrollLeft=function(w){return(w||window).document.body.scrollLeft;};QxDOM.getClientScrollTop=function(w){return(w||window).document.body.scrollTop;};};QxDOM.scrollIntoViewX=function(vChild,vParent){if(!vParent){vParent=vChild.parentNode;};var l=vChild.offsetLeft;var w=vChild.offsetWidth;var sl=vParent.scrollLeft;var cw=vParent.clientWidth;if(w>cw||l<sl){vParent.scrollLeft=l;}else if(l+w>sl+cw){vParent.scrollLeft=l+w-cw;};};QxDOM.scrollIntoViewY=function(vChild,vParent){if(!vParent){vParent=vChild.parentNode;};var t=vChild.offsetTop;var h=vChild.offsetHeight;var st=vParent.scrollTop;var ch=vParent.clientHeight;if(h>ch||t<st){vParent.scrollTop=t;}else if(t+h>st+ch){vParent.scrollTop=t+h-ch;};};