
var aRVP  = new Array();
var sRVPBoxTitle =  '<span class="RVPTitle">Recently Visited Pages</span>';
var sRVPCookieText = '<div class="RVPOffMessage">Please enable cookies on your browser to activate this functionality.</div><ul><li><a href="/gx/eng/main/privacy/index.html" target="_self" title="Privacy">Privacy</a></li></ul>';
document.cookie = "PwC=PwC; path=/";
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 <title> 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=/";
 }
// 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('<div class="RVPBox">' + sRVPBoxTitle + '<br/>' + sRVPCookieText + '</div>');
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('<div class="RVPBox">' + sRVPBoxTitle + '<ul>');}
        
	         urlStr = '<li><a href="' + unescape(parmArray[0]) + '"';
	                
		         // window target
		         if ((parmArray[2]) && (parmArray[2] != 0))   {urlStr = urlStr + ' target="' + parmArray[2]  + '"';}
		          
		        //check to see if this needs to be tagged to record in RVP
		        if ((parmArray[3]) && (parmArray[3] == 1))  
		              {urlStr = urlStr + ' onClick="processbyreqRVP(\'' + unescape(parmArray[1]) + '\',\'' + unescape(parmArray[0]) + '\',\'' + parmArray[2] + '\');"';}
		        tUrl = unescape(parmArray[1]).replace("<","&lt;");
                      tUrl = tUrl.replace(">","&gt;");
		        urlStr = urlStr + ' title="' + unescape(parmArray[1]) + '">' + tUrl +  '</a></li>';
		        document.write(urlStr);
		              
                 j = j + 1;
             }
             if (j >= 5) break;
          }
        }  //  end of for loop
if (hdr == 1) {document.write('</ul></div>');}
     }  
 
 }
// 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();
//link vars
lpn_Key = ['@cm-cif@','@cm-c@','@cm-l@','@cm-pt@','@cm-i@','@cm-ch@'];
lpn_Value = ['cu','lu','eng','','',''];
ssl = '';
var domain='';
var domain_imagessl='';
// These are the page configuration parameters
var topNavVersion='std2';
var sections=['0'];
var lang = 'eng';
var languageIdentifiers=['eng'];
var languageNames=['English'];
var languageURLs=['/lu/eng/main/home/index.html'];
var section='aboutus';
var country='lu';
var configVal = 0;
var css = 'earth';
var hideTopNav = 0;
if ( ( configVal - 128 ) >= 0 ){
   var hideTopNav = 1;
   configVal -= 128;
}
var hideTabMenu = 0;
if ( ( configVal - 64 ) >= 0 ){
   hideTabMenu = 1;
   configVal -= 64;
}
var hideSearchBox = 0;
if ( ( configVal - 32 ) >= 0 ){
   hideSearchBox = 1;
   configVal -= 32;
}
var hideCountryBox = 0;
if ( ( configVal - 16 ) >= 0 ){
   hideCountryBox = 1;
   configVal -= 16;
}
var hideLPN = 0;
if ( ( configVal - 8 ) >= 0 ){
   hideLPN = 1;
   configVal -= 8;
}
var hideLang = 0;
if ( ( configVal - 4 ) >= 0 ){
   hideLang = 1;
   configVal -= 4;
}
var hideGHPLink = 0;
if ( ( configVal - 2 ) >= 0 ){
   hideGHPLink = 1;
   configVal -= 2;
}
var hidePwCLogo = 0;
if ( configVal == 1 ){
   hidePwCLogo = 1;
}



//This processes LPN URLs
function lpnLink( url ){
	if( url == null ){
		return( "" );
	}
	if( url == "" ){
		return( "" );
	}
	urlTxt = new String( url );
	for( i = 0; i <= lpn_Key.length-1; i++ ){
		if( lpn_Key[ i ] == urlTxt ) {
			urlTxt = lpn_Value[ i ];
			break;
		}
		splitUrl = urlTxt.split( lpn_Key[ i ] );
		urlTxt = splitUrl.join( lpn_Value[ i ] );
	}
	return( urlTxt );
}




//This processes URLs
function link( url ){
	if( url == null ){
		return( "" );
	}
	if( url == "" ){
		return( "" );
	}
	if( domain =="" ){
		return( url );
	}
	if( url.charAt( 0 ) == "/" ){
		return( domain + url );
	}
	return( url );
}









