var DomUtils=new Object;DomUtils.browser=new Object;DomUtils.browser.regexes={overflowX:new Array(/Firefox\/1\.0/),overflowY:new Array(/Firefox\/1\.0/)};DomUtils.browser.supportsOverflowX=function(){for(var i=0;i-1)?true:false;} DomUtils.browser.isIE6=function(){temp=navigator.appVersion.split('MSIE');ieVer=parseInt(temp[1]);return(ieVer==6)?1:0;} DomUtils.browser.isSafari=function(){return(navigator.userAgent.toLowerCase().indexOf('safari')>-1)?true:false;} DomUtils.removeElement=function(elem){if(DomUtils.browser.isIE()){var garbageBin=document.getElementById('IELeakGarbageBin');if(!garbageBin){garbageBin=document.createElement('DIV');garbageBin.id='IELeakGarbageBin';garbageBin.style.display='none';document.body.appendChild(garbageBin);} garbageBin.appendChild(elem);garbageBin.innerHTML='';}else{elem.parentNode.removeChild(elem);}} DomUtils.getWindowWidth=function(win){win=(win)?win:window;if(document.compatMode=='CSS1Compat')return parseInt(win.document.body.parentNode.clientWidth);else if(DomUtils.browser.isIE())return parseInt(win.document.body.clientWidth);else return parseInt(win.innerWidth);} DomUtils.getWindowHeight=function(win){win=(win)?win:window;if(document.compatMode=='CSS1Compat')return parseInt(win.document.body.parentNode.clientHeight);else if(DomUtils.browser.isIE())return parseInt(win.document.body.clientHeight);else return parseInt(win.innerHeight);} DomUtils.getWindowScrollX=function(win){win=(win)?win:window;if(document.compatMode=='CSS1Compat'&&win.document.body.parentNode.scrollLeft)return parseInt(win.document.body.parentNode.scrollLeft);else if(DomUtils.browser.isIE())return parseInt(win.document.body.scrollLeft);else if(typeof(window.pageXOffset)=='number'||window.pageXOffset===0)return parseInt(window.pageXOffset);else return parseInt(win.scrollX);} DomUtils.getWindowScrollY=function(win){win=(win)?win:window;if(document.compatMode=='CSS1Compat'&&win.document.body.parentNode.scrollTop)return parseInt(win.document.body.parentNode.scrollTop);else if(DomUtils.browser.isIE())return parseInt(win.document.body.scrollTop);else if(typeof(window.pageYOffset)=='number')return parseInt(window.pageYOffset);else return parseInt(win.scrollY);} DomUtils.getElementWidth=function(elem){var eStyle,prop,width;var w=0;if(elem.tagName=='IMG')w=parseInt(elem.width);else if(document.compatMode=='CSS1Compat')w=parseInt(elem.offsetWidth);else if(document.compatMode=='BackCompat'){eStyle=DomUtils.getCurrentStyle(elem);width=parseInt(eStyle.width);if(DomUtils.browser.isIE())width=elem.offsetWidth;var bLeft=parseInt(eStyle.borderLeft);var bRight=parseInt(eStyle.borderRight);var pLeft=parseInt(eStyle.paddingLeft);var pRight=parseInt(eStyle.paddingRight);w=parseInt(width);w+=!isNaN(bLeft)?parseInt(bLeft):0;w+=!isNaN(bRight)?parseInt(bRight):0;w+=!isNaN(pLeft)?parseInt(pLeft):0;w+=!isNaN(pRight)?parseInt(pRight):0;}else if(DomUtils.browser.isSafari()){if(typeof(writeDebug)=='function')writeDebug('browser is safari...');width=elem.offsetWidth;w=parseInt(width);} return w;} DomUtils.getElementHeight=function(elem){var h=0;var eStyle,height;if(elem.tagName&&elem.tagName=='IMG')h=parseInt(elem.height);else if(document.compatMode=='CSS1Compat')h=parseInt(elem.offsetHeight);else if(document.compatMode=='BackCompat'){eStyle=DomUtils.getCurrentStyle(elem);height=parseInt(eStyle.height);if(DomUtils.browser.isIE())height=elem.offsetHeight;var bTop=parseInt(eStyle.borderTop);var bBottom=parseInt(eStyle.borderBottom);var pTop=parseInt(eStyle.paddingTop);var pBottom=parseInt(eStyle.paddingBottom);h=parseInt(height);if(!DomUtils.browser.isIE()){h+=!isNaN(bTop)?parseInt(bTop):0;h+=!isNaN(bBottom)?parseInt(bBottom):0;h+=!isNaN(pTop)?parseInt(pTop):0;h+=!isNaN(pBottom)?parseInt(pBottom):0;}else{h-=!isNaN(bTop)?parseInt(bTop):0;h-=!isNaN(bBottom)?parseInt(bBottom):0;}}else if(DomUtils.browser.isSafari()){height=elem.offsetHeight;h=parseInt(height);} return h;} DomUtils.getElementLeft=function DomUtils_GetElementLeft(elem){var left=0;try{if(elem.offsetParent){while(elem.offsetParent){left+=parseInt(elem.offsetLeft);elem=elem.offsetParent;}}else if(elem.x){left+=parseInt(elem.x);} return left;}catch(e){return 0;}} DomUtils.getElementTop=function(elem){try{var top=0;if(elem.offsetParent){while(elem.offsetParent){top+=parseInt(elem.offsetTop);elem=elem.offsetParent;}}else if(elem.y){top+=parseInt(elem.y);} return top;}catch(e){return 0;}} DomUtils.center=function(elem){var wWidth=parseInt(DomUtils.getWindowWidth());var wHeight=parseInt(DomUtils.getWindowHeight());var eWidth=parseInt(DomUtils.getElementWidth(elem));var eHeight=parseInt(DomUtils.getElementHeight(elem));var xScroll=parseInt(DomUtils.getWindowScrollX());var yScroll=parseInt(DomUtils.getWindowScrollY());var left=parseInt(wWidth/2)-parseInt(eWidth/2)+xScroll;var top=parseInt(wHeight/2)-parseInt(eHeight/2)+yScroll;elem.style.left=left+'px';elem.style.top=top+'px';} DomUtils.getCurrentStyle=function(elem){if(elem&&elem.currentStyle){return elem.currentStyle;}else if(document.defaultView&&document.defaultView.getComputedStyle){return document.defaultView.getComputedStyle(elem,'');}} DomUtils.duplicateStyle=function(elem1,elem2){var style1=DomUtils.getCurrentStyle(elem1);for(prop in style1){try{eval('elem2.style.'+prop+' = style1.'+prop);}catch(e){}}};DomUtils.getZIndex=function(elem){var eStyle=DomUtils.getCurrentStyle(elem);var zIdx=0;if(eStyle.zIndex&&isNaN(eStyle.zIndex)){if(elem.offsetParent){while(elem.offsetParent){zIdx=(parseInt(eStyle.zIndex)>zIdx)?parseInt(eStyle.zIndex):zIdx;eStyle=DomUtils.getCurrentStyle(elem);elem=elem.offsetParent;}}}else{zIdx=parseInt(eStyle.zIndex);} return zIdx;} DomUtils.getBody=function(){return document.getElementsByTagName('body')[0];} DomUtils.XmlHttp=function(){var request=null;try{ActiveXObject.prototype.jsonRequest=null;request=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{ActiveXObject.prototype.jsonRequest=null;request=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){try{XMLHttpRequest.prototype.jsonRequest=null;request=new XMLHttpRequest();}catch(e){request=null;}}} return request;} Function.prototype.method=function(name,func){this.prototype[name]=func;return this;} function isAlien(a){return isObject(a)&&typeof a.constructor!='function';} function isArray(a){return isObject(a)&&a.constructor==Array;} function isBoolean(a){return typeof a=='boolean';} function isEmpty(o){var i,v;if(isObject(o)){for(i in o){v=o[i];if(isUndefined(v)&&isFunction(v)){return false;}}} return true;} function isFloat(a){return typeof a=='number'&&parseFloat(a)==a;} function isFunction(a){return typeof a=='function';} function isInteger(a){return typeof a=='number'&&parseInt(a)==a;} function isNull(a){return typeof a=='object'&&!a;} function isNumber(a){return typeof a=='number'&&isFinite(a);} function isObject(a){return(a&&typeof a=='object')||isFunction(a);} function isString(a){return typeof a=='string';} function isUndefined(a){return typeof a=='undefined';} function fixPNG_IE(image){if(DomUtils.browser.isIE()){image.outerHTML='
';}} function getAllChildren(e){return e.all?e.all:e.getElementsByTagName('*');} document.getElementsBySelector=function(selector){if(!document.getElementsByTagName){return new Array();} var tokens=selector.split(' ');var currentContext=new Array(document);for(var i=0;i-1){var bits=token.split('#');var tagName=bits[0];var id=bits[1];var element=document.getElementById(id);if(tagName&&element.nodeName.toLowerCase()!=tagName){return new Array();} currentContext=new Array(element);continue;} if(token.indexOf('.')>-1){var bits=token.split('.');var tagName=bits[0];var className=bits[1];if(!tagName){tagName='*';} var found=new Array;var foundCount=0;for(var h=0;h-1);};break;default:checkFunction=function(e){return e.getAttribute(attrName);};} currentContext=new Array;var currentContextIndex=0;for(var k=0;k=0){if(AJAX_REQUEST.DEBUG&&typeof(writeDebug)=='function')writeDebug('abort(): clearing timeout: '+self.requestId+', timerId: '+window.ajaxTimers[self.requestId]);clearTimeout(window.ajaxTimers[this.requestId]);window.ajaxTimers[this.requestId]=null;window.ajaxRequests[this.requestId]=null;} this.request.onreadystatechange=function(){};this.request.abort();this.request=null;this.busy=false;window.ajax.COUNT--;}} this.send=function(){try{this.request=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{this.request=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){try{this.request=new XMLHttpRequest();}catch(e){this.request=null;}}} if(this.request){var url=this.url;if(this.async&&this.callback){this.request.onreadystatechange=this.onStateChange;if(this.requestTimeout!=null&&this.timeout>0&&this.requestId==null){if(window.ajax.COUNT0?'?'+this.params.join('&'):'');this.request.open(this.method,url,this.async,this.user,this.password);this.busy=true;this.request.send('');} if(!this.async){this.busy=false;;return this.request.responseXML;}}} this.setParameter=function(name,value){if(AJAX_REQUEST.DEBUG&&typeof(writeDebug)=='function')writeDebug('AjaxRequest.setParameter('+name+', '+value+') called.');this.params.push(name+'='+encodeURIComponent(value));} this.setResponseType=function(ResponseType){this.ResponseType=(ResponseType=='html'?'html':'xml');} this.setCallback=function(func){if(typeof(func)=='function')this.callback=func;else alert('Unable to set callback handler. Must be a function.');} this.onStateChange=function(){if(self.request&&self.request.readyState&&self.request.readyState==4){if(self.requestTimer&&self.requestId){if(AJAX_REQUEST.DEBUG&&typeof(writeDebug)=='function')writeDebug('XmlHttpRequest '+this.requestId+' clearing timeout.');clearTimeout(self.requestTimer);self.requestTimer=null;self.requestId=null;} self.busy=false;if(AJAX_REQUEST.DEBUG&&typeof(writeDebug)=='function')writeDebug('XmlHttpRequest.reponseText: '+self.request.responseText);if(self.ResponseType&&self.ResponseType=='html'){self.callback(self.request.responseText);}else{self.callback(self.request.responseXML);}}} this.method=method||AJAX_REQUEST.DEFAULT_METHOD;this.url=url||AJAX_REQUEST.DEFAULT_URL;this.async=async||AJAX_REQUEST.DEFAULT_ASYNC;this.requestTimeout=requestTimeout||AJAX_REQUEST.REQUEST_TIMEOUT;this.user=user||null;this.password=password||null;this.callback=null;this.params=new Array;this.request=null;this.requestTimer=null;this.ResponseType='xml';var self=this;}