function getCookie(NameOfCookie) {
    if (document.cookie.length > 0) {              
    begin = document.cookie.indexOf(NameOfCookie+"=");       
     if (begin != -1) { begin += NameOfCookie.length+1;       
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));} }
  return null;}

function setCookie(NameOfCookie, value, expiredays, nomefile) {
 var ExpireDate = new Date();
  ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
  document.cookie = NameOfCookie + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
location.href=nomefile+"_c.htm";

}

function delCookie (NameOfCookie,nomefile) {
  if (getCookie(NameOfCookie)) {
    document.cookie = NameOfCookie + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT"; }
location.href=nomefile+"_a.htm";
}

function mappa(nomefile) {
  condizione=getCookie('Mappa');
   if (condizione==null)  {location.href=nomefile+"_a.htm"};
else  {location.href=nomefile+"_c.htm"};

}
