// Tool method pop-up mask add by dning 2012-11-4 VaR Maskshow = ( Function (){ VaR Mask = Null ; VaR Curr = Null ; VaR Free = False ; VaR Func = {Onresize: Null , Onscroll: Null }; Return Function (EL, FRE, type ){ If (! Mask) {initmask ();} free = !! Fre; If (El = Null ) {Show (curr, False ); Show (mask, False ); Showselects ( True ); // For IE6 Curr = Null ; If (! Free) For ( VaR S In Func) {window [s] =Func [s]; func [s] = Null ;}} Else { If (Curr) show (curr, False ); Curr = $ (EL) [0 ]; Checkvisib (curr); repos (); mask. style. zindex = Maskshow. zindexback | 15 ; Curr. style. zindex = Maskshow. zindexfore | 20; Show (curr, True ); Show (mask, True ); Showselects ( False , El ); // For IE6 If (! Free) For ( VaR S In Func) {func [s] = Window [s]; window [s] = Repos ;}} If (Type = 0 ) {Mask. style. Width = Document. Body. clientwidth + 'px' ; Mask. style. Height = Document. Body. clientheight + 'px' ; If (EL) El. style. Position = "fixed" ;} Else {Mask. style. Width = "0px" ; Mask. style. Height = "0px" ; If (EL) El. style. Position = "absolute" ;}}; Function Showselects (B, box ){ If (! Browser. IE6) Return ; VaR Sel = Document. getelementsbytagname ('select' ); VaR Vis = B? 'Visible ': 'hidd' ; For ( VaR I = 0; I <SEL. length; I ++ ){ If (B |! Childof (SEL [I], box) & sel [I]. currentstyle. Visibility! = Vis) SEL [I]. style. Visibility = Vis ;}} Function Childof (a, B ){ While (A &! = B) A = A. parentnode; Return A = B ;} Function Initmask (){ /* Mask = Document. createelement ('iframe'); mask. src = ': // 0 '; */ Mask = Document. createelement ('div' ); Mask.style.css text = 'Background-color: {$ c}; Border: none; position: absolute; visibility: hidden; opacity: {$ A}; filter: alpha (opacity = {$ })' . Replacewith ({C: maskshow. bgcolor | '#000' , A: maskshow. bgalpha | '0. 5' , A: maskshow. bgalpha ? Parseint (maskshow. bgalpha * 100): '50' }); Document. Body. appendchild (mask); maskshow. Mask = Mask ;} Function Checkvisib (EL ){ VaR Sty = El. style; sty. Position = 'Abort' ; Sty. Left = '-Pixel PX' ; Sty. Top = '-Pixel PX' ; Sty. Visibility = 'Visible' ; Sty. Display = 'Block' ; Sty. zindex = 10 ;} Function Repos (){ If (! Curr) Return ; VaR PS = $ pagesize ('Doc' ); Setrect (mask, PS ); VaR Rc = Centerpos (Ps, curr. offsetwidth, curr. offsetheight ); If (RC. Left <ps. scrollleft) RC. Left = PS. scrollleft; If (RC. Top <ps. scrolltop) RC. Top =PS. scrolltop; setrect (curr, RC );} Function Centerpos (Ps, CW, CH ){ Return {Left: (PS. winwidth -Cw)> 1) + PS. scrollleft + (maskshow. adjustx | 0 ), Top: (PS. winheight -Ch)> 1) + PS. scrolltop + (maskshow. adjusty | 0 )};} Function Setrect (El, rect ){ VaR Sty = El. style; sty. Left = (Rect. Left | 0) + 'px' ; Sty. Top = (Rect. Top | 0) + 'px' ; If ('Width' In Rect) sty. Width = Rect. Width + 'px' ; If ('Height' In Rect) sty. Height = Rect. height + 'px' ;} Function Show (El, B ){ If (! El) Return ; El. style. Visibility = 'Visible' ; If (! B) {El. style. Left =-El. offsetwidth-100 + 'px' ; El. style. Top =-El. offsetheight-100 + 'px' ;}}})();