function addOnloadHook(e){if(!doneOnloadHook){onloadFuncts[onloadFuncts.length]=e}else{e()}}function hookEvent(e,t){addHandler(window,e,t)}function importScriptURI(e){if(loadedScripts[e]){return null}loadedScripts[e]=true;var t=document.createElement("script");t.setAttribute("src",e);t.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(t);return t}function showTocToggle(){if(document.createTextNode){var e=document.getElementById("toctitle");var t=document.getElementById("togglelink");if(!e||t){return}var n=document.createElement("span");n.className="toctoggle";var r=document.createElement("a");r.id="togglelink";r.className="internal";r.href="javascript:toggleToc()";r.appendChild(document.createTextNode(tocHideText));n.appendChild(document.createTextNode("["));n.appendChild(r);n.appendChild(document.createTextNode("]"));e.appendChild(document.createTextNode(" "));e.appendChild(n);var i=document.cookie.indexOf("hidetoc=");if(i>-1&&document.cookie.charAt(i+8)==1){toggleToc()}}}function changeText(e,t){if(e.innerText){e.innerText=t}else if(e.firstChild&&e.firstChild.nodeValue){e.firstChild.nodeValue=t}}function toggleToc(){var e=document.getElementById("toc");var t=document.getElementById("toc").getElementsByTagName("ul")[0];var n=document.getElementById("togglelink");if(t&&n&&t.style.display=="none"){changeText(n,tocHideText);t.style.display="block";document.cookie="hidetoc=0";e.className="toc"}else{changeText(n,tocShowText);t.style.display="none";document.cookie="hidetoc=1";e.className="toc tochidden"}}function updateTooltipAccessKeys(e){if(!e){var t=["column-one","mw-head","mw-panel","p-logo"];for(var n in t){var r=document.getElementById(t[n]);if(r){updateTooltipAccessKeys(r.getElementsByTagName("a"))}}updateTooltipAccessKeys(document.getElementsByTagName("input"));updateTooltipAccessKeys(document.getElementsByTagName("label"));return}for(var n=0;ne.length){n=e.length}for(var r=t;rn&&typeof checkboxes[i].onchange=="function"){checkboxes[i].onchange()}}lastCheckbox=this.index;return true}function getElementsByClassName(e,t,n){var r=new Array;if(typeof e.getElementsByClassName=="function"){var i=e.getElementsByClassName(n);if(t=="*"){return i}for(var s=0;s"}}else{alert("bad target for sajax_do_call: not a function or object: "+n)}return};sajax_debug(e+" uri = "+o+" / post = "+u);i.send(u);sajax_debug(e+" waiting..");delete i;return true}function wfSupportsAjax(){var e=sajax_init_object();var t=e?true:false;delete e;return t}function os_Timer(e,t,n){this.id=e;this.r=t;this.query=n}function os_Results(e,t){this.searchform=t;this.searchbox=e;this.container=e+"Suggest";this.resultTable=e+"Result";this.resultText=e+"ResultText";this.toggle=e+"Toggle";this.query=null;this.results=null;this.resultCount=0;this.original=null;this.selected=-1;this.containerCount=0;this.containerRow=0;this.containerTotal=0;this.visible=false;this.stayHidden=false}function os_AnimationTimer(e,t){this.r=e;var n=document.getElementById(e.container).offsetWidth;this.inc=Math.round((t-n)/os_animation_steps);if(this.inc=0){this.inc=os_animation_min_step}if(this.inc>-os_animation_min_step&&this.inc<0){this.inc=-os_animation_min_step}this.target=t}function os_MWSuggestInit(){for(i=0;i文中包含:
'+query);os_setupDiv(r,p[1])}catch(e){os_hideResults(r);os_cache[cacheKey]=null}}}function os_getNamespaces(e){var t="";var n=document.forms[e.searchform].elements;for(i=0;i2&&r[0]=="n"&&r[1]=="s"&&(n[i].type=="checkbox"&&n[i].checked||n[i].type=="hidden"&&n[i].value=="1")){if(t!=""){t+="|"}t+=r.substring(2)}}if(t==""){t=wgSearchNamespaces.join("|")}return t}function os_updateIfRelevant(e,t,n,r){var i=document.getElementById(e.searchbox);if(i!=null&&i.value==t){os_updateResults(e,t,n,r)}e.query=t}function os_delayedFetch(){if(os_timer==null){return}var e=os_timer.r;var t=os_timer.query;os_timer=null;var n=wgMWSuggestTemplate.replace("{namespaces}",os_getNamespaces(e)).replace("{dbname}",wgDBname).replace("{searchTerms}",os_encodeQuery(t));var r=os_cache[n];if(r!=null&&r!=undefined){os_updateIfRelevant(e,t,r,n)}else{var i=sajax_init_object();if(i){try{i.open("GET",n,true);i.onreadystatechange=function(){if(i.readyState==4&&typeof os_updateIfRelevant=="function"){os_updateIfRelevant(e,t,i.responseText,n)}};i.send(null)}catch(s){if(window.location.hostname=="localhost"){alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.")}throw s}}}}function os_fetchResults(e,t,n){if(t==""){e.query="";os_hideResults(e);return}else if(t==e.query){return}os_is_stopped=false;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id)}if(n!=0){os_timer=new os_Timer(setTimeout("os_delayedFetch()",n),e,t)}else{os_timer=new os_Timer(null,e,t);os_delayedFetch()}}function os_getTarget(e){if(!e){e=window.event}if(e.target){return e.target}else if(e.srcElement){return e.srcElement}else{return null}}function os_isNumber(e){if(e==""||isNaN(e)){return false}for(var t=0;t="0"&&n<="9")){return false}}return true}function os_enableSuggestionsOn(e,t){os_initHandlers(e,t,document.getElementById(e))}function os_disableSuggestionsOn(e){r=os_map[e];if(r!=null){os_timer=null;os_hideResults(r);document.getElementById(e).setAttribute("autocomplete","on");os_map[e]=null}var t=os_autoload_inputs.indexOf(e);if(t>=0){os_autoload_inputs[t]=os_autoload_forms[t]=""}}function os_eventBlur(e){var t=os_getTarget(e);var n=os_map[t.id];if(n==null){return}if(!os_mouse_pressed){os_hideResults(n);n.stayHidden=true;if(os_timer!=null&&os_timer.id!=null){clearTimeout(os_timer.id)}os_timer=null}}function os_eventFocus(e){var t=os_getTarget(e);var n=os_map[t.id];if(n==null){return}n.stayHidden=false}function os_setupDiv(e,t){var n=document.getElementById(e.container);if(n==null){n=os_createContainer(e)}n.innerHTML=os_createResultTable(e,t);var r=document.getElementById(e.resultTable);e.containerTotal=r.offsetHeight;e.containerRow=r.offsetHeight/e.resultCount;os_fitContainer(e);os_trimResultText(e);os_showResults(e)}function os_createResultTable(e,t){var n=document.getElementById(e.container);var r=n.offsetWidth-os_operaWidthFix(n.offsetWidth);var s='';e.results=new Array;e.resultCount=t.length;for(i=0;i"}s+="
'+o+"
";return s}function os_showResults(e){if(os_is_stopped){return}if(e.stayHidden){return}os_fitContainer(e);var t=document.getElementById(e.container);e.selected=-1;if(t!=null){t.scrollTop=0;t.style.visibility="visible";e.visible=true}}function os_operaWidthFix(e){if(typeof document.body.style.overflowX!="string"){return 30}return 0}function f_clientWidth(){return f_filterResults(window.innerWidth?window.innerWidth:0,document.documentElement?document.documentElement.clientWidth:0,document.body?document.body.clientWidth:0)}function f_clientHeight(){return f_filterResults(window.innerHeight?window.innerHeight:0,document.documentElement?document.documentElement.clientHeight:0,document.body?document.body.clientHeight:0)}function f_scrollLeft(){return f_filterResults(window.pageXOffset?window.pageXOffset:0,document.documentElement?document.documentElement.scrollLeft:0,document.body?document.body.scrollLeft:0)}function f_scrollTop(){return f_filterResults(window.pageYOffset?window.pageYOffset:0,document.documentElement?document.documentElement.scrollTop:0,document.body?document.body.scrollTop:0)}function f_filterResults(e,t,n){var r=e?e:0;if(t&&(!r||r>t)){r=t}return n&&(!r||r>n)?n:r}function os_availableHeight(e){var t=document.getElementById(e.container).style.top;var n=t.lastIndexOf("px");if(n>0){t=t.substring(0,n)}return f_clientHeight()-(t-f_scrollTop())}function os_getElementPosition(e){var t=document.getElementById(e);var n=0;var r=0;while(t){n+=t.offsetLeft;r+=t.offsetTop;t=t.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){n+=document.body.leftMargin;r+=document.body.topMargin}return{left:n,top:r}}function os_createContainer(e){var t=document.createElement("div");var n=document.getElementById(e.searchbox);var r=os_getElementPosition(e.searchbox);var i=r.left;var s=r.top+n.offsetHeight;t.className="os-suggest";t.setAttribute("id",e.container);document.body.appendChild(t);t=document.getElementById(e.container);t.style.top=s+"px";t.style.left=i+"px";t.style.width=n.offsetWidth+"px";t.onmouseover=function(t){os_eventMouseover(e.searchbox,t)};t.onmousemove=function(t){os_eventMousemove(e.searchbox,t)};t.onmousedown=function(t){return os_eventMousedown(e.searchbox,t)};t.onmouseup=function(t){os_eventMouseup(e.searchbox,t)};return t}function os_fitContainer(e){var t=document.getElementById(e.container);var n=os_availableHeight(e)-20;var r=e.containerRow;n=parseInt(n/r)*r;if(n<2*r&&e.resultCount>1){n=2*r}if(n/r>os_max_lines_per_suggest){n=r*os_max_lines_per_suggest}if(nt){t=r.offsetWidth}}var i=document.getElementById(e.container).offsetWidth;var s=0;if(e.containerCountos_container_max_width){u=os_container_max_width}else if(u<1){u=1}var a=Math.round(o*u);if(i!=a){i=a;if(os_animation_timer!=null){clearInterval(os_animation_timer.id)}os_animation_timer=new os_AnimationTimer(e,i);os_animation_timer.id=setInterval("os_animateChangeWidth()",os_animation_delay);i-=s}if(i<10){return}for(var n=0;ni&&(r.offsetWidth0&&u>=o||s<=0&&u<=o){t.style.width=o+"px";clearInterval(os_animation_timer.id);os_animation_timer=null}else{t.style.width=u+"px";if(document.documentElement.dir=="rtl"){t.style.left=i+r+(o-u)-os_animation_timer.target-1+"px"}}}function os_changeHighlight(e,t,n,r){if(n>=e.resultCount){n=e.resultCount-1}if(n<-1){n=-1}e.selected=n;if(t==n){return}if(t>=0){var i=document.getElementById(e.resultTable+t);if(i!=null){i.className="os-suggest-result"}}var s;if(n>=0){var o=document.getElementById(e.resultTable+n);if(o!=null){o.className=os_HighlightClass()}s=e.results[n]}else{s=e.original}if(e.containerCount=f){u.scrollTop=(n-e.containerCount+1)*e.containerRow}}if(r){os_updateSearchQuery(e,s)}}function os_HighlightClass(){var e=navigator.userAgent.match(/AppleWebKit\/(\d+)/);if(e){var t=parseInt(e[1]);if(t<523){return"os-suggest-result-hl-webkit"}}return"os-suggest-result-hl"}function os_updateSearchQuery(e,t){document.getElementById(e.searchbox).value=t;e.query=t}function os_eventMouseover(e,t){var n=os_getTarget(t);var r=os_map[e];if(r==null||!os_mouse_moved){return}var i=os_getNumberSuffix(n.id);if(i>=0){os_changeHighlight(r,r.selected,i,false)}}function os_getNumberSuffix(e){var t=e.substring(e.length-2);if(!(t.charAt(0)>="0"&&t.charAt(0)<="9")){t=t.substring(1)}if(os_isNumber(t)){return parseInt(t)}else{return-1}}function os_eventMousemove(e,t){os_mouse_moved=true}function os_eventMousedown(e,t){var n=os_getTarget(t);var r=os_map[e];if(r==null){return}var i=os_getNumberSuffix(n.id);os_mouse_pressed=true;if(i>=0){os_mouse_num=i}document.getElementById(r.searchbox).focus();return false}function os_eventMouseup(e,t){var n=os_getTarget(t);var r=os_map[e];if(r==null){return}var i=os_getNumberSuffix(n.id);if(i>=0&&os_mouse_num==i){os_updateSearchQuery(r,r.results[i]);os_hideResults(r);document.getElementById(r.searchform).submit()}os_mouse_pressed=false;document.getElementById(r.searchbox).focus()}function os_createToggle(e,t){var n=document.createElement("span");n.className=t;n.setAttribute("id",e.toggle);var r=document.createElement("a");r.setAttribute("href","javascript:void(0);");r.onclick=function(){os_toggle(e.searchbox,e.searchform)};var i=document.createTextNode(wgMWSuggestMessages[0]);r.appendChild(i);n.appendChild(r);return n}function os_toggle(e,t){r=os_map[e];var n="";if(r==null){os_enableSuggestionsOn(e,t);r=os_map[e];n=wgMWSuggestMessages[0]}else{os_disableSuggestionsOn(e,t);n=wgMWSuggestMessages[1]}var i=document.getElementById(r.toggle).firstChild;i.replaceChild(document.createTextNode(n),i.firstChild)}var clientPC=navigator.userAgent.toLowerCase();var is_gecko=/gecko/.test(clientPC)&&!/khtml|spoofer|netscape\/7\.0/.test(clientPC);var webkit_match=clientPC.match(/applewebkit\/(\d+)/);if(webkit_match){var is_safari=clientPC.indexOf("applewebkit")!=-1&&clientPC.indexOf("spoofer")==-1;var is_safari_win=is_safari&&clientPC.indexOf("windows")!=-1;var webkit_version=parseInt(webkit_match[1])}var is_ff2=/firefox\/[2-9]|minefield\/3/.test(clientPC);var ff2_bugs=/firefox\/2/.test(clientPC);var is_ff2_win=is_ff2&&clientPC.indexOf("windows")!=-1;var is_ff2_x11=is_ff2&&clientPC.indexOf("x11")!=-1;if(clientPC.indexOf("opera")!=-1){var is_opera=true;var is_opera_preseven=window.opera&&!document.childNodes;var is_opera_seven=window.opera&&document.childNodes;var is_opera_95=/opera\/(9\.[5-9]|[1-9][0-9])/.test(clientPC);var opera6_bugs=is_opera_preseven;var opera7_bugs=is_opera_seven&&!is_opera_95;var opera95_bugs=/opera\/(9\.5)/.test(clientPC)}var ie6_bugs=false;if(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(clientPC)!=null&&parseFloat(RegExp.$1)<=6){ie6_bugs=true}var doneOnloadHook;if(!window.onloadFuncts){var onloadFuncts=[]}var loadedScripts={};var mwEditButtons=[];var mwCustomEditButtons=[];var tooltipAccessKeyPrefix="alt-";if(is_opera){tooltipAccessKeyPrefix="shift-esc-"}else if(!is_safari_win&&is_safari&&webkit_version>526){tooltipAccessKeyPrefix="ctrl-alt-"}else if(!is_safari_win&&(is_safari||clientPC.indexOf("mac")!=-1||clientPC.indexOf("konqueror")!=-1)){tooltipAccessKeyPrefix="ctrl-"}else if(is_ff2){tooltipAccessKeyPrefix="alt-shift-"}var tooltipAccessKeyRegexp=/\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;window.ta=[];var checkboxes;var lastCheckbox;hookEvent("load",runOnloadHook);if(ie6_bugs){importScriptURI(stylepath+"/common/IEFixes.js")}mw={};var sajax_debug_mode=false;var sajax_request_type="GET";var os_map={};var os_cache={};var os_cur_keypressed=0;var os_keypressed_count=0;var os_timer=null;var os_mouse_pressed=false;var os_mouse_num=-1;var os_mouse_moved=false;var os_search_timeout=250;var os_autoload_inputs=new Array("searchInput","searchInput2","powerSearchText","searchText");var os_autoload_forms=new Array("searchform","searchform2","powersearch","search");var os_is_stopped=false;var os_max_lines_per_suggest=7;var os_animation_steps=6;var os_animation_min_step=2;var os_animation_delay=30;var os_container_max_width=2;var os_animation_timer=null;hookEvent("load",os_MWSuggestInit)