var Config = new ConfiguratoreErP(); var Database = null; var fnStep1,caldaia1; var fnStep2,caldaia2; var fnStep3,crono; var fnStep4,pannello,bollitore; var fnStep5; var bufferII; var sessionID = 0; function start() { setTimeout( function() { Config.setup( { preview1: document.getElementById("pnlPreview1"), preview2: document.getElementById("pnlPreview2"), callback: function() { Database = Config.getDatabase(); document.getElementById("pnlMain").style.display = "block"; document.getElementById("pnlLoader").style.display = "none"; setup_gui_caldaia(1); setup_gui_caldaia(2); setup_gui_crono(); setup_gui_solare(); setup(); } }); }); } function setup_gui_caldaia(id) { var pnl = document.getElementById("input_panel_"+id); var i,arr = Database.getGamme(); for( i=0; i" + obj.getDescrizione() + ""; } fnStep1 = function() { setup_menu_item( 1 ); } fnStep2 = function() { document.getElementById("input_value_caldaia1").innerHTML = getThumb(caldaia1); bufferII = caldaia1.getDescrizione(); setup_menu_item( 2 ); } function noCaldaia2() { caldaia2 = null; fnStep3(); } fnStep3 = function() { document.getElementById("input_value_caldaia2").innerHTML = ( caldaia2 != null ? getThumb(caldaia2) : "" ); if( caldaia2 != null ) { bufferII += " / " + caldaia2.getDescrizione(); } document.getElementById("input_panel_4_NoComandoRemoto").style.display = ( caldaia1.isCityBox() || caldaia1.isCityOpen() ? "none" : "block" ); setup_menu_item( 3 ); var pnl = document.getElementById("pnlCrono1"); pnl.style.display = ( caldaia1.isCityBox() || caldaia1.isCityOpen() || ( caldaia2 != null && ( caldaia2.isCityBox() || caldaia2.isCityOpen() )) ? "none" : "inline-block" ); } function noComandoRemoto() { crono = null; fnStep4(); } fnStep4 = function() { document.getElementById("input_value_crono").innerHTML = (crono != null ? getThumb(crono) : ""); if( crono != null ) { bufferII += " / " + crono.getDescrizione(); } setup_menu_item( 4 ); var pnlNoContributo = document.getElementById("input_panel_4_NoContributo") var pnlDefault = document.getElementById("input_panel_4_Default") var pnlTimeSolar = document.getElementById("input_panel_4_TimeSolar") if( caldaia1.isTimeSolar() ) { pnlNoContributo.style.display = "none"; pnlDefault.style.display = "none"; pnlTimeSolar.style.display = "block"; var i; var arr = Database.getPannelli(); for( i=0; i6 ) { alert("Selezionare il numero di pannelli solari (1-6)"); return; } fnStep5(qta); } function fnStep5( qta ) { setup_menu_item( 5 ); if( qta > 0 ) { var pnl = document.getElementById("input_value_pannello"); if( caldaia1.isTimeSolar() ) { var i,arr = Database.getPannelli(); for( i=0; i[ x" + qta + " ]"; bufferII += " / " + pannello.getDescrizione() + " [x" + qta + "]"; } else { pnl.innerHTML = getThumb(pannello) + "
[ x" + qta + " ]
" + ( bollitore != null ? getThumb(bollitore) : "" ); bufferII += " / " + pannello.getDescrizione() + " [x" + qta + "]"; if( bollitore != null ) { bufferII += " / " + bollitore.getDescrizione(); } } if( pannello != null ) { pannello.setQta( qta ); } } calcola(); } function setup_menu_item( id ) { var i; for( i=1; i<5; i++ ) { document.getElementById("menu_label_" +i).className = "menu_label_" + ( i==id ? "enabled" : "disabled" ); document.getElementById("input_panel_" +i).style.display = ( i==id ? "block" : "none" ); } } function calcola() { var etichetta = Config.calcola(caldaia1,caldaia2,crono,pannello,bollitore,bufferII); document.getElementById("pnlDownload").style.display = "block"; document.getElementById("lnkSchedaSanitario").style.display = ( etichetta.isSingola() ? "none" : "block" ); } /* function start() { setTimeout( function() { Config.setup( { preview1: document.getElementById("pnlPreview1"), preview2: document.getElementById("pnlPreview2"), callback: function() { document.getElementById("pnlLoading").style.display = "none"; document.getElementById("pnlMain").style.display = "block"; Database = Config.getDatabase(); var cb1 = document.getElementById("cbGamme"); var cb2 = document.getElementById("cbGamme2"); var i,items = Database.getGamme(); for( i=0; i 0 && !caldaia.isTimeSolar() ); document.getElementById("lblPannello").style.display = ( isEnabled ? "inline" : "none" ); document.getElementById("cbPannelli").style.display = ( isEnabled ? "inline" : "none" ); //document.getElementById("pnlTipoImpianto").style.display = ( isEnabled ? "inline" : "none" ); refreshBollitori(); } } function refreshBollitori() { var qta = Database.getQta(); var pannello = Database.getPannello(); var show = false; if( qta != null && pannello != null ) { var caldaia = Database.getGamma().getCaldaia(); show = (qta>0 && (pannello.isTecnoSolar() || !caldaia.isTimeSolar() )); } document.getElementById("lblBollitore").style.display = ( show ? "inline" : "none" ); document.getElementById("cbBollitori").style.display = ( show ? "inline" : "none" ); } function calcola() { var gamma = null; var caldaia = null; var caldaia2 = null; var crono = null; var qta = null; var pannello = null; var bollitore = null; var tipoImpiantoSanitario = true; gamma = Database.getGamma(); if( gamma == null ) { alert("Selezionare la gamma"); return; } caldaia = gamma.getCaldaia(); if( caldaia == null ) { alert("Selezionare la caldaia preferenziale"); return; } gamma = Database.getGamma2(); if( gamma != null ) { caldaia2 = gamma.getCaldaia2(); } crono = Database.getCronoComando(); if( crono == null ) { alert("Selezionare il cronocomando"); return; } qta = Database.getQta(); if( qta == null ) { alert("Quantità non valida"); return; } if( qta>0 ) { pannello = Database.getPannello(); if( pannello == null ) { alert("Selezionare il pannello"); return; } if( pannello.isTecnoSolar() ) { bollitore = Database.getBollitore(); if( bollitore == null ) { alert("Selezionare il bollitore"); return; } } tipoImpiantoSanitario = Database.isTipoImpiantoSanitario() if( tipoImpiantoSanitario == null ) { alert("Selezionare il tipo di impianto"); return; } } alert( caldaia.getDescrizione() + "\n" + ( caldaia2 != null ? caldaia2.getDescrizione() + "\n" : "" ) + crono.getDescrizione() + "\n" + qta + "\n" + ( pannello != null ? pannello.getDescrizione() + "\n" + (bollitore != null ? bollitore.getDescrizione() : "[no bollitore]") : "[no pannello]" ) ); var label = Config.calcola(caldaia,crono,qta,pannello,bollitore,caldaia2); //alert( label ); } function noCaldaiaSecondaria() { var cb = document.getElementById("cbModelli2") cb.selectedIndex = -1; } */