| 1 |
define("udx.utility",function(){return{isVisible:function(a,b,c,d,e,f,g){"string"==typeof a&&(a=document.getElementById(a));var h=a.parentNode,i=2;return this.elementInDocument(a)?9===h.nodeType?!0:"0"===this.getStyle(a,"opacity")||"none"===this.getStyle(a,"display")||"hidden"===this.getStyle(a,"visibility")?!1:(("undefined"==typeof b||"undefined"==typeof c||"undefined"==typeof d||"undefined"==typeof e||"undefined"==typeof f||"undefined"==typeof g)&&(b=a.offsetTop,e=a.offsetLeft,d=b+a.offsetHeight,c=e+a.offsetWidth,f=a.offsetWidth,g=a.offsetHeight),h?"hidden"!==this.getStyle(h,"overflow")&&"scroll"!==this.getStyle(h,"overflow")||!(e+i>h.offsetWidth+h.scrollLeft||e+f-i<h.scrollLeft||b+i>h.offsetHeight+h.scrollTop||b+g-i<h.scrollTop)?(a.offsetParent===h&&(e+=h.offsetLeft,b+=h.offsetTop),this.isVisible(h,b,c,d,e,f,g)):!1:!0):!1},getStyle:function(a,b){return window.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:void 0},elementInDocument:function(a){for(;a=a.parentNode;)if(a==document)return!0;return!1},remote_get:function(){var a=makeHttpObject(),b=arguments[0],c=arguments[1];a.open("GET",b,!0),a.send(null),a.onreadystatechange=function(){4==a.readyState&&(200==a.status?c(null,a.responseText):failure&&c(new Error(a.statusText)))}},remote_post:function(){var a=makeHttpObject(),b=arguments[0],c=arguments[1];a.open("POST",b,!0),a.send(null),a.onreadystatechange=function(){4==a.readyState&&(200==a.status?c(null,a.responseText):failure&&c(new Error(a.statusText)))}},extend:function(a,b){for(var c in b)b[c]&&b[c].constructor&&b[c].constructor===Object?(a[c]=a[c]||{},arguments.callee(a[c],b[c])):a[c]=b[c];return a},defaults:function(a,b){return this.extend(b||{},a||{})},create_slug:function(a){return a.replace(/[^a-zA-Z0-9_\s]/g,"").toLowerCase().replace(/\s/g,"_")}}}); |