function SetResolution(){
	
  if(screen.width<801){
    document.getElementById("SpacerLeftColumn").style.display = "none";
    document.getElementById("SpacerRightColumn").style.display = "none";
  }
  
  FontSelected = readCookie("FontSelected");
  
  if(FontSelected!=null){
    DimCar(FontSelected);
  } else {
    FontSelected = 1; createCookie("FontSelected",1,365);
    DimCar(FontSelected);
  }
  
}

function DimCar(whatDim){

  if(document.getElementById("CharDim1")){
    document.getElementById("CharDim1").style.backgroundColor = "#DDDDDD";
    document.getElementById("CharDim2").style.backgroundColor = "#DDDDDD";
    document.getElementById("CharDim3").style.backgroundColor = "#DDDDDD";
  }
  
  Testo = document.getElementById("LineaTestoPagina");
  Sottotitolo = document.getElementById("LineaSottotitoloArea");
  Selector = document.getElementById("CharDim"+whatDim);
  
  if(whatDim==1){ FontSize1 = "13px"; FontSize2 = "11px"; }
  if(whatDim==2){ FontSize1 = "16px"; FontSize2 = "14px"; }
  if(whatDim==3){ FontSize1 = "19px"; FontSize2 = "17px"; }
  
  if(Sottotitolo){ Sottotitolo.style.fontSize = FontSize1; }
  if(Testo){ Testo.style.fontSize = FontSize2; }
  if(Selector){ Selector.style.backgroundColor = "#9ebe07"; }
  
  createCookie("FontSelected",whatDim,365);

}

function createCookie(name,value,days){

  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
  
}

function readCookie(name){

  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;

}

function eraseCookie(name){

  createCookie(name,"",-1);
  
}