function footerText(year){
	if(!year){
		year="2009"
	}
	document.writeln( "<div class='footerText'>" );
	document.write("&copy; "+year+" PricewaterhouseCoopers S.&agrave;.r.l. All rights reserved. PricewaterhouseCoopers refers to the network of member firms of PricewaterhouseCoopers International Limited, each of which is a separate and independent legal entity.");
	document.writeln( "</div>" );
}
function footerAccessKeyInfo(){
	document.writeln( "<!-- Supplementary Accesskey information for ALL PAGES -->" );
	document.writeln( "<a accesskey='0' href='http://www.w3c.org'><img src='" + domain_imagessl + "/events/images/tran.gif' width='1' height='1' border='0' alt='Accessibility information' /></a> <!-- Accessibility page-->" );
	document.writeln( "<a accesskey='2' href='#pageContent'><img src='" + domain_imagessl + "/events/images/tran.gif' width='1' height='1' border='0' alt='Skip navigation' /></a> <!-- Skip navigation -->" );
	document.writeln( "<a accesskey='3' href='/gx/eng/main/countriesonline/index_text.html'><img src='" + domain_imagessl + "/events/images/tran.gif' width='1' height='1' border='0' alt='Countries online' /></a> <!-- Countries online -->" );
}
function footerLinks(){
	document.writeln( "<div id='footer' class='footerLinks'>" );
//	if ( "" == "" ){
//		//default privacy links
//		document.writeln( "<span class='footerItem'><a href='" + link( "http://www.pwc.com/gx/eng/main/privacy/index.html" ) + "' title='Privacy'>Privacy Statement</a></span>" );
//	} else {
//		//override privacy links
//		document.writeln( "<span class='footerItem'><a href='" + link( "http://www.pwc.com/gx/eng/main/privacy/index.html" ) + "' title='Privacy'>Privacy Statement</a></span>" );
//	}
	if ( "" == "" ){
		//default legal links
		document.writeln( "<span class='footerItem'><a href='" + link( "/setupineurope/public/legal/terms_conditions.html" ) + "' title='Legal'>General Terms &amp; Conditions</a></span>" );
	} else {
		//override legal links
		document.writeln( "<span class='footerItem'><a href='" + link( "/setupineurope/public/legal/terms_conditions.html" ) + "' title='Legal'>General Terms &amp; Conditions</a></span>" );
	}
	if ( "" == "" ){
		//default about provider
		document.writeln( "<span class='footerItem'><a href='" + link( "/setupineurope/public/siteprovider.html" ) + "' title='Site Provider'>Site Provider</a></span>" );
	} else {
		//override about provider
		document.writeln( "<span class='footerItem'><a href='" + link( "/setupineurope/public/siteprovider.html" ) + "' title='Site Provider'>Site Provider</a></span>" );
	}
	if ( "" == "" ){
		//default Email Webmaster
		document.writeln( "<span class='footerItem'><a href='" + link( "mailto:setupineurope@lu.pwc.com" ) + "' title='E-mail Webmaster'>E-mail Webmaster</a></span>" );
	} else {
		//override Email Webmaster
		document.writeln( "<span class='footerItem'><a href='" + link( "mailto:setupineurope@lu.pwc.com" ) + "' title='E-mail Webmaster'>E-mail Webmaster</a></span>" );
	}
	if ( "" == "" ){
		//default site map
		document.writeln( "<span class='footerItem' id='footerItem'><a href='" + link( "/setupineurope/public/sitemap.html" ) + "' title='Site Map'>Site Map</a></span>" );
	} else {
		//override site map
		document.writeln( "<span class='footerItem' id='footerItem'><a href='" + link( "/setupineurope/public/sitemap.html" ) + "' title='Site Map'>Site Map</a></span>" );
	}
	if ( "" == "" ){
		//default site map
		document.writeln( "<span class='footerItem' id='footerItem1'><a href='" + link( "http://www.pwc.com/lu/en/publications/rss-feed.jhtml" ) + "' title='RSS' target='blank'>RSS</a></span>" );
	} else {
		//override site map
		document.writeln( "<span class='footerItem' id='footerItem1'><a href='" + link( "http://www.pwc.com/lu/en/publications/rss-feed.jhtml" ) + "' title='RSS' target='blank'>RSS</a></span>" );
	}
	document.writeln( "</div>" );
}
function buildFooter(year){
	document.writeln( "<div id='footerContainer'>" );
	footerLinks();
	footerText(year);
	footerAccessKeyInfo();
	document.writeln( "</div>" );
}

function frameHeaderRightPersistentLinks(){
	document.writeln( "<div id='persistentContainer'>");
	document.writeln( "<ul class='persistentLinks' id='nav1'>");
	document.writeln( lpnLink( "<li class='persistentTop'><a href='http://www.pwc.com/lu/en/index.jhtml' target='blank' title='PwC Luxembourg'>PwC Luxembourg</a></li>" ) );
	document.writeln( lpnLink( "<li class='persistentTop'><a href='http://www.pwc.com/lu/en/publications/index.jhtml' target='blank' title='Publications'>Publications</a></li>" ) );
	document.writeln( lpnLink( "<li class='persistentTop'><a href='http://www.pwc.com/lu/en/about-us/index.jhtml' target='blank' title='About Us'>About Us</a></li>" ) );
	document.writeln( lpnLink( "<li><a accesskey='9' href='mailto:setupineurope@lu.pwc.com' target='blank' title='Contact Us'>Contact Us</a></li>" ) );
	document.writeln( "</ul>");
	document.writeln( "</div><br clear='all' />");
}

