/******************************************************************************/ // This File gets the contents for the ListBoxes Plate, Make, Model, // Fuel, Doors and Body. // The Functions are at the bottom of this File. /*****************************************************************************/ var models = ''; var types = ''; $(document).ready(function() { $("#btnSendMail").click(function(e) { e.preventDefault(); var frm = document.getElementById('btnSendMail').form; if(!frm) { return; } var x = $("#frm_result_email").val(); var send_ok = frm.etgDomElement != null && frm.etgDomElement.validateSubmit(); var sess = get_query("sess"); var frm_result_email = $("#frm_result_email").val(); var el = document.getElementById('frm_result_email'); // Anzeige des Progess-gif, während der Verarbeitung des Mails. //var progresspath = '/app/plugin_uc/img/all/progressindicator.gif'; if (send_ok) { dom.setLoadingElement(el); } if (send_ok) { $.post("http://www.schwacke.de/app/plugin_uc/_src/email_newcws.php",{sess:sess, frm_result_email:frm_result_email}, function(j){ /*alert(j);*/ numbers = domDebug.extractAjaxRequest(j).split('#'); sent = numbers[0]; maximum = numbers[1]; stopsend = numbers[2]; dom.setLoadingElement(el, false); $("#frm_result_email").attr("style", "color:#FF0000;"); if(stopsend == '1') { if (parseInt(sent) == parseInt(maximum)) { dom.setInfoElement(el, 'max. zu versendeten E-Mails erreicht', 10000); } else { dom.setInfoElement(el, 'max. zu versendeten E-Mails erreicht', 10000); } } else { dom.setInfoElement(el, 'E-Mail wurde versendet', 10000); } }); } }); $("#frm_result_email").focus(function(e) { $("#frm_result_email").val(""); $("#frm_result_email").attr("style", "color:#00529F;"); }); /************************************************************************************/ //alert(); /**************************************/ // Enter bei Kilometerfeld unterdrücken /**************************************/ //$("#UCmileage").bind("keypress", function(event){ //if (event.keyCode == 13){return false;} //}); // ... und bei "Gutschein einlösen" $("#voucher").bind("keypress", function(event){ if (event.keyCode == 13){return false;} }); //$("#app_table").hide(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype"); }else{ UCvtype = 10; } if($("#UCyy").val() != -1 && $("#UCmm").val() != -1 && $("#UCyy").val() != null && $("#UCmm").val() != null){ $("#UCmake").attr("disabled",""); getMake(); }else if(($("#plate").val() != -1 && $("#plate").val() != null && $("#plate").val() != '' ) || ( get_query('plate') != '' && get_query('plate') != null && get_query('plate') != -1)){ $("#UCmake").attr("disabled",""); if($("#UCregion").val() != ''){ }else{ getMake(); } }else{ $("#UCmake").attr("disabled","disabled"); } $("#app_progress").hide(); $("#app_progress_index").hide(); getPlate(get_query('plate')); /****************************************************************/ // Marke gewählt, restliche Auswahllisten füllen und aktivieren /****************************************************************/ $("#UCmake").change(function(e) { e.preventDefault(); self.focus(); $("#app_bubble_wrapper").hide(); //$.ajaxTimeout( 3000 ); getModel($("#UCmake").val(), $("#plate").val()); getFueltype('','','',0); getBodytype('','','',0); getDoors('','','',0); getTrim('','','',0); getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),'','','','','','',$("#plate").val()); //$.ajaxTimeout( 0 ); }); /***********************/ // Model geändert /***********************/ $("#UCmodel").change(function(e) { e.preventDefault(); self.focus(); $("#UCfueltype").attr("disabled",""); $("#UCbodytype").attr("disabled",""); $("#UCdoors").attr("disabled",""); $("#UCTrim").attr("disabled",""); var sess = get_query("sess"); if (sess == null){sess = ''} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); // Wenn $_glo_market == "UK", // müssen Datum und Monat aus der Plate-Listbox gefiltert werden. if (UCyy == null && UCmm == null) { var dat = $("#plate").val().split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCmodel = $("select#UCmodel").val(); var UCdoors = $("select#UCdoors").val(); var UCTrim = $("select#UCTrim").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} var plate = get_query("plate") if (plate == null || plate == -1) { plate = $("#plate").val(); } getFueltype('',$("#UCmake").val(),$("#UCmodel").val(),0); getBodytype('',$("#UCmodel").val(),$("#UCmake").val(),0); getDoors('',$("#UCmodel").val(),$("#UCmake").val(),0); getTrim('',$("#UCmodel").val(),$("#UCmake").val(),0); getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),'','','','','','',$("#plate").val()); UCTrim = '-1'; // Typen werden auf der Startseite (Home) nicht geladen. // Nur auf der Startseite UC var str = window.location; var reg = new RegExp("index.php"); if (reg.test(str)){ } else{ // ----------------------------------------------------------------------------- // Code Added for Htaccess- CHG-00000034063 on Feb 02/2011 // ----------------------------------------------------------------------------- getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, '', '', '', '',$("#plate").val(), '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); // getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, '', '', '', '',plate, '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); // ----------------------------------------------------------------------------- // Code End for Htaccess- CHG-00000034063 on Feb 02/2011 // ----------------------------------------------------------------------------- } }); /*******************************/ // Kraftstofftyp geändert /*******************************/ $("#UCfueltype").change(function(e) { e.preventDefault(); self.focus(); var sess = get_query("sess"); if (sess == null){sess = ''} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); // Wenn $_glo_market == "UK", // müssen Datum und Monat aus der Plate-Listbox gefiltert werden. if (UCyy == null && UCmm == null) { var dat = $("#plate").val().split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select#UCmodel").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} getBodytype('',$("#UCmodel").val(),$("#UCmake").val(),0); getDoors('',$("#UCmodel").val(),$("#UCmake").val(),0); getTrim('',$("#UCmodel").val(),$("#UCmake").val(),0); getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),$("#UCfueltype").val(),$("#UCbodytype").val(),$("#UCdoors").val(),$("#UCTrim").val(),'','',$("#plate").val()); UCbodytype = '-1'; UCdoors = '-1'; UCTrim = '-1'; var str = window.location; var reg = new RegExp("index.php"); if (reg.test(str)){ }else{ getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, UCfueltype, UCbodytype, UCdoors, $("#UCTrim").val(), $("#plate").val(), '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } }); /**********************************************/ // Aufbautyp geändert /**********************************************/ $("#UCbodytype").change(function(e) { e.preventDefault(); self.focus(); var sess = get_query("sess"); if (sess == null){sess = ''} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); // Wenn $_glo_market == "UK", // müssen Datum und Monat aus der Plate-Listbox gefiltert werden. if (UCyy == null && UCmm == null) { var dat = $("#plate").val().split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select#UCmodel").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} getDoors('', $("#UCmodel").val(), $("#UCmake").val(), 0); getTrim('',$("#UCmodel").val(),$("#UCmake").val(),0); getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),$("#UCfueltype").val(),$("#UCbodytype").val(),$("#UCdoors").val(),$("#UCTrim").val(),'','',$("#plate").val()); UCdoors = '-1'; UCTrim = '-1'; var str = window.location; var reg = new RegExp("index.php"); if (reg.test(str)){ }else{ getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, UCfueltype, UCbodytype, UCdoors, UCTrim, $("#plate").val(), '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } }); /**********************************************/ // Doors geändert /**********************************************/ $("#UCdoors").change(function(e) { e.preventDefault(); self.focus(); var sess = get_query("sess"); if (sess == null){sess = ''} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); // Wenn $_glo_market == "UK", // müssen Datum und Monat aus der Plate-Listbox gefiltert werden. if (UCyy == null && UCmm == null) { var dat = $("#plate").val().split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select#UCmodel").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} // getBodytype('',$("#UCmodel").val(),$("#UCmake").val(),0); // getFueltype('',$("#UCmake").val(),$("#UCmodel").val(),0); getTrim('',$("#UCmodel").val(),$("#UCmake").val(),0); getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),$("#UCfueltype").val(),$("#UCbodytype").val(),$("#UCdoors").val(),$("#UCTrim").val(),'','',$("#plate").val()); UCTrim = '-1'; var str = window.location; var reg = new RegExp("index.php"); if (reg.test(str)){ }else{ getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, $("#UCfueltype").val(), $("#UCbodytype").val(), $("#UCdoors").val(), $("#UCTrim").val(), $("#plate").val(), '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } }); /**********************************************/ // Trim geändert /**********************************************/ $("#UCTrim").change(function(e) { e.preventDefault(); self.focus(); var sess = get_query("sess"); if (sess == null){sess = ''} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); // Wenn $_glo_market == "UK", // müssen Datum und Monat aus der Plate-Listbox gefiltert werden. if (UCyy == null && UCmm == null) { var dat = $("#plate").val().split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select#UCmodel").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} getCounter('','',$("#UCmake").val(),$("#UCyy").val(),$("#UCmm").val(),$("#UCmodel").val(),$("#UCfueltype").val(),$("#UCbodytype").val(),$("#UCdoors").val(),$("#UCTrim").val(),'','',$("#plate").val()); var str = window.location; var reg = new RegExp("index.php"); if (reg.test(str)){ }else{ getTypes(UCvtype, sess, UCmake, UCyy, UCmm, UCmodel, $("#UCfueltype").val(), $("#UCbodytype").val(), $("#UCdoors").val(), $("#UCTrim").val(), $("#plate").val(), '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } }); /************************************/ // Jahr geändert /************************************/ $("#UCyy").change(function(e) { e.preventDefault(); self.focus(); //alert('YY change'); $("#app_bubble_wrapper").hide(); var sess = get_query("sess"); var l = get_query("l"); if (sess == null){sess = ''} if (l == null){l = 'de'} var selkfz = get_query('selkfz'); var UCyy = $("select#UCyy").val(); //alert(UCyy); if('1') { var server_red='cws-live'; if($("#UCyy").val()== "redirectde" && $("#UCmm").val() !='-1' && $("#UCyy").val() !='-1') { if(server_red == "cws-dev") { document.getElementById('UCyy').value = -1; window.open("http://cws-dev-new2.freienbach.eurotax.ch/various/help.php#5","_blank"); exit; } else if(server_red == "cws-stage") { document.getElementById('UCyy').value = -1; window.open("http://cws-stage-new2.eurotaxglass.com/various/help.php#5","_blank"); exit; } else { document.getElementById('UCyy').value = -1; window.open("http://www.schwacke.de/various/help.php#5","_blank"); exit; } } } var UCmm = $("select#UCmm").val(); if('') { getMonth_cz(); } var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select[@name='UCmodel']:selected").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} $("#pModels").html(''); if (selkfz != 'y'){ if ($("#UCmm").val() != -1 && $("#UCyy").val() != -1){ $("#UCmake").attr("disabled",""); getMake();} else{ $("#UCmake").attr("disabled","disabled");} } $("#pModels").html(''); $("#UCmodel").html(''); if($("#UCmake").val() != '-1'){ getFueltype('','',''); getBodytype('','',''); getDoors('','',''); getTrim('','',''); } $("#UCmodel").attr("disabled","disabled"); $("#UCfueltype").attr("disabled","disabled"); $("#UCbodytype").attr("disabled","disabled"); $("#UCdoors").attr("disabled","disabled"); $("#UCTrim").attr("disabled","disabled"); //------------------------------------------------------------------------------------ // The code is added to resolve ticket #INC-00001996993 // Checking that the element exist before performing any action to avoid javascript // error //------------------------------------------------------------------------------------- // if(document.getElementById('UCmake')) { // for(xx in document.getElementById('UCmake').$events) { if(xx == 'change') { for(xxx in document.getElementById('UCmake').$events[xx]) { document.getElementById('UCmake').$events[xx][xxx](e); } //document.getElementById('UCmake').$events[xx](e); } } } }); /*******************************************/ // Monat geändert /*******************************************/ $("#UCmm").change(function(e) { e.preventDefault(); self.focus(); $("#app_bubble_wrapper").hide(); var sess = get_query("sess"); var l = get_query("l"); if (sess == null){sess = ''} if (l == null){l = 'de'} var selkfz = get_query('selkfz'); var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select[@name='UCmodel']:selected").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} if (selkfz != 'y'){ if($("#UCyy").val() != -1 && $("#UCmm").val() != -1){ $("#UCmake").attr("disabled",""); getMake();} else{ $("#UCmake").attr("disabled","disabled");} } $("#pModels").html(''); $("#UCmodel").html(''); if($("#UCmake").val() != '-1'){ getFueltype('','',''); getBodytype('','',''); getDoors('','',''); getTrim('','',''); } if('1') { $("#UCyy").attr("disabled","disabled"); getYear(); } if('') { // $("#UCyy").attr("disabled","disabled"); // getMonth_cz(); } $("#UCmodel").attr("disabled","disabled"); $("#UCfueltype").attr("disabled","disabled"); $("#UCbodytype").attr("disabled","disabled"); $("#UCdoors").attr("disabled","disabled"); $("#UCTrim").attr("disabled","disabled"); }); /********************************************/ // NUR Uk // Plate geändert /********************************************/ $("#plate").change(function(e) { e.preventDefault(); $("#app_bubble_wrapper").hide(); var l = get_query("l"); var sess = get_query("sess"); if (sess == null){sess = ''} if (l == null){l = 'de'} var UCmake = $("select#UCmake").val(); var UCmileage = $("#UCmileage").val(); var UCfueltype = $("select#UCfueltype").val(); if (UCfueltype == null){UCfueltype = '';} var UCbodytype = $("select#UCbodytype").val(); if (UCbodytype == null){UCbodytype = '';} var UCdoors = $("select#UCdoors").val(); if (UCdoors == null){UCdoors = '';} var UCTrim = $("select#UCTrim").val(); if (UCTrim == null){UCTrim = '';} var UCmodel = $("select[@name='UCmodel']:selected").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} var dat = $("#plate").val().split(';'); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); $("#pModels").html(''); if ($("#plate").val() == '-1'){ $("#UCmake").attr("disabled", "disabled")} else{ getMake();} getModel($("#UCmake").val(), $("#plate").val()); if($("#UCmake").val() != '-1'){ getFueltype('','',''); getBodytype('','',''); getDoors('','',''); getTrim('','',''); } $("#UCmodel").attr("disabled","disabled"); $("#UCfueltype").attr("disabled","disabled"); $("#UCbodytype").attr("disabled","disabled"); $("#UCdoors").attr("disabled","disabled"); $("#UCTrim").attr("disabled","disabled"); }); //$('#optionpaging').pager('div'); /*************************************************************************************/ // Dieser Teil steuert das Verhalten, wenn bereits auf der Startseite Werte erfasst // Und der "GO"-Button geklickt wurde. // In diesem Fall wird auf die Startseite UC weitergeleitet und die Typen angezeigt. // Variante mit Monat, Jahr, Marke, Modell, Kilometer if (get_query("UCmake") != null && get_query("UCmake") != "" || get_query("UCmodel") != null && get_query("UCmodel") != "") { $("#UCfueltype").attr("disabled",""); $("#UCbodytype").attr("disabled",""); $("#UCdoors").attr("disabled",""); $("#UCTrim").attr("disabled",""); var plate = get_query("plate"); var vtype = get_query("UCvtype"); var sess = get_query("sess"); var make = get_query("UCmake"); /**************************************************/ // For Debuging /**************************************************/ /*log("ready make:"+make); var arrtmp = document.forms[0].options; var tmps = $("#UCmake").val(); log("selindx value:"+tmps); log("option length:"+arrtmp.length);*/ /*for (i = 0; i < arrtmp.length; i++) { if (arrtmp[i].value == make) { log("test selected:"+document.forms["UCVal"]["UCmake"][i].selected);// = true; } else { log("no match"); } }*/ //$("#UCmake option:first").attr("selected","selected"); /*$("#UCmake option").each( function(i) { if ($(this).attr("selected")=="selected") { var gd = i; log(gd); } });*/ //document.forms["UCVal"]["UCmake"][2].selected = true; /**********************************************************/ if (get_query("UCyy") != '' && get_query("UCyy") != null && get_query("UCyy") != 'undefined'){ var yy = get_query("UCyy");} else{ var yy = '';} if (get_query("UCmm") != '' && get_query("UCmm") != null && get_query("UCmm") != 'undefined'){ var mm = get_query("UCmm");} else{ var mm = '';} var model = get_query("UCmodel"); var fuel = get_query("UCfueltype"); var body = get_query("UCbodytype"); var doors = get_query("UCdoors"); var trim = get_query("UCTrim"); var year = get_query("UCyy"); getMake(); if('1') { getYear(); } getModel(get_query("UCmake"), plate); getFueltype(get_query("UCfueltype"), get_query("UCmake"), get_query("UCmodel"),1); getBodytype(get_query("UCbodytype"), get_query("UCmodel"), get_query("UCmake"),1); getDoors(get_query("UCdoors"), get_query("UCmodel"), get_query("UCmake"),1); //if we want to show the types over the cardata selection we need to comment out the if condition if($("#UCmodel").val()==-1 && get_query("UCmodel")!=""){ getTrim(get_query("UCTrim"), get_query("UCmodel"), get_query("UCmake"),1); getTypes(vtype, sess, make, yy, mm, model, fuel, body, doors, trim, plate, '', '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } getCounter(vtype,sess,make,yy,mm,model,fuel,body,doors,trim,'','',plate); } // Varianten mit Fahrzeugschein/Typenschein if (get_query("natcode") != null) { var natcode = get_query("natcode"); var vtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ vtype = get_query("UCvtype");} else{ vtype = 10;} var sess = get_query("sess"); var make = get_query("UCmake"); var yy = get_query("UCyy"); var mm = get_query("UCmm") var model = get_query("UCmodel"); var fuel = get_query("UCfueltype"); var body = get_query("UCbodytype"); var doors = get_query("UCdoors"); var trim = get_query("UCTrim"); getTypes(vtype, sess, make, yy, mm, model, fuel, body, doors, trim, '', natcode, '', '', get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion"), get_query("new_natcode"), get_query("new_mm"), get_query("new_yy")); } if (get_query("hsn") != null) { var hsn = get_query("hsn"); var tsn = get_query("tsn"); var vtype = get_query("UCvtype"); var sess = get_query("sess"); var make = get_query("UCmake"); var yy = get_query("UCyy"); var mm = get_query("UCmm") var model = get_query("UCmodel"); var fuel = get_query("UCfueltype"); var body = get_query("UCbodytype"); var doors = get_query("UCdoors"); var trim = get_query("UCTrim"); getModel(get_query("UCmake"), plate); getFueltype(get_query("UCfueltype"), get_query("UCmake"), get_query("UCmodel")); getBodytype(get_query("UCbodytype"), get_query("UCmodel"), get_query("UCmake")); getDoors(get_query("UCdoors"), get_query("UCmodel"), get_query("UCmake")); getTrim(get_query("UCTrim"), get_query("UCmodel"), get_query("UCmake")); getTypes(vtype, sess, make, yy, mm, model, fuel, body, doors, trim,'', '', hsn, tsn, get_query("selkfz"), get_query("UCnumberplate"), get_query("selschild"), get_query("UCregion")); } /************************************************************************************/ // Varianten mit Autonummer if (get_query("UCnumberplate") != null) { var UCnumberplate = get_query("UCnumberplate"); var vtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ vtype = get_query("UCvtype");} else{ vtype = 10;} var sess = get_query("sess"); var make = get_query("UCmake"); var yy = get_query("UCyy"); var mm = get_query("UCmm") var model = get_query("UCmodel"); var fuel = get_query("UCfueltype"); var body = get_query("UCbodytype"); var doors = get_query("UCdoors"); var trim = get_query("UCTrim"); var selkfz = get_query("selkfz"); var selschild = get_query("selschild"); var UCregion = get_query("UCregion"); var new_natcode = get_query("new_natcode"); var new_mm = get_query("new_mm"); var new_yy = get_query("new_yy"); getTypes(vtype, sess, make, yy, mm, model, fuel, body, doors, trim, '', '', '', '', selkfz, UCnumberplate, selschild, UCregion, new_natcode, new_mm, new_yy); } /************************************************************************************/ /************************************************************************************/ // Hier folgt die Kontrolle, wenn auf der Resultseite ein Mail versendet wird. // - Die E-Mail Adresse muss korrekt formatiert sein. // - Es darf nur eine e-Mail Adresse eingegeben werden. // - Nach erreichen der max. Versandanzahl muss der Go-Button inaktiv gesetzt werden. /************************************************************************************/ /**************************************/ // Enter bei Mail-Adressfeld unterdrücken /**************************************/ $("#frm_result_email").bind("keypress", function(event){ if (event.keyCode == 13){return false;} }); /************************************************************************************/ // SPECIAL XMAS-PROMO // Hier folgt die Kontrolle, wenn auf der Resultseite ein Mail versendet wird. // - Die E-Mail Adresse muss korrekt formatiert sein. // - Es darf nur eine e-Mail Adresse eingegeben werden. // - Nach erreichen der max. Versandanzahl muss der Go-Button inaktiv gesetzt werden. /************************************************************************************/ /**************************************/ // Enter bei Mail-Adressfeld unterdrücken /**************************************/ $("#re_email").bind("keypress", function(event){ if (event.keyCode == 13){return false;} }); $("#btnSendMailXmas").click(function(e) { e.preventDefault(); var frm = document.getElementById('btnSendMailXmas').form; if(!frm) { return; } var x = $("#re_email").val(); var send_ok = frm.etgDomElement != null && frm.etgDomElement.validateSubmit(); var sess = get_query("sess"); var re_email = $("#re_email").val(); var re_name = $("#re_name").val(); var se_name = $("#se_name").val(); var se_txt = $("#se_txt").val(); var el = document.getElementById('re_email'); // Anzeige des Progess-gif, während der Verarbeitung des Mails. //var progresspath = '/app/plugin_uc/img/all/progressindicator.gif'; if (send_ok) { dom.setLoadingElement(el); } if (send_ok) { $.post("http://www.schwacke.de/app/plugin_uc/_src/xmas_email.php",{sess:sess, re_email:re_email, re_name:re_name, se_name:se_name, se_txt:se_txt}, function(j){ /*alert(j);*/ numbers = domDebug.extractAjaxRequest(j).split('#'); sent = numbers[0]; maximum = numbers[1]; stopsend = numbers[2]; dom.setLoadingElement(el, false); $("#re_email").attr("style", "color:#FF0000;"); if(stopsend == '1') { if (parseInt(sent) == parseInt(maximum)) { dom.setInfoElement(el, 'max. zu versendeten E-Mails erreicht', 10000); } else { dom.setInfoElement(el, 'max. zu versendeten E-Mails erreicht', 10000); } } else { dom.setInfoElement(el, 'E-Mail wurde versendet', 10000); } }); } }); $("#re_email").focus(function(e) { $("#re_email").val(""); $("#re_email").attr("style", "color:#00529F;"); }); /************************************************************************************/ }); function getModel(make, plate, natcode, hsn, tsn) { $("#UCmodel").attr("disabled",""); var sess = get_query("sess"); var selectedModel = get_query("UCmodel"); var l = get_query("l"); if (sess == null){sess = ''} if (l == null){l = 'de'} var UCyy = $("select#UCyy").val(); var UCmm = $("select#UCmm").val(); var UCmake = make; var string = $("#UCmileage").val(); var string1 = string.replace(new RegExp(',', 'g'), ''); var UCmileage = string1.replace(new RegExp('.', 'g'), ''); var UCfueltype = '-1'; var UCbodytype = '-1'; var UCdoors = '-1'; var UCTrim = '-1'; var plate = plate; var natcode = natcode; var hsn = hsn; var tsn = tsn; if (UCyy == null && UCmm == null) { var dat = plate.split(';'); UCyy = dat[0].substr(0,4); UCmm = dat[0].substr(4,2); var yy_s = dat[0].substr(0,4); var mm_s = dat[0].substr(4,2); } var UCmodel = $("#UCmodel").val(); var UCvtype; if (get_query("UCvtype") != '' && get_query("UCvtype") != null){ UCvtype = get_query("UCvtype");} else{ UCvtype = 10;} //showProgress(); //set model as loading dom.setLoadingElement(document.getElementById('UCmodel'), true); $("#pModels").html(''); $.post("./app/plugin_uc/_src/getModel.php",{l:l, UCvtype: UCvtype, sess: sess, UCmake: UCmake, UCyy: UCyy, UCmm: UCmm, UCmileage: UCmileage, UCfueltype: UCfueltype, UCbodytype: UCbodytype, UCdoors: UCdoors, UCTrim: UCTrim, plate: plate, selectedModel: selectedModel}, function(j){ models = domDebug.extractAjaxRequest(j); //alert(models); var srch = models; models = models.replace( /_/g, ""); /*$("#app_progress").html(''); $("#app_progress").hide(); $("#app_progress_index").html(''); $("#app_progress_index").hide();*/ $("#UCmodel").html(models); dom.setLoadingElement(document.getElementById('UCmodel'), false); // Dieser Code ist notwendig, damit im FireFox das übergebene Model selektiert wird srch = srch.replace( /