function displayAuthors(authorlist) { // displays authors on search results page return authorlist.replace(/;/g, ", "); } function displaySecondAuthors(authorlist) { // displays authors on search results page var splitAuthors = authorlist.split(";"); var authorDisplay = ""; if (splitAuthors.length >= 2) { // display as et al authorDisplay = "eds. " + authorlist.replace(/(.*)(;)/, "$1 & ") authorDisplay = authorDisplay.replace(/;/g, ","); } else { authorDisplay = "ed. " + authorlist; } return authorDisplay; } function setSearch(term) { if (term != "" && term != "New%20search") { var cookieExpires = new Date(); var tmpCookie = ""; if ( getCookie("Username") != null) { tmpCookie = getCookie("Username"); } var pass=true; var tmpCookiesplit = tmpCookie.split(';'); for (var k=0; k 9 ) { // remove an entry from the cookie var tmpCookieSwitch = ""; for (var j=0; j<9; j++) { tmpCookieSwitch += tmpCookiesplit[j] + ";" } tmpCookie = tmpCookieSwitch; } tmpCookie = term + ";" + tmpCookie; cookieExpires.setTime(cookieExpires.getTime() + (24 * 60 * 60 * 1000 * 365 * 10)); setCookie('Username', tmpCookie, cookieExpires, '/'); } } } function replaceFootnotes() { var edDeskBodyTag = document.getElementById("edDeskBody"); if ( edDeskBodyTag != null ) { var myRegExp = /\(\d+)\<\/sup\>/ig myRegExp.multiline = true; var thisLocHref = document.location.href; edDeskBodyTag.innerHTML = edDeskBodyTag.innerHTML.replace(myRegExp, "$1"); } } function showNote(layer,height,left) { document.getElementById(layer).style.visibility = "visible"; if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) { // offset for IE document.getElementById(layer).style.top = height + 165; } else { document.getElementById(layer).style.top = height + 25; } if (left > 400) { document.getElementById(layer).style.left = left - 400; } else { document.getElementById(layer).style.left = left + 15; } } function hideNote(layer) { document.getElementById(layer).style.visibility = "hidden"; } function splitSearchTerm(term) { var regExp2 = /[()\[\]"=<>!]/ig; if (!regExp2.test(term)) { var termSplit = term.split(/\s/); // don't return synonyms for termReg = /(\bnot\b)|(\bthe\b)|(\band\b)/ig; for (var k=0; k2 && !termReg.test(termSplit[k]) && termSplit[k].toLowerCase()!="not" && termSplit[k].toLowerCase()!="and" && termSplit[k].toLowerCase()!="or") { highlightSearch(termSplit[k]); } } } } // highlight search term function highlightSearch(term) { // Find edDesk article body if (args['label']== 'results') { var edDeskBodyTag = document.getElementById("resultstable"); } else { var edDeskBodyTag = document.getElementById("edDeskBody"); } //var highlightCode = "" + term + ""; var highlightCode = "" + term + ""; // Make sure the article tag was found if ( edDeskBodyTag != null ) { // Create Regular Expression object if (term.indexOf('*')!=-1) { // check if asterisk used // str = "([^=)(\\b" + term.replace(/\*/ig, '') + "s?)"; str = "([^=<\/.+])(\\b)(" + term.replace(/\*/ig, '') + "s?)(\\b)([^=>\/.+])"; } else { // str = "([^=\/\.])(\\b" + term + "s?\\b)([^=\/\.])"; str = "([^=<\/.+])(\\b)(" + term + "s?)(\\b)([^=>\/.+])"; } var myRegExp = new RegExp(str, "ig"); myRegExp.multiline = true; //edDeskBodyTag.innerHTML = edDeskBodyTag.innerHTML.replace(myRegExp, "$1$2"); edDeskBodyTag.innerHTML = edDeskBodyTag.innerHTML.replace(myRegExp, "$1$2$3$4$5"); } } function modifySearchTerm(str) { var thisterm = str; var regExp2 = /[()\[\]"=<>!,]|(\band\b)|(\bfield\b)|(\bor\b)|(\band not\b)|(\bor not\b)|(\bcontains\b)/ig; if (regExp2.test(thisterm)) { // advanced phrase searching thisterm = thisterm.replace(/\s/g,'+'); thisterm = thisterm.replace(/"/g,''); } else { // implied AND search thisterm = thisterm.replace(/\s/g,'+AND+'); } return thisterm; } function advFormatTerm(b,f) { // formats the search term for advanced search var a = new Array(); for (var i=0; i$2"); } } function pageResults(numEls,s,n) { // writes out page numbers document.write('
',n,' results: '); var strt = Number(args['start']); var nextPageURL = document.location.href; var Prev = "&start=" + (strt-10); var Next = "&start=" + (strt+10); var ListAll = "&start=1&count=1000"; var collection = "&s=" + s; var PrevLink = nextPageURL.replace(/&start=\d+/i,Prev); var NextLink = nextPageURL.replace(/&start=\d+/i,Next); var ListAllLink = nextPageURL.replace(/&start=\d+&count=\d+/i,ListAll); if (strt>1) { document.write('Previous | ');}; var i=1; do { if (i!=1) {document.write(' | ')}; // if (i==args['start']) { // document.write('',(i+9)/10,''); var nextPageNum = "&start=" + i; var nextPageLink = nextPageURL.replace(/&start=\d+/i,nextPageNum); if (i==91) { document.write(''); document.write('10+'); i=numEls; // break } else { if (i==args['start']) { document.write('',(i+9)/10,''); } else { document.write(''); document.write((i+9)/10,'');} } i=i+10; } while(iNext');}; document.write(' | List all'); document.write('

'); } function resortArray(order,s) { var blankArray = new Array(); blankArray[0]= ""; if (s=='F') { // Foundation Research switch(order) { case '1': break; case '2': searchResultsF.sort(compareIssue); break; case '3': searchResultsF.sort(compareTreePath); break default: break; } } else if (s=='R') { // Related Literature switch(order) { case '1': break; case '2': searchProductResultsR.sort(compareIssue); break; case '3': searchProductResultsR.sort(compareTitle); break default: break; } } else if (s=='C') { // Related Literature switch(order) { case '1': break; case '2': searchProductResultsC.sort(compareIssue); break; case '3': searchProductResultsC.sort(compareTitle); break default: break; } } else if (s=='O') { // Organisations switch(order) { case '1': break; case '2': break; case '3': searchResultsO.sort(compareTitle); break default: break; } } } // sorting functions for Arrays function compareIssue(aValue1, aValue2) { if (typeof(aValue1)== 'undefined') { return 1 } if (typeof(aValue2)== 'undefined') { return -1 } if(unescape(aValue1.viewIssue) < unescape(aValue2.viewIssue)) { return 1; } if(unescape(aValue1.viewIssue) > unescape(aValue2.viewIssue)) { return -1; } return 0; } // sorting functions for Arrays function compareIssue_revised(aValue1, aValue2) { if (typeof(aValue1)== 'undefined') { return 1 } if (typeof(aValue2)== 'undefined') { return -1 } var a1 = getFront(unescape(aValue1.viewIssue),">"); var a2 = getFront(unescape(aValue2.viewIssue),">"); if(a1 < a2) { return 1; } if(a1 > a2) { return -1; } return 0; } function compareTreePath(aValue1, aValue2) { if (typeof(aValue1)== 'undefined') { return -1 } if (typeof(aValue2)== 'undefined') { return 1 } if(unescape(aValue1.viewTreePath) < unescape(aValue2.viewTreePath)) { return -1; } if(unescape(aValue1.viewTreePath) > unescape(aValue2.viewTreePath)) { return 1; } return 0; } function compareTitle(aValue1, aValue2) { if (typeof(aValue1)== 'undefined') { return 1 } if (typeof(aValue2)== 'undefined') { return -1 } if(unescape(aValue1.viewTitle) < unescape(aValue2.viewTitle)) { return -1; } if(unescape(aValue1.viewTitle) > unescape(aValue2.viewTitle)) { return 1; } return 0; } function compareHeadline(aValue1, aValue2) { if (typeof(aValue1)== 'undefined') { return 1 } if (typeof(aValue2)== 'undefined') { return -1 } if(unescape(aValue1.viewHeadline) < unescape(aValue2.viewHeadline)) { return -1; } if(unescape(aValue1.viewHeadline) > unescape(aValue2.viewHeadline)) { return 1; } return 0; } function proximitySearch(z,term) { try { var tmpArticle = eval("articleResultF" + j); var doesExist = true; } catch(error) { var doesExist = false; } if (doesExist) { var tmpArticleBody = eval ("articleResultF" + z + ".Body"); var thisBody = unescape(tmpArticleBody); var intIndex = thisBody.toLowerCase().indexOf(term); // is the search word found in body? yes write out text surrounding if (thisBody.indexOf(term)!=-1 && args['type']=="JS") { // if start or end is too close if ((intIndex < 150) || (thisBody.length - intIndex < 150)) { if (intIndex < 150 ) { // close to start var intStart = 0; var intStartWB = 0; var intEnd = intStart + 300; var intEndWB = thisBody.substring(0,intEnd).lastIndexOf(' '); } else { // close to end var intEndWB = thisBody.length; var intStart = intEndWB - 300; var intStartWB = thisBody.indexOf(' ',intStart); } } else { var intStart = intIndex-150; var intStartWB = thisBody.indexOf(' ',intStart); var intEnd = intStart + 300; var intEndWB = thisBody.substring(0,intEnd).lastIndexOf(' '); } var regTags = /(
)+|(
)+|(<\/?p>)+|()|(<\/?tr>)|(<\/?td>)|(<\/?ul>)|(<\/?li>)|(<\/?ol>)|(<\/?h1>)|(<\/?h2>)|(<\/?h3>)|(\n)/ig; document.write('
...',thisBody.substring(intStartWB,intEndWB).replace(regTags,' '),'...'); } else { document.write('
',unescape(searchResultsF[j].viewSummary)); } } else { document.write('
',unescape(searchResultsF[j].viewSummary)); } } function nav_mouseOver(navItem, className){ document.getElementById(navItem).className = className } function nav_mouseOut(navItem, className){ document.getElementById(navItem).className = className } function trim(aStr) {return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "")} function changeVisibility(layer) { document.getElementById(layer).style.visibility = "visible"; document.getElementById(layer).style.height = "100px"; } function changeHidden(layer) { document.getElementById(layer).style.visibility = "hidden"; document.getElementById(layer).style.height = "0px"; } function resizeText (textsize){ var cookievalue=""; if(textsize=="normal") { document.styleSheets[1].disabled=true; document.styleSheets[2].disabled=false; document.getElementById("fontchange").innerHTML = '*Large font'; cookievalue="normal"; } else if (textsize="large") { document.styleSheets[1].disabled=false; document.styleSheets[2].disabled=true; document.getElementById("fontchange").innerHTML = '*Normal font'; cookievalue="large"; } else {} var cookieExpires = new Date(); cookieExpires.setTime(cookieExpires.getTime() + (24 * 60 * 60 * 1000 * 365 * 10)); setCookie('LJF_font', cookievalue, cookieExpires, '/'); }