var maxmatches;var matchpos;function windowheight(){var A=0;if(typeof (window.innerHeight)=="number"){A=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){A=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){A=document.body.clientHeight}}}return A}function findPos(B){var C=0;var A=0;if(B.offsetParent){C=B.offsetLeft;A=B.offsetTop;while((B=B.offsetParent)){C+=B.offsetLeft;A+=B.offsetTop}}return[C,A]}function movetotarget(A){var D=findPos(A);var C=D[0];var B=D[1]-(windowheight()/2)+35;window.scrollTo(C,B);document.getElementById("content").scrollLeft=C;document.getElementById("content").scrollTop=B}function matchnext(){var A;if(typeof (matchpos)=="undefined"){matchpos=0}else{A=document.getElementById("matchlink"+matchpos);A.className="";A=document.getElementById("matchlocation"+matchpos);A.className="highlight"}matchpos++;if(matchpos>maxmatches){matchpos=maxmatches}A=document.getElementById("matchlink"+matchpos);A.className="resultspagerselected";A=document.getElementById("matchlocation"+matchpos);A.className="viewingmatch";movetotarget(A)}function matchprev(){var A;if(typeof (matchpos)=="undefined"){matchpos=maxmatches+1}else{A=document.getElementById("matchlink"+matchpos);A.className="";A=document.getElementById("matchlocation"+matchpos);A.className="highlight"}matchpos--;if(matchpos<1){matchpos=1}A=document.getElementById("matchlink"+matchpos);A.className="resultspagerselected";A=document.getElementById("matchlocation"+matchpos);A.className="viewingmatch";movetotarget(A)}function matchrepos(B){if((B>0)&&(B<=maxmatches)){var A;if(typeof (matchpos)!="undefined"){A=document.getElementById("matchlink"+matchpos);A.className="";A=document.getElementById("matchlocation"+matchpos);A.className="highlight"}matchpos=B;A=document.getElementById("matchlink"+matchpos);A.className="resultspagerselected";A=document.getElementById("matchlocation"+matchpos);A.className="viewingmatch";movetotarget(A)}}function matchtop(){var A;if(typeof (matchpos)!="undefined"){A=document.getElementById("matchlink"+matchpos);A.className="";A=document.getElementById("matchlocation"+matchpos);A.className="highlight";matchpos=undefined}A=document.getElementById("documenttop");movetotarget(A)}function matchbottom(){var A;if(typeof (matchpos)!="undefined"){A=document.getElementById("matchlink"+matchpos);A.className="";A=document.getElementById("matchlocation"+matchpos);A.className="highlight";matchpos=undefined}A=document.getElementById("documentbottom");movetotarget(A)}function matchpageload(B){maxmatches=B;if(location.hash!==""){var A=/match(\d+)/;var C;if((C=A.exec(location.hash))){var E=C[1];if((E>0)&&(E<=maxmatches)){matchpos=E;var D;D=document.getElementById("matchlink"+matchpos);D.className="resultspagerselected";D=document.getElementById("matchlocation"+matchpos);D.className="viewingmatch"}}}}function clearsearch(){document.forms[0].word.value="";document.forms[0].author.value="";document.forms[0].gender.options[0].selected=true;document.forms[0].region.options[0].selected=true;document.forms[0].spoken.checked=true;document.forms[0].written.checked=true;document.forms[0].title.value="";document.forms[0].yearfrom.value="";document.forms[0].yearto.value=""}function contentfocus(){content.focus()}function toggle(A){var C=document.getElementById(A);var B=document.getElementById("x"+A);if(C.className=="hide"){C.className="metadatasection";B.className="contract"}else{C.className="hide";B.className="expand"}}var sfHover=function(){var B=document.getElementById("nav").getElementsByTagName("LI");for(var A=0;A<B.length;A++){B[A].onmouseover=function(){this.className+=" sfhover"};B[A].onmouseout=function(){this.className=this.className.replace(new RegExp(" sfhover\\b"),"")}}};if(window.attachEvent){window.attachEvent("onload",sfHover)}function setActiveStyleSheet(C){var B,A;for(B=0;(A=document.getElementsByTagName("link")[B]);B++){if(A.getAttribute("rel").indexOf("style")!=-1&&A.getAttribute("title")){A.disabled=true;if(A.getAttribute("title")==C){A.disabled=false}}}}function getActiveStyleSheet(){var B,A;for(B=0;(A=document.getElementsByTagName("link")[B]);B++){if(A.getAttribute("rel").indexOf("style")!=-1&&A.getAttribute("title")&&!A.disabled){return A.getAttribute("title")}}return null}function getPreferredStyleSheet(){var B,A;for(B=0;(A=document.getElementsByTagName("link")[B]);B++){if(A.getAttribute("rel").indexOf("style")!=-1&&A.getAttribute("rel").indexOf("alt")==-1&&A.getAttribute("title")){return A.getAttribute("title")}}return null}function createCookie(C,D,E){var A;if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));A="; expires="+B.toGMTString()}else{A=""}document.cookie=C+"="+D+A+"; path=/"}function readCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)===0){return E.substring(D.length,E.length)}}return null}window.onload=function(C){var A=readCookie("style");var D=A?A:getPreferredStyleSheet();setActiveStyleSheet(D);if(typeof (matchpos)!="undefined"){var B=document.getElementById("matchlocation"+matchpos);movetotarget(B)}if(typeof (http)!="undefined"){initpage();action()}};window.onunload=function(A){var B=getActiveStyleSheet();createCookie("style",B,365);if(typeof (newwindow)!="undefined"&&!newwindow.closed&&newwindow.location){newwindow.close()}if(typeof (http)!="undefined"){GUnload()}};var cookie=readCookie("style");var title=cookie?cookie:getPreferredStyleSheet();setActiveStyleSheet(title)