$(document).ready(function(){var gtelAuto="javascript:;";var gtelMoto="javascript:;";var gtelAltri="javascript:;";var gtelCasa="javascript:;";var gtelViaggi="javascript:;";var gtelfProtezione="javascript:;";var gtelfRisparmio="javascript:;";var gtelfPensione="javascript:;";var gtelfInvestimento="javascript:;";var openHeightGnrtl="178px";var closeHeightGnrtl="178px";var slidHeightGnrtl="44px";var openHeightGnrtlf="178px";var closeHeightGnrtlf="178px";var slidHeightGnrtlf="58px";var nProd="5";var durationA=200;var durationB=200;var percGnrtl=2.9;var percGnrtlf=2.2;var theStateofThings1="off";var theStateofThings2="off";var theStateofThings3="off";var theStateofThings4="off";var theStateofThings5="off";function changeLiStatus(whichOne,whichUl,add){var prodottoE1="#prodotto"+whichUl+whichOne;prodottoE1=$(prodottoE1);if(prodottoE1.hasClass("off")){prodottoE1.removeClass("off");prodottoE1.addClass(add);}
if(prodottoE1.hasClass("slid")){prodottoE1.removeClass("slid");prodottoE1.addClass(add);}
if(prodottoE1.hasClass("on")){prodottoE1.removeClass("on");prodottoE1.addClass(add);}}
function showContent(whichOne,whichUl){var prodottoE1="#prodotto"+whichUl+whichOne;titE1=$(prodottoE1+"> h2");introaE1=$(prodottoE1+"> p.introA");introbE1=$(prodottoE1+"> p.introB");linksE1=$(prodottoE1+"> ul.links");preventivoaE1=$(prodottoE1+"> a.preventivoA");preventivobE1=$(prodottoE1+"> a.preventivoB");imgE1=$(prodottoE1+"> span.imgOff > img");spanE1=$(prodottoE1+"> span.imgOff");prodottoE1=$(prodottoE1);titE1.removeClass("tit");titE1.addClass("titOn");introbE1.animate({opacity:'show'},durationB);introaE1.hide();introbE1.animate({opacity:'show'},durationB);linksE1.animate({opacity:'show'},durationB);preventivoaE1.animate({opacity:'show'},durationB);var scaleW=imgE1.attr("id")+"px";if(scaleW!="undefinedpx"){if(whichUl=="Gnrtl")spanE1.css({'padding-bottom':'10px'});imgE1.animate({width:scaleW},100);}}
function hideContent(whichOne,whichUl){var prodottoE1="#prodotto"+whichUl+whichOne;myPerc=eval("perc"+whichUl);titE1=$(prodottoE1+"> h2");introaE1=$(prodottoE1+"> p.introA");introbE1=$(prodottoE1+"> p.introB");linksE1=$(prodottoE1+"> ul.links");preventivoaE1=$(prodottoE1+"> a.preventivoA");preventivobE1=$(prodottoE1+"> a.preventivoB");imgE1=$(prodottoE1+"> span.imgOff > img");spanE1=$(prodottoE1+"> span.imgOff");titE1.removeClass("titOn");titE1.addClass("tit");introaE1.animate({opacity:'show'},durationB);introbE1.animate({opacity:'hide'},durationB);linksE1.hide();preventivoaE1.hide();var scaleW=imgE1.attr("id")/myPerc+"px";if(whichUl=="Gnrtl")spanE1.css({'padding-bottom':'0'});if(scaleW!="undefinedpx")imgE1.animate({width:scaleW},100);}
function openProd(whichOne,whichUl){var prodottoE1="#prodotto"+whichUl+whichOne;prodottoE1=$(prodottoE1);prodottoE1.stop();prodottoE1.animate({height:eval("openHeight"+whichUl)},{duration:durationA,easing:"linear",complete:function(){changeLiStatus(whichOne,whichUl,"on");}});showContent(whichOne,whichUl);}
function closeProd(whichOne,whichUl){var prodottoE1="#prodotto"+whichUl+whichOne;prodottoE1=$(prodottoE1);prodottoE1.stop();prodottoE1.animate({height:eval("closeHeight"+whichUl)},{duration:durationA,easing:"linear",complete:function(){changeLiStatus(whichOne,whichUl,"off");}});hideContent(whichOne,whichUl);}
function slideProd(whichOne,whichUl){var prodottoE1="#prodotto"+whichUl+whichOne;prodottoE1=$(prodottoE1);prodottoE1.stop();prodottoE1.animate({height:eval("slidHeight"+whichUl)},{duration:durationA,easing:"linear",complete:function(){changeLiStatus(whichOne,whichUl,"slid");}});hideContent(whichOne,whichUl);}
function toggleProd(whichOne,whichUl,whichAction){var prodottoE1="#prodotto"+whichUl+whichOne;prodottoE1=$(prodottoE1);if(whichAction=="open"){for(var i=1;i<=nProd;i++){if(i<whichOne)slideProd(i,whichUl);if(i>whichOne)closeProd(i,whichUl);}
openProd(whichOne,whichUl);}
if(whichAction=="close"){openProd("1",whichUl);for(var i=2;i<=nProd;i++){closeProd(i,whichUl);}}}
function imgWorkAround(){$("#prodottiGnrtlfMenu img").add($("#prodottiGnrtlMenu img")).each(function(n){$(this).css({'width':'auto'});$(this).attr({id:$(this).width()});});toggleProd("1","Gnrtl","open");toggleProd("1","Gnrtlf","open");}
if((jQuery.browser.safari||jQuery.browser.chrome)&&document.readyState!="complete"){var tWebKit=setTimeout(function(){imgWorkAround()},500);}else{imgWorkAround();}
$("#btGtelSinistri").bind("click",function(event){event.preventDefault();$(".menuAssistenza").hide();$("#popUpGtelAssistenza").show()});$("#btGtelDenunciaOnline").bind("click",function(event){event.preventDefault();$(".menuAssistenza").hide();$("#popUpGtelSinistri").show();});$(".menuAssistenza a.chiudi").bind("click",function(event){event.preventDefault();$(".menuAssistenza").hide()});$(".menuAssistenza a.chiudi").bind("click",function(event){event.preventDefault();$(".menuAssistenza").hide()});$(".menuAssistenza a.chiudi").bind("click",function(event){event.preventDefault();$(".menuAssistenza").hide()});$("#prodottoGnrtl1").bind("click",function(){document.location.href=gtelAuto;});$("#prodottoGnrtl2").bind("click",function(){document.location.href=gtelMoto;});$("#prodottoGnrtl3").bind("click",function(){document.location.href=gtelAltri;});$("#prodottoGnrtl4").bind("click",function(){document.location.href=gtelCasa;});$("#prodottoGnrtl5").bind("click",function(){document.location.href=gtelViaggi;});$("#prodottoGnrtlf1").bind("click",function(){document.location.href=gtelfProtezione;});$("#prodottoGnrtlf2").bind("click",function(){document.location.href=gtelfRisparmio;});$("#prodottoGnrtlf3").bind("click",function(){document.location.href=gtelfPensione;});$("#prodottoGnrtlf4").bind("click",function(){document.location.href=gtelfInvestimento;});$("#prodottiGnrtlMenu > li").each(function(n){$(this).bind("mouseenter",function(event){toggleProd(n+1,"Gnrtl","open")});});$("#prodottiGnrtlfMenu > li").each(function(n){$(this).bind("mouseenter",function(event){toggleProd(n+1,"Gnrtlf","open")});});$("#prodottiGnrtlMenu").bind("mouseleave",function(){toggleProd("0","Gnrtl","close")});$("#prodottiGnrtlfMenu").bind("mouseleave",function(){toggleProd("0","Gnrtlf","close")});});