git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_SGD/tags/3.7.0.2_original@1 eb19766c-00d9-a042-a3a0-45cb8ec72764
1 line
8.7 KiB
JavaScript
1 line
8.7 KiB
JavaScript
(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf("opera")>-1),isSafari=(ua.indexOf("safari")>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf("gecko")>-1),isIE=(!isOpera&&ua.indexOf("msie")>-1);var _3={HYPHEN:/(-[a-z])/i};var _4=function(_5){if(!_3.HYPHEN.test(_5)){return _5;}if(propertyCache[_5]){return propertyCache[_5];}while(_3.HYPHEN.exec(_5)){_5=_5.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[_5]=_5;return _5;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,_7){var _8=null;var _9=document.defaultView.getComputedStyle(el,"");if(_9){_8=_9[_4(_7)];}return el.style[_7]||_8;};}else{if(document.documentElement.currentStyle&&isIE){getStyle=function(el,_b){switch(_4(_b)){case "opacity":var _c=100;try{_c=el.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(e){try{_c=el.filters("alpha").opacity;}catch(e){}}return _c/100;break;default:var _d=el.currentStyle?el.currentStyle[_b]:null;return (el.style[_b]||_d);}};}else{getStyle=function(el,_f){return el.style[_f];};}}if(isIE){setStyle=function(el,_11,val){switch(_11){case "opacity":if(typeof el.style.filter=="string"){el.style.filter="alpha(opacity="+val*100+")";if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[_11]=val;}};}else{setStyle=function(el,_14,val){el.style[_14]=val;};}YAHOO.util.Dom={get:function(el){if(!el){return null;}if(typeof el!="string"&&!(el instanceof Array)){return el;}if(typeof el=="string"){return document.getElementById(el);}else{var _17=[];for(var i=0,len=el.length;i<len;++i){_17[_17.length]=Y.Dom.get(el[i]);}return _17;}return null;},getStyle:function(el,_1a){_1a=_4(_1a);var f=function(_1c){return getStyle(_1c,_1a);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,_1e,val){_1e=_4(_1e);var f=function(_21){setStyle(_21,_1e,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,"display")=="none"){return false;}var _25=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var _29=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var _2a=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return [box.left+_2a,box.top+_29];}else{pos=[el.offsetLeft,el.offsetTop];_25=el.offsetParent;if(_25!=el){while(_25){pos[0]+=_25.offsetLeft;pos[1]+=_25.offsetTop;_25=_25.offsetParent;}}if(isSafari&&this.getStyle(el,"position")=="absolute"){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){_25=el.parentNode;}else{_25=null;}while(_25&&_25.tagName.toUpperCase()!="BODY"&&_25.tagName.toUpperCase()!="HTML"){if(Y.Dom.getStyle(_25,"display")!="inline"){pos[0]-=_25.scrollLeft;pos[1]-=_25.scrollTop;}if(_25.parentNode){_25=_25.parentNode;}else{_25=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,_33){var f=function(el){var _36=this.getStyle(el,"position");if(_36=="static"){this.setStyle(el,"position","relative");_36="relative";}var _37=this.getXY(el);if(_37===false){return false;}var _38=[parseInt(this.getStyle(el,"left"),10),parseInt(this.getStyle(el,"top"),10)];if(isNaN(_38[0])){_38[0]=(_36=="relative")?0:el.offsetLeft;}if(isNaN(_38[1])){_38[1]=(_36=="relative")?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-_37[0]+_38[0]+"px";}if(pos[1]!==null){el.style.top=pos[1]-_37[1]+_38[1]+"px";}var _39=this.getXY(el);if(!_33&&(_39[0]!=pos[0]||_39[1]!=pos[1])){this.setXY(el,pos,true);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var _41=new Y.Region.getRegion(el);return _41;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(_42,tag,_44){var _45=function(el){return Y.Dom.hasClass(el,_42);};return Y.Dom.getElementsBy(_45,tag,_44);},hasClass:function(el,_48){var re=new RegExp("(?:^|\\s+)"+_48+"(?:\\s+|$)");var f=function(el){return re.test(el["className"]);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,_4d){var f=function(el){if(this.hasClass(el,_4d)){return;}el["className"]=[el["className"],_4d].join(" ");};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,_51){var re=new RegExp("(?:^|\\s+)"+_51+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_51)){return;}var c=el["className"];el["className"]=c.replace(re," ");if(this.hasClass(el,_51)){this.removeClass(el,_51);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,_57,_58){if(_57===_58){return false;}var re=new RegExp("(?:^|\\s+)"+_57+"(?:\\s+|$)","g");var f=function(el){if(!this.hasClass(el,_57)){this.addClass(el,_58);return;}el["className"]=el["className"].replace(re," "+_58+" ");if(this.hasClass(el,_57)){this.replaceClass(el,_57,_58);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,_5d){_5d=_5d||"yui-gen";el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=_5d+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(_60,_61){_60=Y.Dom.get(_60);if(!_60||!_61){return false;}var f=function(_63){if(_60.contains&&!isSafari){return _60.contains(_63);}else{if(_60.compareDocumentPosition){return !!(_60.compareDocumentPosition(_63)&16);}else{var _64=_63.parentNode;while(_64){if(_64==_60){return true;}else{if(!_64.tagName||_64.tagName.toUpperCase()=="HTML"){return false;}}_64=_64.parentNode;}return false;}}};return Y.Dom.batch(_61,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(_68,tag,_6a){tag=tag||"*";_6a=Y.Dom.get(_6a)||document;var _6b=[];var _6c=_6a.getElementsByTagName(tag);if(!_6c.length&&(tag=="*"&&_6a.all)){_6c=_6a.all;}for(var i=0,len=_6c.length;i<len;++i){if(_68(_6c[i])){_6b[_6b.length]=_6c[i];}}return _6b;},batch:function(el,_6f,o,_71){var id=el;el=Y.Dom.get(el);var _73=(_71)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return _6f.call(_73,el,o);}var _74=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}_74[_74.length]=_6f.call(_73,el[i],o);}return _74;},getDocumentHeight:function(){var _76=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(_76,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var _78=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(_78,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var _7a=self.innerHeight;var _7b=document.compatMode;if((_7b||isIE)&&!isOpera){_7a=(_7b=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight;}return _7a;},getViewportWidth:function(){var _7c=self.innerWidth;var _7d=document.compatMode;if(_7d||isIE){_7c=(_7d=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth;}return _7c;}};})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};YAHOO.util.Region.prototype.contains=function(_82){return (_82.left>=this.left&&_82.right<=this.right&&_82.top>=this.top&&_82.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return ((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(_83){var t=Math.max(this.top,_83.top);var r=Math.min(this.right,_83.right);var b=Math.min(this.bottom,_83.bottom);var l=Math.max(this.left,_83.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(_88){var t=Math.min(this.top,_88.top);var r=Math.max(this.right,_88.right);var b=Math.max(this.bottom,_88.bottom);var l=Math.min(this.left,_88.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return ("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); |