searchDomain="http://search1.pwc.com/search/" // the Atomz search engine searchAccount="00063301-sp00000000" // production account is "00063301-sp00000000" DefaultSearchHelp="/extweb/searchresults.nsf/results/gx-searchsimplehelp-eng?opendocument" AdvancedSearchHelp="/extweb/searchresults.nsf/results/gx-searchadvancedhelp-eng?opendocument" // This function returns the sand style sheet if the ssColor is not a member of the arraySS else it returns the color. // Used to force sand in event ss parameter is invalid (not a member of arraySS). function styleSS(ssColor) { // This is the array of available stylesheets in the system. var arraySS = [['aubergine'], ['bordeaux'], ['earth'], ['ocean'], ['olive'], ['terracotta'], ['wheat']] var color="wheat"; for (i = 0; i < arraySS.length; i++) { // check value of ss to ensure it is valid. if (ssColor == arraySS[i][0]) { color = ssColor; } } return color; } // This function submits a search based on the arguments passed in.... //There is a basic set of arguments defined in this function that are set to the default in case they are not passed in function submitSearch(args, resultsURL) { //alert("submitSearch Function"); //uncomment for debug only. //alert("resultsURL: " + resultsURL) //uncomment for debug only //alert("args: " +args) //uncomment for debug only var searchArgs = Array(); // Set the default values ... this is done in case these parameters are not passed in through the args array [value] searchArgs["sp-a"] = "sp1002182f"; searchArgs["sp-c"] = "25"; searchArgs["sp-p"]="phrase"; searchArgs["sp-w-control"]="1"; searchArgs["sp-q"]=""; searchArgs["sp-t"]="js" ; // indicate that we want the JavaScript output // loop through the args array passed in and set the arguments in the searchArgs array to the values that are set in the args array for (var i in args) { searchArgs[i] = args[i]; } // loop through the searchArgs array to generate the search url [query string] url = "" for (var i in searchArgs) { url+= i+"="+searchArgs[i]+"&"; } url = url.substring(0,(url.length-1)); // remove the last & [ampersand] location.href = resultsURL + "&searchLoc=" + searchDomain + "?" + url; } // End submitSearch(args) // This function changes one parameter's value [passed in] and searches again... // Useful for changing between showing and hiding the descriptors, changing between sort by date and sort by score, etc. function searchAgain(param,val) { //alert("searchAgain Function"); //uncomment for debug only. //alert("param: " + param) //uncomment for debug only //alert("val: " + val) //uncomment for debug only srch.searchParameters[param] = val; var tmp = location+""; // get the location //alert("location: " + location) //uncomment for debug only // use indexOf() instead of split() because of JS1 compatibility vs JS3 compatibility [necessary for many v4 browsers] var num = tmp.indexOf("&searchLoc="); if (num < 0) return ""; // if it couldn't find "&searchLoc=" in the URL then return without resubmitting the search... this means there was an error tmp = tmp.substring(0, num); // get the portion of the location before "&searchLoc=" //alert("tmp: " + tmp) //uncomment for debug only submitSearch(srch.searchParameters, tmp); } // End searchAgain(param,val) // - - - - - - - - - - - - - - - - - - - //This utility function will replace the value of the specified parameter in the full URL. function swapParameter(fullURL, param, newvalue) { //alert("swapParameter Function"); //uncomment for debug only. //alert ("Full URL: " + fullURL) //uncomment for debug only //alert("param: " + param) //uncomment for debug only //alert("newvalue: " + newvalue) //uncomment for debug only var paramStart = fullURL.indexOf('&' + param + '='); var paramEnd; var returnURL; // alert("paramStart: " + paramStart); //uncomment for debug only if (paramStart != -1) { paramEnd = fullURL.indexOf('&',paramStart+1); //alert("paramEnd: " + paramEnd); //uncomment for debug only returnURL = fullURL.substring(0,paramStart) + '&' + param + '=' + newvalue; if (paramEnd != -1) { returnURL = returnURL + fullURL.substring(paramEnd,fullURL.length); } } else { returnURL = fullURL + '&' + param + '=' + newvalue; } // alert ("Return URL: " + returnURL); //uncomment for debug only return returnURL; } // function getParam(browserLocation, SearchFor) { //alert("getParam Function Deprecated"); //uncomment for debug only. //alert("browserLocation: " + browserLocation) //uncomment for debug only //alert("SearchFor: " + SearchFor) //uncomment for debug only var begin, end; var value; var searchString='&'+SearchFor; var bl = browserLocation+""; //ensure it is a string type. begin = bl.indexOf(searchString); if (begin > 0) { end = bl.indexOf("&",begin+1); if (end == (-1)) { end = bl.length; //alert(end); } value = bl.substring((begin+searchString.length),end); } else { value = ""; } //alert("value: " + value) //uncomment for debug only return(value); } // End getParam () // function GetParam(name) { //alert("GetParam Function"); //uncomment for debug only. // alert ("Parameter Name: " + name); //uncomment for debug only var start = location.search.indexOf("?"+name+"="); // assign variable start if (start < 0) start = location.search.indexOf("&"+name+"="); // check variable if < 0 then assign using "&" if (start < 0) return ''; // Check again if still < 0 then exit start += name.length+2; var end = location.search.indexOf("&",start) - 1; if (end < 0){ end = location.search.length}; var result = location.search.substring(start,end); var result=''; for(var i = start; i <= end; i++) { var c = location.search.charAt(i); result = result+(c=='+'?' ':c); } // alert ("Result: " + result); //uncomment for debug only return unescape(result); } // - - - - - - - - - - - - - - - - - - - // This function generates sandard search links below the search output - sort order and show/hide summary. // This function as a dependency on the browser's url location!!! // This function as a dependency on Atomz's results definition (from js template) function writeSearchLinks() { //alert("writeSearchLinks Function"); //uncomment for debug only. if ( !(srch.results.length > 0)) return ""; // if there aren't results return without writing the links var out="
";
if (srch.searchParameters["sp-s"] == 0) {
out += 'Sort By Date';
out += ' ';
out += '';
out += '
';
} else {
out += 'Sort By Score';
out+=' '
out+='';
out+='
';
}
out += ' ';
if (srch.searchParameters["sp-m"] == 0) {
out += 'Show Summaries';
out += ' ';
out += '';
out += '![]()
';
} else {
out += 'Hide Summaries';
out += ' ';
out += '';
out += '![]()
';
}
document.write(out);
} // End writeSearchLinks()
// This Function added 6-21-2005 for use is the realignment search page functionality
// Added by Scott Richardson
// XSS patch added Sep 15, 2006 by Joe Zinzi
function writeSearchResultsToolbar() {
//alert("writeSearchResultsToolbar"); //uncomment for debug only.
var returnURL_xss = window.location.pathname;
var query_string = window.location.search.substring(0);
workingQueryString = query_string;
finalQueryString = "";
ampSign = workingQueryString.indexOf("&");
if (ampSign != -1) {
finalQueryString = workingQueryString.substring(0,ampSign+1);
workingQueryString = workingQueryString.substring(ampSign+1);
} else {
finalQueryString = removeSpecialChars(query_string);
}
// WE NOW HAVE THE BEGINNING OF STRING
while (ampSign != -1) {
equalSign = workingQueryString.indexOf("=");
if (equalSign != -1) {
paramCleaner = workingQueryString.substring(0,equalSign);
paramCleaner = removeSpecialChars(paramCleaner);
finalQueryString = finalQueryString + paramCleaner + "=";
workingQueryString = workingQueryString.substring(equalSign+1);
// Got Param Name
ampSign = workingQueryString.indexOf("&");
if (ampSign != -1) {
paramCleaner = workingQueryString.substring(0,ampSign);
paramCleaner = removeSpecialChars(paramCleaner);
finalQueryString = finalQueryString + paramCleaner + "&";
workingQueryString = workingQueryString.substring(ampSign+1);
} else {
paramCleaner = removeSpecialChars(workingQueryString);
finalQueryString = finalQueryString + paramCleaner;
}
// Got Param Value
} else {
paramCleaner = removeSpecialChars(workingQueryString);
finalQueryString = finalQueryString + paramCleaner;
ampSign = -1;
}
}
query_string = finalQueryString;
returnURL_xss += query_string;
var out = "";
out+='
| '
if (srch.prevCount > 0) {
var num = srch.lower - srch.prevCount;
out += ' | '
// srch.searchParameters["sp-s"] returns 1 or 0.
var re = RegExp( "&sp-s=", "i" );
var search_param = "0";
if ( query_string.search( re ) != -1 ) {
search_param = query_string.split( "&sp-s=" )[1];
search_param = search_param.charAt( 0 );
}
out+='';
if (search_param == "0") {
//by score
out += 'Sort By Modified Date';
out+=' '; out+=''; out += 'Sort By Published Date'; } else if (search_param == "1") { //by modified date out+='Sort By Score'; out+=' '; out+=''; out += 'Sort By Published Date'; } else { // by published date out += 'Sort By Modified Date'; out+=' '; out+=''; out+='Sort By Score'; } out+=''; out+=' | '; out+=''; if (srch.searchParameters["sp-m"] == 0) { out += 'Show Summary'; } else { out += 'Hide Summary'; } out+='' out+=' | '
if (srch.nextCount > 0) {
var num=srch.lower+srch.count;
// alert(num); // uncomment for debug only
out += 'Next ' + srch.nextCount + ' |
';
out += '
| ';
out += '|||||||||||
';
out += '
| ';
out += '|||||||||||