var Browser=new Object();Browser.isMozilla=(typeof document.implementation!="undefined")&&(typeof document.implementation.createDocument!="undefined")&&(typeof HTMLDocument!="undefined");Browser.isIE=window.ActiveXObject?true:false;Browser.isFirefox=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1);Browser.isOpera=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);if(Browser.isMozilla){HTMLElement.prototype.removeNode=function(){this.parentNode.removeChild(this)}}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function AddFavorite(b,a){try{window.external.addFavorite(b,a)}catch(c){try{window.sidebar.addPanel(a,b,"")}catch(c){window.alert("\u52a0\u5165\u6536\u85cf\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528Ctrl+D\u8fdb\u884c\u6dfb\u52a0")}}}function SetHome(c,d){try{c.style.behavior="url(#default#homepage)";c.setHomePage(d)}catch(b){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(b){alert("\u6b64\u64cd\u4f5c\u88ab\u6d4f\u89c8\u5668\u62d2\u7edd\uff01\n\u8bf7\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u201cabout:config\u201d\u5e76\u56de\u8f66\n\u7136\u540e\u5c06 [signed.applets.codebase_principal_support]\u7684\u503c\u8bbe\u7f6e\u4e3a'true',\u53cc\u51fb\u5373\u53ef\u3002")}var a=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);a.setCharPref("browser.startup.homepage",d)}}}function UrlEncode(a){return transform(a)}function transform(d){var e="";var c,a,b;a=0;for(c=0;c<d.length;c++){b=hexfromdec(d.charCodeAt(c));if(b=="25"){b=""}e+="%"+b}return e}function hexfromdec(a){if(a>65535){return("err!")}first=Math.round(a/4096-0.5);temp1=a-first*4096;second=Math.round(temp1/256-0.5);temp2=temp1-second*256;third=Math.round(temp2/16-0.5);fourth=temp2-third*16;return(""+getletter(third)+getletter(fourth))}function getletter(a){if(a<10){return a}else{if(a==10){return"A"}if(a==11){return"B"}if(a==12){return"C"}if(a==13){return"D"}if(a==14){return"E"}if(a==15){return"F"}}}String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};function checkSqlStr(e){var d="|and|exec|insert|select|delete|update|count|*|chr|mid|master|truncate|char|declare|set|;|from";var c=d.split("|");var a;for(var b=0;b<c.length;b++){a=e.indexOf(c[b]);if(a!=-1){e=e.replace(c[b],"")}}return e}function checkScriptStr(e){var a=true;var b="<|>|script|alert|{|}|(|)|#|$|'|\"|:|;|&|*|@|%|^|?";var d=b.split("|");for(var c=0;c<d.length;c++){if(e.indexOf(d[c])!=-1){a=false;break}}return a}function initSorts(){var a=document.getElementById("allsorts").getElementsByTagName("div");for(i=0;i<a.length;i++){var c=a[i].getAttribute("drop");if(c&&document.getElementById(c)){var b=document.getElementById(c);a[i].menu=b;a[i].onmouseover=function(d){this.menu.style.left=(findPosX(this))+"px";this.menu.style.top=(findPosY(this)+this.offsetHeight-1)+"px";this.menu.style.display="block"};a[i].onmouseout=function(d){this.menu.style.display="none"};b.onmouseover=function(d){this.style.display="block"};b.onmouseout=function(d){this.style.display="none"}}}};

