function newwin(url,win) { newwind=window.open(url,win,"toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=370") } function openWindow(url, name) { window.open(url,name); } function openDbRelativeURL( url, target ){ //Check we have a target window; target = (target == null ) ? window : target; //Work out the path of the database; var p = location.pathname; path = p.slice( 1, p.toLowerCase().lastIndexOf('.nsf')+4) + '/'; target.location.href = path + url; } /*forceLogin appends &Login to the current URL in order to cause a login prompt and hence Authentication*/ function forceLogin () { s = document.location.search; if (s.toLowerCase().indexOf("&login") == -1 ) { a = (s=="") ? "?Open&Login" : "&Login"; document.location.href += a; } } //Remove leading and trailing spaces from a string //Originally written by Jim Fricker function trim(aStr) {return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "")} /* NavigateView cycles through a view using the start and count paramaters of the ?OpenView method. Required as @Commands do not work with single category views on the web !! Arguments: d = direction, either "prev" or "next" n = incremental count number */ function navigateView (d, n) { var c = 0; var args = location.search.split('&'); var news = new Array(); var ii = 0; for (var i = 0; i < args.length; i ++) { if ( args[i].toLowerCase().indexOf('start=') != -1) { c = parseInt(args[i].split('=')[1]); } else { news[ii] = args[i]; ii ++; } } if (args[0] == '') { location.search = '?OpenView&start=' + n; } else if (c == 0 && d == 'next') { location.search += '&start=' + n; } else if (c == 0 && d == 'prev') { alert('There are no more documents in that direction.'); return false; } else if (c <= n && d == 'prev') { location.search = news.join('&'); } else if (d == 'next') { location.search = news.join('&') + '&start=' + ( c + n ); } else if (d == 'prev') { location.search = news.join('&') + '&start=' + ( c - n); } } function doSearch ( s ) { var regExp1 = /\bfield\b/; var regExp2 = /<|>|\[|\]|\(|\)|\!/; var str = s.value; if ( regExp1.test( str ) || regExp2.test( str ) ) { alrt = "Please note that you can not include:"; alrt += "\n\nThe reserved word 'field'\nthe characters [, ], (, ), < or >"; alrt += "\n\nin your search query!\n\nIf you are confident that you know"; alrt += "\nwhat you are doing, then you can\nmanually produce the URL required."; s.focus(); return alert( alrt ); } if ( str == "" ) { alert("Please be sure to enter something to search for."); s.focus(); } else { document.location = "/" + document.forms[0].Path.value + "/articleIDs?search&query=" + escape( str ) + "&start=1&count=10"; } } /*open search results and append the search term in the URL..*/ function openAndHighlight( docID ) { appTerm = document.forms[0].QueryText.value; document.location = "/" + document.forms[0].Path.value + "/" + docID + "?open&Highlight=0," + escape( appTerm ); } // retrieve a cookie. function getCookie(name){ var cname = name + "="; var dc = document.cookie; if (dc.length > 0) { begin = dc.indexOf(cname); if (begin != -1) { begin += cname.length; end = dc.indexOf(";", begin); if (end == -1) end = dc.length; return unescape(dc.substring(begin, end)); } } return null; } // setting a cookie. function setCookie(name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : "; expires=" + expires.toGMTString()) + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain) + ((secure == null) ? "" : "; secure"); } // deleting a cookie. function delCookie (name,path,domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" : "; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function parseQueryString (str) { str = str ? str : location.search; var query = str; var args = new Object(); if (query) { var fields = query.split('&'); for (var f = 0; f < fields.length; f++) { var field = fields[f].split('='); if (field.length == 2) { args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' ')); } else { args[unescape(field[0].replace(/\+/g, ' '))] = ""; } } } return args; }