"+tipoPostoSector+" | "+$(this).attr("data-fila")+" | "+$(this).attr("data-posto")+" |
"});$(".mappahtml.postiScelti tbody").html(scelti);if(scelti.length==0)$(".mappahtml.postiScelti").hide();else $(".mappahtml.postiScelti").show()}
SHOW.SetAnagrafiche={_data:{tipoPosto:"",prTessera:new Array,squadraDiCasa:"",countryHash:"",regionHash:"",anagrafiche:null},impostaDati:function(options){_data=$.extend(SHOW.SetAnagrafiche._data,options)},impostaEventi:function(){if(typeof _data=="undefined"||typeof _data.tipoPosto=="undefined"||_data.tipoPosto.length==0)return;if(_data.pua==1)if(_data.puatype==2)$("fieldset").find(".anagrafica").show();else{$("fieldset[data-idAnagrafica=0] .tesseraDelTifoso").show();$("fieldset").not($("fieldset[data-idAnagrafica=0]")).find(".anagrafica").show()}else if(_data.tipoPosto==
"P"||_data.tipoPosto=="O"||typeof _data.abbonamento!="undefined"&&_data.abbonamento=="1")$(".tesseraDelTifoso").show();else if(_data.tipoPosto=="I")$(".anagrafica").show();else if((_data.tipoPosto=="F"||_data.tipoPosto=="FM")&&_data.prTessera.length==1&&_data.prTessera[0]=="")$(".sceltaTessera").show();else if(_data.tipoPosto=="PM"||_data.tipoPosto=="OM")$(".minoreTDT").show();$("select.residenza").change(function(){var set="fieldset[data-idAnagrafica="+$(this).parents("fieldset").attr("data-idAnagrafica")+
"]";SHOW.SetAnagrafiche.resetSceltaMinore(set);SHOW.SetAnagrafiche.resetScelta(set);SHOW.SetAnagrafiche.resetTessera(set);SHOW.SetAnagrafiche.resetAnagrafica(set);SHOW.SetAnagrafiche.mostraPerResidenza(set)});$("select.residenzaNoTdt").change(function(){var set="fieldset[data-idAnagrafica="+$(this).parents("fieldset").attr("data-idAnagrafica")+"]";$(set+" .anagrafica").show()});$(".sceltaTessera input[type=radio]").click(function(){if($(this).is(":visible")){var set="fieldset[data-idAnagrafica="+
$(this).parents("fieldset").attr("data-idAnagrafica")+"]";SHOW.SetAnagrafiche.resetTessera(set);SHOW.SetAnagrafiche.resetAnagrafica(set);SHOW.SetAnagrafiche.mostraPerSceltaTessera(set)}});$(".minoreTDT input[type=radio]").click(function(){if($(this).is(":visible")){var set="fieldset[data-idAnagrafica="+$(this).parents("fieldset").attr("data-idAnagrafica")+"]";SHOW.SetAnagrafiche.resetTessera(set);SHOW.SetAnagrafiche.resetAnagrafica(set);SHOW.SetAnagrafiche.mostraPerSceltaMinore(set)}});$("select.squadra").click(function(){if($(this).is(":visible")){var set=
"fieldset[data-idAnagrafica="+$(this).parents("fieldset").attr("data-idAnagrafica")+"]";if($(this).val()==""||$(this).val()==_data.squadraDiCasa)SHOW.SetAnagrafiche.resetAnagrafica(set);SHOW.SetAnagrafiche.mostraPerSquadra(set)}});SHOW.chargeData(_data.countryHash,"select[name^=nazioneNascita]","ITA");SHOW.chargeData(_data.regionHash,"select[name^=provinciaNascita]");$("select[name^=nazioneNascita]").change(function(){SHOW.changeEstero($(this),"select[name^=provinciaNascita]","select[name^=comuneNascita]")});
$("select[name^=provinciaNascita]").change(function(){SHOW.changeComuni($(this),null,"select[name^=comuneNascita]")});$(".setAnagrafica #btnAvanti").click(function(e){var ok=true;$("fieldset").each(function(){if($(this).find("select.residenza").length>0&&$(this).find("select.residenza").is(":visible")&&$(this).find("select.residenza").val()=="")ok=false;if($(this).find(".sceltaTessera input[type=radio]").length>0&&$(this).find(".sceltaTessera input[type=radio]").is(":visible")&&!$(this).find(".sceltaTessera input[type=radio]").is(":checked"))ok=
false});if(!ok){alert(frasi.tabellaPrezzi["checkAnagrafica"]);e.preventDefault();return false}return true})},impostaDatiRiduzioni:function(){if(typeof _data=="undefined"||typeof _data.riduzioni=="undefined"||_data.riduzioni==null||typeof _data.anagrafiche!="undefined"&&_data.anagrafiche!=null)return;$.each(_data.riduzioni,function(index,value){var set="fieldset[data-idAnagrafica="+index+"]";$(set+" select[name^=riduzione]").val(value)})},impostaDatiAnagraficheErrate:function(){if(typeof _data=="undefined"||
typeof _data.anagrafiche=="undefined"||_data.anagrafiche==null)return;$.each(_data.anagrafiche,function(index,value){var set="fieldset[data-idAnagrafica="+index+"]";$(set+" select[name^=riduzione]").val(value.riduzione);if($(set+" select.residenza").length>0){$(set+" select.residenza").val(value.residenza);SHOW.SetAnagrafiche.mostraPerResidenza(set)}if($(set+" .sceltaTessera input[type=radio]").length>0&&$(set+" .sceltaTessera input[type=radio]").is(":visible")){$(set+" .sceltaTessera input[type=radio][value="+
value.sceltaTessera+"]").prop("checked",true);SHOW.SetAnagrafiche.mostraPerSceltaTessera(set)}if($(set+" .minoreTDT input[type=radio]").length>0&&$(set+" .minoreTDT input[type=radio]").is(":visible")){$(set+" .minoreTDT input[type=radio][value="+value.sceltaTesseraEta+"]").prop("checked",true);SHOW.SetAnagrafiche.mostraPerSceltaMinore(set)}if($(set+" select.squadra").length>0&&$(set+" select.squadra").is(":visible")){$(set+" select.squadra").val(value.squadra);SHOW.SetAnagrafiche.mostraPerSquadra(set)}$(set+
" input[name^=tessera]").val(value.tessera);if($(set+" .anagrafica").is(":visible")){$(set+" input[name^=nome]").val(value.nome);$(set+" input[name^=cognome]").val(value.cognome);$(set+" input[name^=sesso][value="+value.sesso+"]").click();dataNascita=value.dataNascita.substr(6,2)+"/"+value.dataNascita.substr(4,2)+"/"+value.dataNascita.substr(0,4);if(dataNascita!="//")$(set+" input[name^=dataNascita]").val(dataNascita);$(set+" select[name^=nazioneNascita]").val(value.nazioneNascita);if(value.nazioneNascita==
"ITA"){$(set+" .soloItalia").show();$(set+" select[name^=provinciaNascita]").val(value.provinciaNascita);SHOW.changeComuni($(set+" select[name^=provinciaNascita]"),value.comuneNascita,"select[name^=comuneNascita]")}else $(set+" .soloItalia").hide()}puatdt=$("#puatdt");if(puatdt.length>0&&puatdt.val()=="")puatdt.addClass("error");if(typeof value.error!="undefined")if(value.error.indexOf("|")==-1){$("#errorBox>div").html(value.error);$(set).find("[name^=squadra], [name^=tessera]").addClass("error")}else if($(set+
" .anagrafica").is(":visible")){errori=value.error.split("|");$.each(errori,function(i,v){if(v!="")$(set).find("[name^="+v+"]").parents(".form-group").addClass("has-error has-feedback")})}else if(value.residenza=="")$(set).find("[name^=residenza]").addClass("error")})},resetAnagrafica:function(set){set=set+" .anagrafica";$(set+" input[type=text]").val("");$(set+" select[name^=nazioneNascita]").val("ITA");$(set+".soloItalia").show();$(set+" select[name^=provinciaNascita]").val("");$(set+" select[name^=comuneNascita]").empty();
$(set+" input[name^=sesso][value=M]").prop("checked",true)},resetTessera:function(set){$(set+" .tesseraDelTifoso select").val("");$(set+" .tesseraDelTifoso .squadra option:first").prop("selected",true)},resetScelta:function(set){$(set+" .sceltaTessera input").prop("checked",false)},resetSceltaMinore:function(set){$(set+" .minoreTDT input").prop("checked",false)},mostraPerResidenza:function(set){var val=$(set+" select.residenza").val();if(val==""){$(set+" .minoreTDT").hide();$(set+" .sceltaTessera").hide();
$(set+" .tesseraDelTifoso").hide();$(set+" .anagrafica").hide()}else if($.inArray(val,_data.prTessera)!=-1){$(set+" .sceltaTessera").hide();if(_data.tipoPosto=="FM"){$(set+" .minoreTDT").show();$(set+" .tesseraDelTifoso").hide();$(set+" .anagrafica").hide()}else{$(set+" .minoreTDT").hide();$(set+" .tesseraDelTifoso").show();$(set+" .anagrafica").hide()}}else{$(set+" .minoreTDT").hide();$(set+" .sceltaTessera").show();$(set+" .tesseraDelTifoso").hide();$(set+" .anagrafica").hide()}},mostraPerSceltaTessera:function(set){var val=
$(set+" .sceltaTessera input[type=radio]:checked").val();if(val=="1"){$(set+" .tesseraDelTifoso").show();$(set+" .anagrafica").hide()}else{$(set+" .tesseraDelTifoso").hide();$(set+" .anagrafica").show()}},mostraPerSceltaMinore:function(set){var val=$(set+" .minoreTDT input[type=radio]:checked").val();if(val=="1"){$(set+" .tesseraDelTifoso").hide();$(set+" .anagrafica").show()}else{$(set+" .tesseraDelTifoso").show();$(set+" .anagrafica").hide()}},mostraPerSquadra:function(set){var val=$(set+" select.squadra").val();
if(val==""||val==_data.squadraDiCasa)$(set+" .anagrafica").hide();else{$(set+" .anagrafica").show();$(set+" .anagrafica.soloItalia").show()}}};
SHOW.changeUserTicket={_data:{countryHash:"",regionHash:""},impostaDati:function(options){_data=$.extend(SHOW.SetAnagrafiche._data,options)},impostaSceltaTipo:function(){$(".modeType input[type=radio]").click(function(){if($(this).val()==1){$(".tdtenable").show();$(".ticketenable").hide()}else{$(".tdtenable").hide();$(".ticketenable").show()}})},impostaEventi:function(){SHOW.changeAddressData(_data,"select#NazioneNascita","select#ProvinciaNascita","select#LuogoNascita");if(typeof anaError!="undefined"){errori=
anaError.split("|");$.each(errori,function(i,v){$("#"+v).addClass("error")})}}};
SHOW.emissioneTdT={_data:{countryHash:"",regionHash:""},impostaDati:function(options){_data=$.extend(SHOW.SetAnagrafiche._data,options)},impostaEventiSelezioneTdt:function(){$(".radio.required input[type=radio]").change(function(){$("#submit").val($(this).data("txt"))});$("#requiredcmd input[type=radio]").change(function(){var txt=$("label[for="+$(this).attr("id")+"]").text();$("#submit").val(txt)});$("#fotoValide").dialog({autoOpen:false,modal:true,resizable:false,draggable:false,width:"830px"});
$("#linkFotoValide").click(function(){$("#fotoValide").dialog("open")});$("#frmTdtSelection").submit(function(e){if($("#tdtType").val().length==0){alert(frasi.show["TDTSelect"]);return false}})},caricaFoto:function(){$("#photoPreview").css({width:boxW+"px",height:boxH+"px",top:boxY+"px",left:boxX+"px"});if(photoName!=""){$("