﻿document.cookie = "hewitt=1; path=/";
var cookieenabled = (document.cookie.indexOf("hewitt=") != -1) ? true : false
var aRVP  = new Array();

function SetCookie(cname,cvalue) {
  document.cookie = cname+"="+encodeURIComponent(cvalue)
                  + ";path=/" ;
}

function GetCookie( cname ) {
  var start = document.cookie.indexOf( cname + "=" );
  var len = start + cname.length + 1;
  if ( ( !start ) &&
       ( cname != document.cookie.substring( 0, cname.length ) ) ) {
    return null;
    }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return decodeURIComponent( document.cookie.substring( len, end ) );
}

function ProcessRVP() {
  var temp =  GetCookie("rvp");
  if (temp!=null) {aRVP = temp.split("~~~");}
  temp = "";
  for (var i=0; ( (i<aRVP.length)&&(i<5) ); i++) {  
    if (aRVP[i].indexOf(document.location.href)==-1) {
      temp+="~~~"+aRVP[i];
      }
    }
  var tit =  document.title;
  if (tit.indexOf("Aon Hewitt - ")==0) {tit=tit.substring(13,tit.length);}
  temp="<a href='"+document.location.href + "'>" + tit +"</a>"+temp;
  SetCookie("rvp",temp);
  aRVP = temp.split("~~~");
}

function displayRVP() {
  if (!(cookieenabled)) {return;}
  ProcessRVP();
  var temp = "";
  for (var i=1; (i<aRVP.length); i++) {temp+=aRVP[i];} 
  if (temp!="") {
    document.write("<div id='recentlyViewed_pnlRecentlyViewed'>");
    document.write("<div class='recvwdhd'>Recently Viewed</div><div class='ctrdkgrey'>&nbsp;</div>");
    document.write("<div class='recvwd'>"+temp+"</div>");
    document.write("</div>");
    }
}

function GoGR(doc) {
  doc.location.href=doc.location.href.replace('\/en\/','\/gr\/');
  return false;
}

function GoEN(doc) {
  doc.location.href=doc.location.href.replace('\/gr\/','\/en\/');
  return false;
}


