Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
functionfindPosition(indx){/* This function is based on code obtained from: http://www.softcomplex.com/docs/ get_window_size_and_scrollbar_position.html */vardir={'clientWidth':'innerWidth','clientHeight':'innerHeight','scrollLeft':'pageXOffset','scrollTop':'pageYOffset'};varqarr=[window[dir[indx]]?window[dir[indx]]:0,document.documentElement?document.documentElement[indx]:0,document.body?document.body[indx]:0];qarr.sort(function(a,b){returna-b});while(qarr[0]==0){qarr.shift()}returnqarr.length?qarr[0]:0;}functionshowFootnote(evnt){vare=window.event?window.event:evnt;varobj=window.event?window.event.srcElement:evnt.target;// Is this link a ref tagif(obj.tagName!="A")return;if(!obj.hash)return;if(obj.hash.substr(0,11)!="#cite_note-")return;if(obj.parentNode.className!="reference")return;// Is there a footnote to display?// Someone may have forgotten the <references/> tagvarfootnote_id=obj.hash.substr(1);if(!document.getElementById(footnote_id))return;// Good, hide the popup, if it isn't already hiddenif(footnote.style.visibility!="hidden"){resetFootnote()}// Fetch the footnote text and remove the unnecessary back link(s)// This is a little messy as there's no containing tagsvarfn_text=document.getElementById(footnote_id).innerHTML;fn_text=fn_text.replace(/^.*<a[^>]*href="#cite_ref-.*?<\/a> */i,"");// "// Insert the footnote textfootnote.innerHTML=fn_text;// Decide where to put the popupvarwindow_width=findPosition('clientWidth');varwindow_height=findPosition('clientHeight');varhorizontal_position=e.clientX;varvertical_position=e.clientY;varhorizontal=findPosition('scrollLeft')+horizontal_position;varvertical=findPosition('scrollTop')+vertical_position;varfootnote_width=footnote.offsetWidth;varfootnote_height=footnote.offsetHeight;if(window_height-vertical_position<footnote_height){footnote.style.top="";footnote.style.bottom=(window_height-vertical-13)+"px";}else{footnote.style.top=(vertical-13)+"px";footnote.style.bottom="";}if(window_width-horizontal_position>footnote_width){footnote.style.left=(horizontal-13)+"px";footnote.style.right="";}else{footnote.style.left="";footnote.style.right=(window_width-horizontal-13)+"px";}//Make the popup visiblefootnote.style.visibility="visible";}functionhideFootnote(evnt){varobj=window.event?window.event.srcElement:evnt.target;// No point in going on if popup is already hiddenif(footnote.style.visibility=="hidden")return;// Search the tree to see where the curser isvardepth=0;// no need to search too muchwhile(obj&&obj.parentNode&&depth<5){if(obj.id=="footnote"||obj.id.substr(0,9)=="cite_ref-"){return;}obj=obj.parentNode;depth++;}resetFootnote();}functionresetFootnote(){footnote.style.visibility="hidden";footnote.style.left=0;footnote.style.top=0;footnote.style.right="auto";footnote.style.bottom="auto";}// Set up the float elementvarfootnote=document.createElement("DIV");footnote.id="footnote";footnote.style.position="absolute";footnote.style.zIndex=500;footnote.style.border="1px solid black";footnote.style.backgroundColor="lightyellow";footnote.style.maxWidth="450px";footnote.style.textAlign="justify";footnote.style.padding="5px";footnote.style.fontSize="10pt";resetFootnote();document.body.appendChild(footnote);// Add events$(document).on("mouseover",showFootnote);$(document).on("mousemove",hideFootnote);