//·�� document.write(''); luwei$iframe = new object(); luwei$iframe._variablename = 'luwei$iframe'; luwei$iframe.loadinghtmlurl = null; luwei$iframe.windowcssclasses = new array(); luwei$iframe.windowtitlecssclasses = new array(); luwei$iframe.windowclosecssclasses = new array(); luwei$iframe.windowcontentcssclasses = new array(); luwei$iframe.windowmaskcssclasses = new array(); luwei$iframe.windowfootercssclasses = new array(); luwei$iframe.windowresizecssclasses = new array(); luwei$iframe.zindex = 100; luwei$iframe._isshown = false; luwei$iframe._initialized = false; luwei$iframe._modal = null; luwei$iframe._modaltitle = null; luwei$iframe._modalclose = null; luwei$iframe._modalanimationmask = null; luwei$iframe._modalmask = null; luwei$iframe._modaliframe = null; luwei$iframe._modalresize = null; luwei$iframe._modalfooter = null; luwei$iframe._modalcontent = null; luwei$iframe._animationhandle = null; luwei$iframe._isopening = false; luwei$iframe._hiddenselects = null; luwei$iframe._checkforscrollresizehandle = null; luwei$iframe._lastmodalinfo = null; luwei$iframe._lastwindowinfo = null; luwei$iframe._isdragging = false; luwei$iframe._movemodalinfo = null; luwei$iframe._resizemodalinfo = null; luwei$iframe._isresizing = false; luwei$iframe.configure = function(loadinghtmlurl, windowcssclasses, windowtitlecssclasses, windowclosecssclasses, windowcontentcssclasses, windowfootercssclasses, windowresizecssclasses, windowmaskcssclasses, zindex) { this.loadinghtmlurl = loadinghtmlurl; this.windowcssclasses = windowcssclasses; this.windowtitlecssclasses = windowtitlecssclasses; this.windowclosecssclasses = windowclosecssclasses; this.windowcontentcssclasses = windowcontentcssclasses; this.windowmaskcssclasses = windowmaskcssclasses; this.windowfootercssclasses = windowfootercssclasses; this.windowresizecssclasses = windowresizecssclasses; this.zindex = zindex; } luwei$iframe.isshown = function() { return this._isshown; } luwei$iframe._getwindowinfo = function() { var scrollx = 0, scrolly = 0, width = 0, height = 0, contentwidth = 0, contentheight = 0; if (typeof(window.pagexoffset) == 'number') { //netscape compliant scrollx = window.pagexoffset; scrolly = window.pageyoffset; } else if (document.body && (document.body.scrollleft || document.body.scrolltop)) { //dom compliant scrollx = document.body.scrollleft; scrolly = document.body.scrolltop; } else if (document.documentelement && (document.documentelement.scrollleft || document.documentelement.scrolltop)) { //ie6 standards compliant mode scrollx = document.documentelement.scrollleft; scrolly = document.documentelement.scrolltop; } if (typeof(window.innerwidth) == 'number') { //non-ie width = window.innerwidth; height = window.innerheight; } else if (document.documentelement && (document.documentelement.clientwidth || document.documentelement.clientheight)) { //ie 6+ in 'standards compliant mode' width = document.documentelement.clientwidth; height = document.documentelement.clientheight; } else if (document.body && (document.body.clientwidth || document.body.clientheight)) { //ie 4 compatible width = document.body.clientwidth; height = document.body.clientheight; } if (document.documentelement && (document.documentelement.scrollheight || document.documentelement.offsetheight)) { if (document.documentelement.scrollheight > document.documentelement.offsetheight) { contentwidth = document.documentelement.scrollwidth; contentheight = document.documentelement.scrollheight; } else { contentwidth = document.documentelement.offsetwidth; contentheight = document.documentelement.offsetheight; } } else if (document.body && (document.body.scrollheight || document.body.offsetheight)) { if (document.body.scrollheight > document.body.offsetheight) { contentwidth = document.body.scrollwidth; contentheight = document.body.scrollheight; } else { contentwidth = document.body.offsetwidth; contentheight = document.body.offsetheight; } } else { contentwidth = width; contentheight = height; } if (height > contentheight) height = contentheight; if (width > contentwidth) width = contentwidth; var rect = new object(); rect.scrollx = scrollx+0; rect.scrolly = scrolly+0; rect.width = width; rect.height = height; rect.contentwidth = contentwidth; rect.contentheight = contentheight; return rect; } luwei$iframe._getcurrentstylevalue = function(element, stylerule, jsstylerule) { var value = 0; if(document.defaultview && document.defaultview.getcomputedstyle) value = parseint(document.defaultview.getcomputedstyle(element, "").getpropertyvalue(stylerule), 0); else if(element.currentstyle) value = parseint(element.currentstyle[jsstylerule], 0); if (!isnan(value)) return value; else return 0; } luwei$iframe._calculatestyleoffset = function(element) { var result = new object(); result.height = this._getcurrentstylevalue(element, 'border-top-width', 'bordertopwidth') + this._getcurrentstylevalue(element, 'border-bottom-width', 'borderbottomwidth') + this._getcurrentstylevalue(element, 'padding-top', 'paddingtop') + this._getcurrentstylevalue(element, 'padding-bottom', 'paddingbottom'); result.width = this._getcurrentstylevalue(element, 'border-left-width', 'borderleftwidth') + this._getcurrentstylevalue(element, 'border-right-width', 'borderrightwidth') + this._getcurrentstylevalue(element, 'padding-left', 'paddingleft') + this._getcurrentstylevalue(element, 'padding-right', 'paddingright'); return result; } luwei$iframe.open = function (url, width, height, onclosefunction, x, y, ignorecloseandanimation) { if (!ignorecloseandanimation && this._isshown) this.close(); else if (this._hiddenselects) { for (var i = 0; i < this._hiddenselects.length; i++) { if (this._hiddenselects[i].element.style.visibility == 'hidden') this._hiddenselects[i].element.style.visibility = this._hiddenselects[i].visibility; } this._hiddenselects = null; } if (!this._initialized) this._initialize(); try { this._modaltitle.childnodes[1].innerhtml = this._modaliframe.contentwindow.document.title; } catch (err) { } if (!ignorecloseandanimation) this._modaliframe.src = url; try { this._modaliframe.contentwindow.opener = window; } catch (err) { } this._modalanimationmask.style.display = 'none'; this._modalmask.style.display = 'none'; // retrieve the window info this._lastwindowinfo = this._getwindowinfo(); this._modalanimationmask.style.display = 'block'; // width/height of panel if (width > this._lastwindowinfo.width) width = this._lastwindowinfo.width; this._modalanimationmask.style.position = 'absolute'; this._modalanimationmask.style.zindex = this.zindex; this._modalanimationmask.style.display = 'block'; this._modalanimationmask.style.visibility = 'hidden'; this._modalanimationmask.style.overflow = 'hidden'; this._modalanimationmask.style.width = width + 'px'; this._modalcontent.style.width = width + 'px'; this._modal.style.position = 'absolute'; this._modal.style.display = 'block'; this._modal.style.visibility = 'hidden'; this._modal.style.left = '0px'; this._modal.style.top = '0px'; this._modalmask.style.position = 'absolute'; this._modalmask.style.display = 'block'; this._modalmask.style.zindex = this.zindex; this._modalmask.style.visibility = 'visible'; var modalcontentoffset = this._calculatestyleoffset(this._modalcontent); var offset = (this._modal.offsetheight - this._modalcontent.offsetheight) - modalcontentoffset.height; if (height + offset > this._lastwindowinfo.height) height = this._lastwindowinfo.height - offset; if (width < this._modalresize.offsetwidth * 2) width = this._modalresize.offsetwidth * 2; if (width < this._modalclose.offsetwidth * 2) width = this._modalclose.offsetwidth * 2; if (height < this._modaltitle.offsetheight + this._modalfooter.offsetheight) height = this._modaltitle.offsetheight + this._modalfooter.offsetheight; this._modaliframe.style.height = height + 'px'; this._modalcontent.style.height = height + 'px'; this._modalcontent.style.width = (width - (this._modal.offsetwidth - this._modalcontent.offsetwidth) - modalcontentoffset.width) + 'px'; this._modalanimationmask.style.width = width + 'px'; this._modalanimationmask.style.height = this._modal.offsetheight + 'px'; this._modalmask.style.left = '0px'; this._modalmask.style.top = '0px'; this._modalmask.style.width = this._lastwindowinfo.contentwidth + 'px'; this._modalmask.style.height = this._lastwindowinfo.contentheight + 'px'; this._lastwindowinfo = this._getwindowinfo(); var panelwidth = this._modal.offsetwidth; var panelheight = this._modal.offsetheight; var animatepropertyname, animatetargetvalue, animatenextvalue; if (typeof(x) == 'undefined' || isnan(parseint(x, 10))) x = ((this._lastwindowinfo.width - panelwidth) / 2) + this._lastwindowinfo.scrollx; if (x + panelwidth > this._lastwindowinfo.width + this._lastwindowinfo.scrollx) x = this._lastwindowinfo.width + this._lastwindowinfo.scrollx - panelwidth; if (x < this._lastwindowinfo.scrollx) x = this._lastwindowinfo.scrollx; if (typeof(y) == 'undefined' || isnan(parseint(y, 10))) y = ((this._lastwindowinfo.height - panelheight) / 2) + this._lastwindowinfo.scrolly; if (y + panelheight > this._lastwindowinfo.height + this._lastwindowinfo.scrolly) y = this._lastwindowinfo.height + this._lastwindowinfo.scrolly - panelheight; if (y < this._lastwindowinfo.scrolly) y = this._lastwindowinfo.scrolly; this._modalanimationmask.style.left = x + 'px'; this._modalanimationmask.style.top = y + 'px'; animatetargetvalue = 0; animatenextvalue = -panelheight; this._modal.style.visibility = 'visible'; this._modalanimationmask.style.visibility = 'visible'; this._modalanimationmask.style.overflow = 'hidden'; // detect and hide select boxes if (this._modalanimationmask.getclientrects) { var selectboxes = document.getelementsbytagname('select'); this._hiddenselects = new array(); for (var i = 0; i < selectboxes.length; i++) { this._hiddenselects[this._hiddenselects.length] = { element: selectboxes[i], visibility: selectboxes[i].style.visibility }; selectboxes[i].style.visibility = 'hidden'; } } this._isopening = true; if (ignorecloseandanimation) this._animationhandle = window.settimeout(new function(this._variablename + '._animate(0,0,0,0);'), 9); else { this._modaliframe.style.display = 'none'; this._animate(0, -panelheight, panelheight / 3, .67); } this._lastmodalinfo = { url : this._modaliframe.src, onclosefunction : onclosefunction, x : x, y : y, width : parseint(width, 10), height: parseint(height, 10) }; this._isshown = true; } luwei$iframe._checkforscrollresize = function() { if (this._checkforscrollresizehandle) window.cleartimeout(this._checkforscrollresizehandle); if (this._isshown && !this._isopening && this._lastwindowinfo) { try { this._modaltitle.childnodes[1].innerhtml = this._modaliframe.contentwindow.document.title; } catch (err) { } var windowinfo = this._getwindowinfo(); if (windowinfo.scrollx != this._lastwindowinfo.scrollx || windowinfo.scrolly != this._lastwindowinfo.scrolly || windowinfo.width != this._lastwindowinfo.width || windowinfo.height != this._lastwindowinfo.height) this.open(null, this._lastmodalinfo.width, this._lastmodalinfo.height, this._lastmodalinfo.onclosefunction, this._lastmodalinfo.x, this._lastmodalinfo.y, true); else this._checkforscrollresizehandle = window.settimeout(new function('window.' + this._variablename + '._checkforscrollresize();'), 999); } } luwei$iframe.close = function(returnvalue) { if (this._isshown) { if (!this._initialized) this._initialize(); this._modal.style.position = 'absolute'; this._modal.style.display = 'none'; this._modalanimationmask.style.position = 'absolute'; this._modalanimationmask.style.display = 'none'; this._modalmask.style.position = 'absolute'; this._modalmask.style.display = 'none'; this._modaliframe.src = this.loadinghtmlurl; var onclosefunction = this._lastmodalinfo.onclosefunction; this._isshown = false; this._lastmodalinfo = null; this._windowinfo = null; if (this._hiddenselects) { for (var i = 0; i < this._hiddenselects.length; i++) { if (this._hiddenselects[i].element.style.visibility == 'hidden') this._hiddenselects[i].element.style.visibility = this._hiddenselects[i].visibility; } this._hiddenselects = null; } if (onclosefunction) onclosefunction(returnvalue); this.dispose(); } } luwei$iframe.refresh = function() { if (this._animationhandle) window.cleartimeout(this._animationhandle); this.dispose(); if (this._isshown && this._lastmodalinfo) this.open(this._lastmodalinfo.url, this._lastmodalinfo.width, this._lastmodalinfo.onclosefunction, this._lastmodalinfo.height, this._lastmodalinfo.onclosefunction, this._lastmodalinfo.x, this._lastmodalinfo.y); } luwei$iframe._initialize = function() { this._modalmask = document.createelement('div'); this._modalmask.style.width = 'auto'; this._modalmask.style.height = 'auto'; this._modalmask.style.position = 'absolute'; this._modalmask.style.display = 'none'; var mm = this._modalmask; if (this.windowmaskcssclasses.length > 0) { mm.classname = this.windowmaskcssclasses[0]; for (var i = 1; i < this.windowmaskcssclasses.length; i++) { mm.appendchild(document.createelement('div')); mm = mm.childnodes[0]; mm.classname = this.windowmaskcssclasses[i]; mm.style.width = 'auto'; mm.style.height = 'auto'; } } document.body.appendchild(this._modalmask); this._modalanimationmask = document.createelement('div'); this._modalanimationmask.style.position = 'absolute'; this._modalanimationmask.style.display = 'none'; this._modalanimationmask.style.overflow = 'hidden'; this._modal = document.createelement('div'); this._modal.style.width = 'auto'; this._modal.style.height = 'auto'; this._modal.style.position = 'absolute'; this._modal.style.display = 'none'; var m = this._modal; if (this.windowcssclasses.length > 0) { m.classname = this.windowcssclasses[0]; for (var i = 1; i < this.windowcssclasses.length; i++) { m.appendchild(document.createelement('div')); m = m.childnodes[0]; m.classname = this.windowcssclasses[i]; m.style.width = 'auto'; m.style.height = 'auto'; } } this._modaltitle = document.createelement('div'); m.appendchild(this._modaltitle); if (this.windowtitlecssclasses.length > 0) { this._modaltitle.classname = this.windowtitlecssclasses[0]; for (var i = 1; i < this.windowtitlecssclasses.length; i++) { this._modaltitle.appendchild(document.createelement('div')); this._modaltitle = this._modaltitle.childnodes[0]; this._modaltitle.classname = this.windowtitlecssclasses[i]; } } this._modaltitle.onmousedown = new function('event', 'window.' + this._variablename + '._startdrag(event); return false;'); this._modalclose = document.createelement('div'); this._modaltitle.appendchild(this._modalclose); var mc = this._modalclose; if (this.windowclosecssclasses.length > 0) { mc.classname = this.windowclosecssclasses[0]; for (var i = 1; i < this.windowclosecssclasses.length; i++) { mc.appendchild(document.createelement('div')); mc = mc.childnodes[0]; mc.classname = this.windowclosecssclasses[i]; } } this._modalclose.onclick = new function('window.' + this._variablename + '.close();'); this._modaltitle.appendchild(document.createelement('span')); var e = document.createelement('div'); e.style.clear = 'both'; this._modaltitle.appendchild(e); this._modalcontent = document.createelement('div'); m.appendchild(this._modalcontent); if (this.windowcontentcssclasses.length > 0) { this._modalcontent.classname = this.windowcontentcssclasses[0]; for (var i = 1; i < this.windowcontentcssclasses.length; i++) { this._modalcontent.appendchild(document.createelement('div')); this._modalcontent = this._modalcontent.childnodes[0]; this._modalcontent.classname = this.windowcontentcssclasses[i]; } } this._modaliframe = document.createelement('iframe'); this._modaliframe.src = this.loadinghtmlurl; this._modaliframe.width = '100%'; this._modaliframe.border = '0'; this._modaliframe.frameborder = 'no'; this._modaliframe.style.borderleftwidth = '0px'; this._modaliframe.style.borderrightwidth = '0px'; this._modaliframe.style.bordertopwidth = '0px'; this._modaliframe.style.borderbottomwidth = '0px'; this._modalcontent.appendchild(this._modaliframe); this._modalfooter = document.createelement('div'); m.appendchild(this._modalfooter); var mf = this._modalfooter; if (this.windowfootercssclasses.length > 0) { mf.classname = this.windowfootercssclasses[0]; for (var i = 1; i < this.windowfootercssclasses.length; i++) { mf.appendchild(document.createelement('div')); mf = mf.childnodes[0]; mf.classname = this.windowfootercssclasses[i]; } } this._modalresize = document.createelement('div'); mf.appendchild(this._modalresize); var e = document.createelement('div'); e.style.clear = 'both'; mf.appendchild(e); var mr = this._modalresize; if (this.windowresizecssclasses.length > 0) { mr.classname = this.windowresizecssclasses[0]; for (var i = 1; i < this.windowresizecssclasses.length; i++) { mr.appendchild(document.createelement('div')); mr = mr.childnodes[0]; mr.classname = this.windowresizecssclasses[i]; } } this._modalresize.onmousedown = new function('event', 'window.' + this._variablename + '._startresize(event); return false;'); this._modalanimationmask.appendchild(this._modal); document.body.appendchild(this._modalanimationmask); this._initialized = true; } luwei$iframe.dispose = function() { if (this._initialized) { if (this._animationhandle) window.cleartimeout(this._animationhandle); this._isshown = false; this._isopening = false; if (document && document.body) { document.body.removechild(this._modalanimationmask); document.body.removechild(this._modalmask); this._modalclose.onclick = null; this._modaltitle.onmousedown = null; this._modalresize.onmousedown = null; this._modal = null; this._modaltitle = null; this._modalclose = null; this._modalanimationmask = null; this._modalmask = null; this._modaliframe = null; this._modalresize = null; this._modalfooter = null; this._modalcontent = null; } this._initialized = false; } } luwei$iframe._animate = function(targetvalue, nextvalue, step, acceleration) { if (this._animationhandle) window.cleartimeout(this._animationhandle); if (!this._isopening) return; var currvalue = parseint(this._modal.style.top, 10); if ((step < 0 && currvalue < targetvalue) || (step > 0 && currvalue > targetvalue) || math.abs(step) < 1) { // complete if (this._hiddenselects) { for (var i = 0; i < this._hiddenselects.length; i++) this._hiddenselects[i].element.style.visibility = 'hidden'; } this._modal.style.top = targetvalue + 'px'; this._modal.style.position = 'static'; this._modalanimationmask.style.overflow = 'visible'; this._animationhandle = null; if (!this._isresizing && !this._isdragging) this._modaliframe.style.display = 'block'; this._isopening = false; this._lastwindowinfo = this._getwindowinfo(); this._checkforscrollresizehandle = window.settimeout(new function('window.' + this._variablename + '._checkforscrollresize();'), 999); } else { // continue animation this._modal.style.top = nextvalue + 'px'; nextvalue = nextvalue + step; if (step > 0 && nextvalue > targetvalue) nextvalue = targetvalue; else if (step < 0 && nextvalue < targetvalue) nextvalue = targetvalue; step = step * acceleration; this._animationhandle = window.settimeout(new function(this._variablename + '._animate(' + targetvalue + ',' + nextvalue + ',' + step + ',' + acceleration + ');'), 19); } } luwei$iframe._startdrag = function(event) { if (!this._initialized) this._initialize(); if (!event) event = window.event; this._movemodalinfo = new object(); this._movemodalinfo.startmousex = event.pagex ? event.pagex : event.screenx; this._movemodalinfo.startmousey = event.pagey ? event.pagey : event.screeny; this._movemodalinfo.startmodalx = this._lastmodalinfo.x; this._movemodalinfo.startmodaly = this._lastmodalinfo.y; this._movemodalinfo.button = event.button; document.onmouseup = new function('event', 'window.' + this._variablename + '._enddrag(event); return false;'); document.onmousemove = new function('event', 'window.' + this._variablename + '._drag(event); return false;'); this._modaliframe.style.display = 'none'; this._isdragging = true; } luwei$iframe._enddrag = function(event) { if (!this._initialized) this._initialize(); this._isdragging = false; this._movemodalinfo = null; document.onmouseup = null; document.onmousemove = null; this._modaliframe.style.display = 'block'; } luwei$iframe._drag = function(event) { if (!this._initialized) this._initialize(); if (!event) event = window.event; if (event.button != this._movemodalinfo.button) { this._enddrag(event); return; } var eventx = typeof(event.pagex) != 'undefined' ? event.pagex : event.screenx; var eventy = typeof(event.pagey) != 'undefined' ? event.pagey : event.screeny; var xchange = eventx - this._movemodalinfo.startmousex; var ychange = eventy - this._movemodalinfo.startmousey; this.open(null, this._lastmodalinfo.width, this._lastmodalinfo.height, this._lastmodalinfo.onclosefunction, this._movemodalinfo.startmodalx + xchange, this._movemodalinfo.startmodaly + ychange, true); } luwei$iframe._startresize = function(event) { if (!this._initialized) this._initialize(); if (!event) event = window.event; this._resizemodalinfo = new object(); this._resizemodalinfo.startmousex = event.pagex ? event.pagex : event.screenx; this._resizemodalinfo.startmousey = event.pagey ? event.pagey : event.screeny; this._resizemodalinfo.startmodalwidth = this._lastmodalinfo.width; this._resizemodalinfo.startmodalheight = this._lastmodalinfo.height; this._resizemodalinfo.button = event.button; document.onmouseup = new function('event', 'window.' + this._variablename + '._endresize(event); return false;'); document.onmousemove = new function('event', 'window.' + this._variablename + '._resize(event); return false;'); this._modaliframe.style.display = 'none'; this._isresizing = true; } luwei$iframe._endresize = function(event) { if (!this._initialized) this._initialize(); this._isresizing = false; this._resizemodalinfo = null; document.onmouseup = null; document.onmousemove = null; this._modaliframe.style.display = 'block'; } luwei$iframe._resize = function(event) { if (!this._initialized) this._initialize(); if (!event) event = window.event; if (event.button != this._resizemodalinfo.button) { this._endresize(event); return; } var eventx = typeof(event.pagex) != 'undefined' ? event.pagex : event.screenx; var eventy = typeof(event.pagey) != 'undefined' ? event.pagey : event.screeny; var xchange = eventx - this._resizemodalinfo.startmousex; var ychange = eventy - this._resizemodalinfo.startmousey; this.open(null, this._resizemodalinfo.startmodalwidth + xchange, this._resizemodalinfo.startmodalheight + ychange, this._lastmodalinfo.onclosefunction, this._lastmodalinfo.x, this._lastmodalinfo.y, true); } luwei$iframe.configure('/inc/js/openifr_loading.htm',['commonmodal'],['commonmodaltitle'],['commonmodalclose'],['commonmodalcontent'],['commonmodalfooter'],['commonmodalresize'],['commonmodalmask'],100);