GD.getScreen=function(){return{width:Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth),height:Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight)};};GD.getMsCoord=function(a){a=a||window.event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY};}return{x:(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};};GD.dom={isAncestor:function(b,a){if(!b||!a){return false;}if(b.contains&&a.nodeType&&!GD.Browser.isSafari&&!GD.Browser.isChrome){return b.contains(a)&&b!=a;}if(b.compareDocumentPosition&&a.nodeType){return !!(b.compareDocumentPosition(a)&16);}else{if(a.nodeType){return !!this.getAncestorBy(a,function(c){return c==b;});}}return false;},getAncestorBy:function(a,b){while(a=a.parentNode){if(a&&a.nodeType==1&&(!b||b(a))){return a;}}return null;},getStyle:function(b,f){b=GD$(b);if(!b||b.nodeType==9){return false;}var a=document.defaultView&&document.defaultView.getComputedStyle;var c=!a?null:document.defaultView.getComputedStyle(b,"");var d="";switch(f){case"float":f=a?"cssFloat":"styleFloat";break;case"opacity":if(!a){var h=100;try{h=b.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(g){try{h=b.filters("alpha").opacity;}catch(g){}}return h/100;}break;case"backgroundPositionX":if(a){f="backgroundPosition";return((c||b.style)[f]).split(" ")[0];}break;case"backgroundPositionY":if(a){f="backgroundPosition";return((c||b.style)[f]).split(" ")[1];}break;}if(a){return(c||b.style)[f];}else{return(b.currentStyle[f]||b.style[f]);}},setStyle:function(d,f,e){d=GD$(d);if(!d||d.nodeType==9){return false;}var c=document.defaultView&&document.defaultView.getComputedStyle;switch(f){case"float":f=c?"cssFloat":"styleFloat";case"opacity":if(!c){if(e>=1){d.style.filter="";return;}d.style.filter="alpha(opacity="+(e*100)+")";return true;}else{d.style[f]=e;return true;}break;case"backgroundPositionX":if(c){var a=GD.dom.getStyle(d,"backgroundPositionY");d.style.backgroundPosition=e+" "+(a||"top");}else{d.style[f]=e;}break;case"backgroundPositionY":if(c){var b=GD.dom.getStyle(d,"backgroundPositionX");d.style.backgroundPosition=(b||"left")+" "+e;}else{d.style[f]=e;}break;default:if(typeof d.style[f]=="undefined"){return false;}d.style[f]=e;return true;}},getPosition:function(b){var c=GD.dom.getXY(b),a=GD.dom.getSize(b);return{left:c[0],top:c[1],width:a[0],height:a[1],x:c[0],y:c[1],w:a[0],h:a[1]};},setPosition:function(a,b){GD.dom.setXY(a,b.left,b.top);GD.dom.setSize(a,b.width,b.height);},getXY:function(d,g){var f=0,c=0;g=g||document;if(d){if(g.documentElement.getBoundingClientRect&&d.getBoundingClientRect){var e=d.getBoundingClientRect(),b=d.ownerDocument,a=isIE?2:0;f=e.top-a+GD.dom.getScrollTop(b);c=e.left-a+GD.dom.getScrollLeft(b);}else{while(d.offsetParent){f+=d.offsetTop;c+=d.offsetLeft;d=d.offsetParent;}}}return[c,f];},setXY:function(c,a,e){var b=parseInt(this.getStyle(c,"marginLeft"))||0;var d=parseInt(this.getStyle(c,"marginTop"))||0;this.setStyle(c,"left",parseInt(a)-b+"px");this.setStyle(c,"top",parseInt(e)-d+"px");},getSize:function(e){var a=[0,0];var f=["Left","Right","Top","Bottom"];for(var d in f){var b=f[d];a[b=="Left"||b=="Right"?0:1]+=(parseInt(GD.dom.getStyle(e,"border"+b+"Width"),10)||0)+(parseInt(GD.dom.getStyle(e,"padding"+b),10)||0);}var c=e.offsetWidth-a[0];var g=e.offsetHeight-a[1];return[c,g];},setSize:function(e,d,b){var a=/\d+([a-z%]+)/i.exec(d);a=a?a[1]:"";var c=/\d+([a-z%]+)/i.exec(b);c=c?c[1]:"";this.setStyle(e,"width",(typeof d!="number"||d<0||/auto/i.test(d))?"auto":(parseInt(d)+(a||"px")));this.setStyle(e,"height",(typeof b!="number"||b<0||/auto/i.test(b))?"auto":(parseInt(b)+(c||"px")));},getScrollLeft:function(a){a=a||document;return Math.max(a.documentElement.scrollLeft,a.body.scrollLeft);},getScrollTop:function(a){a=a||document;return Math.max(a.documentElement.scrollTop,a.body.scrollTop);},getScrollHeight:function(a){a=a||document;return Math.max(a.documentElement.scrollHeight,a.body.scrollHeight);},getScrollWidth:function(a){a=a||document;return Math.max(a.documentElement.scrollWidth,a.body.scrollWidth);},setScrollLeft:function(a,b){b=b||document;b[b.compatMode=="CSS1Compat"&&!GD.Browser.isSafari&&!GD.Browser.isChrome?"documentElement":"body"].scrollLeft=a;},setScrollTop:function(a,b){b=b||document;b[b.compatMode=="CSS1Compat"&&!GD.Browser.isSafari&&!GD.Browser.isChrome?"documentElement":"body"].scrollTop=a;},getClientHeight:function(a){a=a||document;return a.compatMode=="CSS1Compat"?a.documentElement.clientHeight:a.body.clientHeight;},getClientWidth:function(a){a=a||document;return a.compatMode=="CSS1Compat"?a.documentElement.clientWidth:a.body.clientWidth;},getDocumentWindow:function(a){_doc=a||document;return _doc.parentWindow||_doc.defaultView;}};GD.getDomCoord=GD.dom.getPosition;GD.domSort={getFirstChild:function(a){if(!a){return null;}var b=!!a.firstChild&&a.firstChild.nodeType==1?a.firstChild:null;return b||this.getNextSibling(a.firstChild);},getNextSibling:function(a){if(!a){return null;}while(a){a=a.nextSibling;if(!!a&&a.nodeType==1){return a;}}return null;},getPreviousSibling:function(a){if(!a){return null;}while(a){a=a.previousSibling;if(!!a&&a.nodeType==1){return a;}}return null;},swapNode:function(b,a){if(b.swapNode){b.swapNode(a);}else{var d=a.parentNode;var c=a.nextSibling;if(c==b){d.insertBefore(b,a);}else{if(a==b.nextSibling){d.insertBefore(a,b);}else{b.parentNode.replaceChild(a,b);d.insertBefore(b,c);}}}},get:function(a){return typeof a=="string"?document.getElementById(a):(a.jquery?a.get(0):a);},getAllChilds:function(){var c=child.parentNode;var b=[];for(var a=0;a<c.childNodes.length;a+=1){if(c.childNodes[a].nodeType==1){b.push(c.childNodes[a]);}}return b;},$first:function(){alert("已经是第一个了,不能再进行上移了");},$last:function(){alert("已经是最后一个了,不能再进行下移了");},up:function(a,d){var c=this.get(a);var b=this.getPreviousSibling(c);if(!b){this.$first();}else{this.swapNode(b,c);if(d||d==""){c.className=d;}}return c;},down:function(a,d){var c=this.get(a);var b=this.getNextSibling(c);if(!b){this.$last();}else{this.swapNode(c,b);if(d||d==""){c.className=d;}}return c;},del:function(a){var c=this.get(a);var b=c.parentNode;b.removeChild(c);}};GD.toXML=function(k){var c;if(window.ActiveXObject){c=new ActiveXObject("Microsoft.XMLDOM");}else{try{c=document.implementation.createDocument("text/xml","",null);}catch(f){return null;}}if(window.ActiveXObject){var h=c.loadXML(k);if(h){return c;}else{return null;}}else{try{var m=c.childNodes;for(var d=m.length-1;d>=0;d--){c.removeChild(m[d]);}var b=new DOMParser();var l=b.parseFromString(k,"text/xml");var a=c.importNode(l.documentElement,true);c.appendChild(a);return c;}catch(g){return null;}}};if(!window.ActiveXObject){try{var ex;XMLDocument.prototype.__proto__.__defineGetter__("xml",function(){try{return new XMLSerializer().serializeToString(this);}catch(a){var b=document.createElement("div");b.appendChild(this.cloneNode(true));return b.innerHTML;}});Element.prototype.__proto__.__defineGetter__("xml",function(){try{return new XMLSerializer().serializeToString(this);}catch(a){var b=document.createElement("div");b.appendChild(this.cloneNode(true));return b.innerHTML;}});XMLDocument.prototype.__proto__.__defineGetter__("text",function(){return this.firstChild.textContent;});Element.prototype.__proto__.__defineGetter__("text",function(){return this.textContent;});if(document.implementation&&document.implementation.createDocument){XMLDocument.prototype.loadXML=function(e){try{var f=this.childNodes;for(var c=f.length-1;c>=0;c--){this.removeChild(f[c]);}var g=new DOMParser();var b=g.parseFromString(e,"text/xml");var d=this.importNode(b.documentElement,true);this.appendChild(d);return true;}catch(a){return false;}};if(document.implementation.hasFeature("XPath","3.0")){XMLDocument.prototype.selectNodes=function(d,e){if(!e){e=this;}var b=this.createNSResolver(this.documentElement);var a=this.evaluate(d,e,b,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=[];for(var c=0;c<a.snapshotLength;c++){f[c]=a.snapshotItem(c);}return f;};Element.prototype.selectNodes=function(a){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(a,this);}else{throw"For XML Elements Only";}};}if(document.implementation.hasFeature("XPath","3.0")){XMLDocument.prototype.selectSingleNode=function(b,c){if(!c){c=this;}var a=this.selectNodes(b,c);if(a.length>0){return a[0];}else{return null;}};Element.prototype.selectSingleNode=function(a){if(this.ownerDocument.selectSingleNode){return this.ownerDocument.selectSingleNode(a,this);}else{throw"For XML Elements Only";}};}}}catch(ex){}}GD.xml2EnumObj=function(g,c){if(!g){return{};}var e=(c?g.selectNodes(".//@*"):g.attributes)||[];var d=(c?g.selectNodes(".//*"):g.childNodes)||[];var b={};for(var f=0;f<e.length;f++){var a=e[f];b[a.nodeName]=a.nodeValue;}for(var f=0;f<d.length;f++){var h=d[f];b[h.nodeName]=h.text;}return b;};GD.xml2JSON=function(c){if(!c){return{};}if(c&&c.length){var d={};for(var b=0;b<c.length;b+=1){if(GD.isArray(d[c[b].nodeName])){d[c[b].nodeName].push(arguments.callee(c[b]));}else{if(d[c[b].nodeName]){d[c[b].nodeName]=[d[c[b].nodeName],arguments.callee(c[b])];}else{d[c[b].nodeName]=arguments.callee(c[b]);}}}return d;}else{c=c.documentElement||c;var a=c.selectNodes("*");var e=c.selectNodes("@*");var d={};for(j=0;j<e.length;j+=1){d["$"+e[j].nodeName]=e[j].nodeValue;}if(a.length==0){if(c.text!=""){d.$_=c.text;}}else{GD.$extend(d,arguments.callee(a));}return d;}};GD.checkXML=function(b){if(b&&b.firstChild){var a=b.documentElement||b;if(!a.getAttribute("code")||a.getAttribute("code")=="0"){return true;}else{var c=a.selectSingleNode("./*");if(c){return{code:a.getAttribute("code"),msg:(c.text||a.selectNodes("//msg")[0].text)||"未知错误，请稍后再试..."};}else{return{code:"",msg:""};}}}else{return{code:-1,msg:"连接服务器失败"};}};GD.createElement=function(d,n,l,a,c){var h=null;if(!c){c=GD.createElement.bindRefCache;}GD.createElement.level++;if(d=="input"&&isIE){var o="<"+d;if(n.name){o+=" name="+n.name;}if(n.type){o+=" type="+n.type;}if(n.hideFocus){o+=" hideFocus="+n.type;}o+=">";h=document.createElement(o);}else{h=document.createElement(d);}for(var p in n){var m=n[p];if(typeof(m)=="object"){if(p=="style"){for(var e in m){h.style[e]=m[e].replace(/;$/,"");}}else{h[p]=m;}}else{var b=new RegExp("\\b"+p+"\\b","i");if(typeof(m)=="string"&&(!GD.createElement.filter.match(b))){h.setAttribute(p,m);}else{h[p]=m;}if(m&&(GD.createElement.extra.match(b))){switch(p){case"text":h.appendChild(document.createTextNode(m));break;case"ref":break;default:break;}}}}if(l){if(l instanceof Array){for(var g=0;g<l.length;g++){if(l[g]&&(l[g].nodeType==1||l[g].nodeType==3)){h.appendChild(l[g]);}else{var f=GD.createElement(l[g][0],l[g][1],l[g][2],h,c);if(l[g][1]&&l[g][1]["ref"]&&c){c[l[g][1]["ref"]]=f;}delete f;}}}else{l.appendChild(h);}}if(a){a.appendChild(h);}GD.createElement.level--;if(GD.createElement.level<1){h.refs={};for(var k in GD.createElement.bindRefCache){h.refs[k]=GD.createElement.bindRefCache[k];}GD.createElement.bindRefCache={};}return h;};GD.createElement.filter="className, innerHTML, textContent";GD.createElement.extra="text, ref";GD.createElement.bindRefCache={};GD.createElement.level=0;GD.clearChildNodes=function(d){while(d.lastChild){var a=d.removeChild(d.lastChild);if(a.refs){for(var c in a.refs){if(a.refs[c].parentNode){var b=a.refs[c].parentNode.removeChild(a.refs[c]);if(typeof jQuery!="undefined"){jQuery(b).empty();}delete b;delete a.refs[c];}}}delete a;}};GD.runBox=function(h,f,b,d,c,i,g){g=g||{left:0,top:0};if(!h||!f){return false;}if(GD.isFunction(b)){b();}var e=GD.$CE("div");e.style.border="3px solid #999";e.style.left=GD.getDomCoord(h.parent().get(0)).left+parseInt(h.get(0).style.left,10)+(g.left||0)+"px";e.style.top=parseInt(h.get(0).style.top,10)+(g.top||0)+"px";e.style.width=h.width()+"px";e.style.height=h.height()+"px";e.style.position="absolute";document.body.appendChild(e);e=$(e);var a=f.offset();if(!jQuery.easing.backEaseIn){e.animate({left:a.left,top:a.top,width:f.width(),height:f.height()},{queue:true,duration:(c||500),easing:(i||"backEaseIn"),complete:function(){e.remove();if(GD.isFunction(d)){d();}}});}else{e.animate({left:a.left,top:a.top,width:f.width(),height:f.height()},c||500,function(){e.remove();if(GD.isFunction(d)){d();}});}f.get(0).source=h;};