//Apri foto
function PrevFoto(img){
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,100);
  }
}

function viewFoto(img){
  largh=foto1.width+20;
  altez=foto1.height+25;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}
//Show
function Show(id){
if(document.getElementById){
    document.getElementById(id).style.display="block";
}
}
//Hide
function Hide(id){
if(document.getElementById){
    document.getElementById(id).style.display="none";
    }
}
//Show&Hide
function ShowHide(id){
if(document.getElementById){
	var el=document.getElementById(id);
	el.style.display = (el.style.display=="block") ? "none" : "block";
}
}
/*FontSwitcher*/
function setFontSwitcher(){
size=getCookie("fontsize");             //reperisce il cookie
if(size!=null) SetFontSize(size);       //setta le impostazioni
}
function SetFontSize(s){
document.getElementsByTagName('body')[0].style.fontSize=s;
setCookie("fontsize",s,30);
}
function setCookie(name, value, expdays) {   //memorizza il cookie
var now = new Date();
var exp = new Date(now.getTime() + (1000*60*60*24*expdays));
document.cookie = name + "=" + escape(value) + ";" + "expires=" + exp.toGMTString() + ";" + "path=/";
}
function getCookie(name) {    //restituisce il cookie
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
    var start = dc.indexOf(cname);
    if (start != -1) {
        start += cname.length;
        var stop = dc.indexOf(";", start);
        if (stop == -1) stop = dc.length;
        return unescape(dc.substring(start,stop));
        }
    }
return null;
}
/*WriteEmailAddress*/
function sendmail(user, domain) {
  // protocol
  var p = "\u006d\u0061\u0069\u006c\u0074\u006f\u003a";
  // usename
  var u = user;
  // domain name (host name sans machine name)
  var d = domain ||
          location.host.substring(
            location.host.lastIndexOf(
              ".",
              location.host.lastIndexOf(".") - 1
            ) + 1
          );
  void(top.location = p + u + "\u0040" + d);
  return false;
}
/*Page_Onload*/
function initialize(){
	//setMenuList()
	setFontSwitcher();
	/*if (document.images.ExtraSlideShow) SetExtraSlideShow();
	if (document.images.ExtraSlideShow) runExtraSlideShow();
	if (document.images.AssicurazioniSlideShow) SetAssicurazioniSlideShow();
	if (document.images.AssicurazioniSlideShow) runAssicurazioniSlideShow();
	if (document.getElementById) setFade("minibannerimg");*/
}
