":
output = output + ">";
break;
case '"':
output = output + """;
break;
case "'":
output = output + "'";
break;
case ")":
output = output + ")";
break;
case "(":
output = output + "(";
break;
case "+":
output = output + "+";
break;
case "&":
output = output + "&";
break;
case ";":
output = output + ";";
break;
default:
output = output + input.charAt(count);
break;
}
}
return output;
} // End removeSpecialChars(input)
var aRVP = new Array();
var sRVPBoxTitle = 'Recently Visited Pages';
var sRVPCookieText = 'Please enable cookies on your browser to activate this functionality.
';
var cookieDomain = "";
if( window.location.host.indexOf(".pwc.com") == -1 ){
cookieDomain = "";
} else {
cookieDomain = "; domain=pwc.com";
}
document.cookie = "PwC=PwC; path=/" + cookieDomain;
var cookieenabled = (document.cookie.indexOf("PwC=") != -1) ? true : false
//checks if current page needs to be recorded in the cookie
function processRVP()
{
var pos;
// checks if cookies are enabled
if (!(cookieenabled)) {return;}
//read cookie and load global array
readRVPCookie();
//check for the indicator to record this url
// 0 = not to record; any value = record
if (readMetaTag("RVPFlag") == "0") return;
// check for # sign followed by any
var tUrl = document.location.href;
if (tUrl.indexOf('#') != -1) {tUrl = tUrl.substring(0,tUrl.indexOf('#')); }
if (!(recentRVP(tUrl)))
{
// get link description
var sRVPTitle = readMetaTag("RVPTitle");
if (sRVPTitle == "")
{
//get title from tag
sRVPTitle = document.title;
if (typeof sRVPTitle != "undefined")
{
// searches for something like "..& PricewaterhouseCoopers:!## Test "
var mt = new RegExp(/^([^a-zA-Z0-9]*)PricewaterhouseCoopers([^a-zA-Z0-9]*)\s/i);
sRVPTitle = sRVPTitle.replace(mt,"");
}
else {sRVPTitle = "";}
}
//record values in the cookie
if ((sRVPTitle != "") && (typeof sRVPTitle != "undefined") && (sRVPTitle != "undefined"))
{
var pageInfo = escape(tUrl) + "~~" + escape(sRVPTitle) + "~~_self~~0~~~" ;
recordRVP(pageInfo);
//repoopulate global array
readRVPCookie();
}
}
}
// record in the cookie as requested
function processbyreqRVP(title,url,target)
{
// checks if cookies are enabled
if (!(cookieenabled)) {return;}
// checks if title and url are provided
if ((title == "") || (url == "")) {return;}
// check for # sign followed by any
var tUrl = url;
if (tUrl.indexOf('#') != -1) {tUrl = tUrl.substring(0,tUrl.indexOf('#')); }
if (!(recentRVP(tUrl)))
{
//record values in the cookie
if ( (!(target)) || (target == '')) var pageInfo = escape(tUrl) + "~~" + escape(title) + "~~_blank~~1~~~" ;
else var pageInfo = escape(tUrl) + "~~" + escape(title) + "~~" + target + "~~1~~~" ;
recordRVP(pageInfo);
//repoopulate global array
readRVPCookie();
}
}
// record URL as most RVP in the cookie
function recordRVP(pageInfo)
{
// checks if cookies are enabled
if (!(cookieenabled)) {return;}
var cookieSTR = "RVPLinks=" + pageInfo;
for (var i=0; i < aRVP.length; i++)
{
if ((aRVP[i]) && (aRVP[i] != "")) cookieSTR = cookieSTR + aRVP[i] + "~~~";
if (i >= 4) break;
}
document.cookie = cookieSTR + ";path=/" + cookieDomain;
}
// checks if URL is recorded as the most recent RVP
function recentRVP(url)
{
if ( (!(aRVP[0])) || (aRVP[0] == "") ) {return false;}
//checks first entry
var tRVP = aRVP[0].split("~~");
if (tRVP[0] == escape(url)) {return true;}
return false;
}
// populate links for RVP box using cookie
function displayRVP()
{
// checks if cookies are enabled and display appropriate message if cookies are disabled
if (!(cookieenabled))
{
document.write(sRVPCookieText);
return;
}
//display links
var parmArray = new Array();
var hdr = 0;
var j = 0;
var urlStr;
var tUrl;
//display cookie contents
if ((aRVP[0]) && (aRVP[0] != "") )
{
for (var i=0; i < aRVP.length; i++)
{
if (aRVP[i])
{
parmArray = aRVP[i].split("~~");
if (i == 0) {
// check for # sign followed by any
tUrl = document.location.href;
if (tUrl.indexOf('#') != -1) {tUrl = tUrl.substring(0,tUrl.indexOf('#')); }
}
if ( (parmArray[1]) && (parmArray[0]) && ( (i > 0) || ( (i == 0) && (!recentRVP(tUrl))) ))
{
// write header
if (hdr == 0) {hdr = 1; document.write('');}
}
}
// read cookie contents
function readRVPCookie()
{
var lnkStr = document.cookie;
var pos = lnkStr.indexOf("RVPLinks=");
if (pos == -1) return;
// eliminate the text "PwC=PwC;RVPLinks=" from the string
lnkStr = lnkStr.substring(pos+9);
if (lnkStr.indexOf(";") > -1) {lnkStr = lnkStr.substring(0,lnkStr.indexOf(";"));}
//load links in global array
aRVP = lnkStr.split("~~~");
}
// read meta tag for value
function readMetaTag(tagName)
{
var content = "";
// check for various browsers and versions
if (document.getElementById) {
if (document.getElementById(tagName)) content = document.getElementById(tagName).content;
}
else if (document.all) {
if (document.all[tagName]) content = document.all[tagName].content;
}
else if (document.layers) {
if (document.layers[tagName]) content = document.layers[tagName].content;
}
return content;
}
processRVP();
// END RVP JS