/*______________
|       ______  |   U I Z E     J A V A S C R I P T     A P I
|     /      /  |   -----------------------------------------
|    /    O /   |    MODULE : Uize.Element Package (version 1.2.1)
|   /    / /    |    AUTHOR : Chris van Rensburg (http://www.tomkidding.com)
|  /    / /  /| |    ONLINE : http://www.tomkidding.com/uize/uize-js-api
| /____/ /__/_| | COPYRIGHT : (c)2004-2006 Chris van Rensburg
|           |__ |   LICENSE : Distributed under the terms of the GNU General Public License
|_______________|             http://www.gnu.org/licenses/gpl.txt
*/
(function(){if(typeof Uize=='undefined')Uize={};var _a=Uize.Element={},_b='undefined',_c=document,_d='string',_e=true,_f=false,_g=null,_h=navigator,_i=_h.userAgent.toLowerCase(),_j=_h.appName=='Microsoft Internet Explorer',_k=_i.indexOf('gecko')!= -1,_l='hidden';function _m(_n){return _n&&typeof _n=='object'&&(_n.getAttribute||(_n.self&&_n.self==_n));}function _o(_n){return _m(_n)?_n:_c.getElementById(_n);}function _p(_q,_r,_s){
return(_q||'')+(_q&&_r&&_s?_s:'')+_r;}function _t(_u){var _n=_c.getElementsByName(_u);if(_n.length==1){_n=_n[0];}else if(_n.length==0){_n=_o(_u);}return _n;}function _v(_w){var _x=[],_y={},_z;for(var _A in _w)_y[_A]=_w[_A];if(_y.name){_z=_c.getElementsByName(_y.name);delete _y.name;}else if(_y.tagName){_z=_c.getElementsByTagName(_y.tagName);delete _y.tagName;}else{_z=_c.getElementsByTagName('*');}var _B=_z.length;for(var _C=0;_C<_B;_C++){var _n=_z[_C],_D=_e;for(var _A in _y){if(_n[_A]!=_y[_A]){_D=_f;break;}}if(_D)_x.push(_n)}return _x;}function _E(_n,_F){var _G=typeof _n[_F]!=_b?_n[_F]:((typeof _n.attributes&&_n.attributes.getNamedItem&&_n.attributes.getNamedItem(_F))?_n.attributes.getNamedItem(_F).value:_g);return _G;}function _H(_I,_n){if(typeof _n!=_b&&_n!=_g){_J(_n,function(_n){_n.innerHTML=_I});}else{document.write(_I);}}function _K(_n,_I,_L){_J(_n,function(_n){var _M=_c.createElement('DIV');_M.innerHTML=_I;var _N=_M.childNodes,_O=0;while(_N.length>0){var _P=_N[0];
if(_L!=='before'||_n.childNodes.length==_O){_n.appendChild(_P);}else{_n.insertBefore(_P,_n.childNodes[_O]);}_O++;}});}function _J(_n,_Q,_q,_s){function _R(_n){if(_n){if(_m(_n)){_Q(_n);}else{var _S=typeof _n;if(_S==_d){_R(_t(_p(_q,_n,_s)));}else if((_S=='object'||_S=='function')&&typeof _n.length=='number'){var _T=_n.length;for(var _U=0;_U<_T;_U++)_R(_n[_U]);}else if(_S=='object'){for(var _V in _n)_R(_n[_V]);}}}}_R(_n);}function _W(_n,_q,_s){var _G=[];_J(_n,function(_n){_G.push(_n)},_q,_s);return _G;}function _X(_n){_J(_n,function(_n){_n.parentNode.removeChild(_n)});}function _Y(_Z,_q,_s){var _0;if(_m(_Z)){_0=_Z;}else if(typeof _Z==_d){_0=_o(_p(_q,_Z,_s));}else{_0=_W(_Z,_q,_s);if(!_0.length)_0=_g;}return _0;}function _1(_n,_2){var _3='';_n=_a.getById(_n);if(_n){if(_c.defaultView&&_c.defaultView.getComputedStyle&&_c.defaultView.getComputedStyle(_n,'')){_3=_c.defaultView.getComputedStyle(_n,'')[_2];}else if(_n.currentStyle){_3=_n.currentStyle.getAttribute(_2);}else{_3=_n.style[_2];}}return _3;}function _4(_n){
var _G={width:0,height:0};_n=_a.getById(_n);if(_n){var _5=window;if(_n==_5){_G.width=_5.innerWidth||_c.documentElement.offsetWidth;_G.height=_5.innerHeight||_c.documentElement.offsetHeight;}else{_G.width=parseInt(_1(_n,'width'));_G.height=parseInt(_1(_n,'height'));if(isNaN(_G.width)||_n.offsetWidth>_G.width)_G.width=_n.offsetWidth;if(isNaN(_G.height)||_n.offsetHeight>_G.height)_G.height=_n.offsetHeight;}}return _G;}function _6(_7,_8,_9,_ba,_bb,_bc,_bd,_be){var _bf=_7+_9-1,_bg=_8+_ba-1,_bh=_bb+_bd-1,_bi=_bc+_be-1;var _G=((_8>=_bc&&_8<=_bi)||(_bg>=_bc&&_bg<=_bi)||(_8<_bc&&_bg>_bi))&&((_7>=_bb&&_7<=_bh)||(_bf>=_bb&&_bf<=_bh)||(_7<_bb&&_bf>_bh));return _G;}function _bj(_n,_bk){var _bl=0,_bm=0,_bn=0,_bo=0,_bp=null;_n=_a.getById(_n);if(_m(_n)){if(typeof _bk=='undefined')_bk=true;if(_n.tagName=='A'&&_n.childNodes.length==1&&_n.childNodes[0].tagName=='IMG')_n=_n.childNodes[0];var _bq=null,_br=typeof _n.style!='undefined',_bs=_br?_n.style.visibility:'',_bt=_bs=='visible'||_bk=='treat as visible'||
((_bs==''||_bs=='inherit')&&_bk),_bu=_bq;if(!_bu)_bu=_n;_bq=_bu;while(_bu.parentNode&&typeof _bu.parentNode!='unknown'){if(_bp==null){if(_bu.style.visibility==='visible'){_bp=true;}else if(_bu.style.visibility==='hidden'){_bp=false;}}if(_bu==_bq){if(typeof _bu.offsetLeft!='undefined')_bl+=_bu.offsetLeft;if(typeof _bu.offsetTop!='undefined')_bm+=_bu.offsetTop;_bq=_bu.offsetParent;}if(_bu!=_c.body&&_bu!=_c.documentElement){if(_bu!=_n&&(_bu.scrollWidth>_bu.offsetWidth||_bu.scrollHeight>_bu.offsetHeight)){_bl-=_bu.scrollLeft;_bm-=_bu.scrollTop;if(_j){_bl+=_bu.clientLeft;_bm+=_bu.clientTop;}if(_bp!==false){var _bv=_bj(_bu);if(!_6(_bl,_bm,_n.offsetWidth,_n.offsetHeight,_bv.x,_bv.y,_bv.width,_bv.height)){_bp=false;}}}}_bu=_bu.parentNode;}if(_bp==null)_bp=true;_bp=_bp&&_6(_bl,_bm,_n.offsetWidth,_n.offsetHeight,_c.body.scrollLeft,_c.body.scrollTop,_c.body.offsetWidth,_c.body.offsetHeight);if(_bn==0||_bo==0){if(_bt){if(typeof _n.offsetWidth!='undefined')_bn=_n.offsetWidth;
if(typeof _n.offsetHeight!='undefined')_bo=_n.offsetHeight;}if((_bn==0||_bo==0)&&_n.tagName=='DIV'){var _bw=_n.childNodes,_bx=_bw.length;for(var _by=0;_by<_bx;_by++){if(_bw[_by].nodeName.charAt(0)!='#'){var _bz=_bj(_bw[_by],_bt);if(_bz.width!=0||_bz.height!=0){_bn=Math.max(_bn,_bz.right-_bl+1);_bo=Math.max(_bo,_bz.bottom-_bm+1);}}}}}}var _bA={x:_bl,y:_bm,width:_bn,height:_bo,area:_bn*_bo,left:_bl,top:_bm,right:_bl+_bn-1,bottom:_bm+_bo-1,seen:_bp};return _bA;}function _bB(_n,_bA){var _bC=typeof _bA.length=='number';_bD(_n,{left:Math.round(_bC?_bA[0]:_bA.left)+'px',top:Math.round(_bC?_bA[1]:_bA.top)+'px',width:Math.round(_bC?_bA[2]:_bA.width)+'px',height:Math.round(_bC?_bA[3]:_bA.height)+'px'});}function _bE(_n){var _bF='';_n=_a.getById(_n);if(_n){function _bG(_0){if(typeof _0.innerText==_d){_bF=_0.innerText.replace(/\r|\n|\r\n/g,'');}else if(typeof _0.textContent==_d){_bF=_0.textContent;}else{if(_0.nodeType==3)_bF=_0.data;if(_0.childNodes){var _bw=_n.childNodes,_bx=_bw.length;for(var _by=0;_by<_bx;_by++)
_bF+=_bE(_bw[_by]);}}}_bG(_n);}return _bF;}function _bH(_bI,_bJ){return'Uize_Element_'+_bI+'Handler'+((_bJ<0)?'__':'')+Math.abs(_bJ);}function _bK(_n,_bI,_bL,_bM){if(typeof _bM!=_d)_bM='after';_J(_n,function(_n){if(!_n.Uize_Element_a){_n.Uize_Element_a={};_n.Uize_Element_b={};}if(!_n.Uize_Element_a[_bI]){_n.Uize_Element_a[_bI]=0;_n.Uize_Element_b[_bI]= -1;_n[_bH(_bI,--_n.Uize_Element_a[_bI])]=(typeof _n[_bI]=='function')?_n[_bI]:function(){return _e};_bN(_n,_bI,new Function('event','return (typeof Uize != \'undefined\' && Uize.Element) ? Uize.Element.execHandlers (this,event,\''+_bI+'\') : false'));}if(_bM=='before'){_n[_bH(_bI,--_n.Uize_Element_a[_bI])]=_bL;}else{_n[_bH(_bI,++_n.Uize_Element_b[_bI])]=_bL;}});}function _bO(_n,_bP){for(var _bQ in _bP)_bK(_n,_bQ,_bP[_bQ]);}function _bR(_n,_bS){_bD(_n,{display:_bS||typeof _bS==_b?'block':'none'});}function _bT(_n,_bU){_bD(_n,{visibility:_bU||typeof _bU==_b?'inherit':_l});}function _bV(_n,_bW){_bD(_n,{cursor:_bW||typeof _bW==_b?(_j?'hand':'pointer'):'default'});}
function _bX(_0,_bY){var _G=false,_bZ=_0;while(_bZ&& !_G){_G=_bZ==_bY;try{_bZ=_bZ.parentNode;}catch(_b0){_bZ=null;}}return _G;}function _bN(_n,_bI,_bL,_b1){_b1=_b1||'';_J(_n,function(_n){if(!_b2[_b1])_b2[_b1]={};var _b3=_b2[_b1];if(!_b3[_bI])_b3[_bI]=[];_b3[_bI].push(_n);if(_bI=='onmouseover'){_n.onmouseover=function(_bQ){_bQ=_bQ||window.event;var _b4=_bQ.fromElement||_bQ.relatedTarget,_b5;if(!_b4|| !(_b4.Uize_Widget_Drag_shield||_bX(_b4,this)))_b5=_bL.call(this,_bQ);return _b5;};}else if(_bI=='onmouseout'){_n.onmouseout=function(_bQ){_bQ=_bQ||window.event;var _b6=_bQ.toElement||_bQ.relatedTarget,_b5;if(!_b6|| !(_b6.Uize_Widget_Drag_shield||_bX(_b6,this)))_b5=_bL.call(this,_bQ);return _b5;};}else{_n[_bI]=function(_bQ){_bQ=_bQ||window.event;return _bL.call(this,_bQ);};}_n=_g;});}function _b7(_n,_bP,_b1){for(var _bQ in _bP)_bN(_n,_bQ,_bP[_bQ],_b1);}function _b8(_b1){var _b3=_b2[_b1];if(_b3){for(var _bI in _b3){var _b9=_b3[_bI],_ca=_b9.length;for(var _C=0;_C<_ca;_C++){try{_b9[_C][_bI]=null;}catch(_b0){}}
delete _b3[_bI];}delete _b2[_b1];}}function _cb(_n,_bU){_bU=_bU!==_f;_bD(_n,{position:_bU?'static':'absolute',visibility:_bU?'inherit':_l});}function _cc(_cd){var _w={};if(_j){_w.filter='alpha(opacity='+Math.round(_cd*100)+')';}else{_w.opacity=(_k&&_i.indexOf('firefox/1.0')> -1?.999:1)*_cd;}return _w;}function _ce(_w){var _G='';for(var _cf in _w)_G+=_cf+':'+_w[_cf]+'; ';return _G;}function _cg(_cd){return _ce(_cc(_cd));}function _ch(_n,_cd){_bD(_n,_cc(_cd));}function _ci(_n,_cj,_ck,_cl,_cm){_bD(_n,{clip:'rect('+_cj+'px '+_ck+'px '+_cl+'px '+_cm+'px)'});}function _bD(_n,_w){_J(_n,function(_n){var _cn=_n.style;for(var _cf in _w)_cn[_cf]=_w[_cf];});}function _co(_n,_w){_J(_n,function(_n){for(var _cf in _w)_n[_cf]=_w[_cf];});}function _cp(_n,_I){_J(_n,function(_n){_n.innerHTML=_I});}_a.execHandlers=function(_cq,_bQ,_bI){_cq.Uize_Element_c=_e;var _cr=_cq.Uize_Element_a[_bI],_cs=_cq.Uize_Element_b[_bI];for(var _bJ=_cs;_bJ>=_cr;_bJ--){var _bL=_cq[_bH(_bI,_bJ)],_ct=(typeof _bL==_d)?eval(_bL):_bL(_bQ,_cq);
_cq.Uize_Element_c=_cq.Uize_Element_c&&typeof _ct=='boolean'&&_ct;}return _cq.Uize_Element_c;};var _b2={};if(_j){var _cu=window.onbeforeunload,_cv=window.onunload;function _cw(){for(var _b1 in _b2)_b8(_b1);}window.onunload=function(){_cw();if(typeof _cx=='function')_cx();};}_a.addEventHandler=_bK;_a.addEventHandlers=_bO;_a.asArray=_W;_a.display=_bR;_a.doForAll=_J;_a.doRectanglesOverlap=_6;_a.getAttributeValue=_E;_a.getById=_o;_a.getByNameOrId=_t;_a.getByMatch=_v;_a.getCoords=_bj;_a.getDimensions=_4;_a.getOpacityProperties=_cc;_a.getOpacityStr=_cg;_a.getStyleAttribute=_1;_a.getText=_bE;_a.injectHtml=_K;_a.insertHtml=_H;_a.isNode=_m;_a.remove=_X;_a.resolve=_Y;_a.setClipRect=_ci;_a.setCoords=_bB;_a.setInnerHtml=_cp;_a.setOpacity=_ch;_a.setProperties=_co;_a.setStyle=_bD;_a.show=_bT;_a.showClickable=_bV;_a.showInLayoutFlow=_cb;_a.stylePropertiesAsStr=_ce;_a.unwireEventsByOwnerId=_b8;_a.wireEvent=_bN;_a.wireEvents=_b7;})();
