var dspprod; // For prod window. // 20180409 var popprod; // For prod popup window on mouse over. // 20180409 var winbase = 20; // For prod popup window, beginning of window. // 20180409 var winprev = 0; // For prod popup window, prev cumm of windows. // 20180409 var wintop = 0; // For prod popup window, top of window. // 20180409 var winleft = 10; // For prod popup window, upper left corner. // 20180409 var partwins = 0; // 20180409 var openwins = []; // Keep track of open product windows. // 20180409 var partnums = []; // Keep track of part # windows. // 20180409 $(document).ready(function() { browser = whatBrowser(); if ($("#hasvnotes").val() == 'y') // 20170727 $(".popup").fadeIn("fast"); // 20170727 else // 20170727 $(".popup").hide(); // 20170727 $("select#selyear").unbind('change'); $("select#selyear").on('change', fillMakes); if (browser == 'IE') { $("select#selmake").unbind('click'); $("select#selmake").on('click', fillModels); $("select#selmodel").unbind('click'); $("select#selmodel").on('click', fillBodys); $("select#selbody").unbind('click'); $("select#selbody").on('click', fillEngines); $("select#selengine").unbind('click'); $("select#selengine").on('click',submitForm); } else { $("select#selmake").unbind('change'); $("select#selmake").on('change', fillModels); $("select#selmodel").unbind('change'); $("select#selmodel").on('change', fillBodys); $("select#selbody").unbind('change'); $("select#selbody").on('change', fillEngines); $("select#selengine").unbind('change'); $("select#selengine").on('change',submitForm); } $("#partsinquiry").focusin(function() { // console.log("PIFocus: firstsw:"+$('#firstsw').val()); if ($('#firstsw').val() == '') $("#partsinquiry").submit(); }); }) // END ready function function fillMakes() { var today = new Date(); var yearindex = $("select[name='selyear'] option:selected").val(); var yeartext = $("select[name='selyear'] option:selected").text(); if (yearindex == 'ALL') return false; // alert("YI=" + yearindex + ", Year=" + yeartext); $("select#selmake").removeClass('SelectGray').addClass('SelectFirst'); $("select#selmake").load("es-getmakesbyyear.php", {yearid: yearindex, year: yeartext, ajax: 'true'}, function(resp, stat, xhr) { if (stat == "success") { var sellen = $("#selmake option").length; var optlen = (sellen > 30 ) ? 30 : sellen; // console.log("Make: Sel=" + sellen + ", Opt=" + optlen); $("select#selmake").attr('size', optlen); // $("select#selmake").css('top', '89px'); // $("select#selmake").css('left', '3%'); // $("select#selmake").css('position', 'absolute'); $("select#selmake").attr('size', optlen); $("select#selmake").css('top', '40px'); $("select#selmake").css('position', 'absolute'); $("select#selmake").css('height', 'auto'); } // success }) // ajax function $("select#selmake").removeClass('SelectGray').addClass('SelectFirst'); $("#selyearid").val(yearindex); $("select#selengine").val(''); // 20140120 $("#selengineid").val(0); // 20140120 if ($("select#selmodel").attr('size') > 1) { $("select#selmodel").attr('size', 1); $("select#selmodel").css('position', 'static'); } if ($("select#selbody").attr('size') > 1) { $("select#selbody").attr('size', 1); $("select#selbody").css('position', 'static'); } if ($("select#selengine").attr('size') > 1) { $("select#selengine").attr('size', 1); $("select#selengine").css('position', 'static'); } } // END function fillMakes function fillModels() { var yearindex = $("select[name='selyear'] option:selected").val(); var yeartext = $("select[name='selyear'] option:selected").text(); var makeindex = $("select[name='selmake'] option:selected").val(); var maketext = $("select[name='selmake'] option:selected").text(); // alert("YI=" + yearindex + ", Year=" + yeartext); $("select#selmodel").removeClass('SelectGray').addClass('SelectFirst'); $("select#selmodel").load("es-getmodelsbyyrmk.php", {yearid: yearindex, year: yeartext, makeid: makeindex, make: maketext, ajax: 'true'}, function(resp, stat, xhr) { if (stat == "success") { var sellen = $("#selmodel option").length; var optlen = (sellen > 30 ) ? 30 : sellen; // console.log("Model: Sel=" + sellen + ", Opt=" + optlen); $("select#selmodel").attr('size', optlen); // $("select#selmodel").css('top', '89px'); $("select#selmodel").css('top', '40px'); $("select#selmodel").css('position', 'absolute'); $("select#selmodel").css('height', 'auto'); } // success }) // ajax function $("select#selmodel").removeClass('SelectGray').addClass('SelectFirst'); $("select#selmake").css('position', 'static'); $("select#selmake").attr('size', 1); $("#selmakeid").val(makeindex); $("select#selengine").val(''); // 20140120 $("#selengineid").val(0); // 20140120 if ($("select#selbody").attr('size') > 1) { $("select#selbody").attr('size', 1); $("select#selbody").css('position', 'static'); } if ($("select#selengine").attr('size') > 1) { $("select#selengine").attr('size', 1); $("select#selengine").css('position', 'static'); } } // END function fillModels function fillBodys() { var yearindex = $("select[name='selyear'] option:selected").val(); var yeartext = $("select[name='selyear'] option:selected").text(); var makeindex = $("select[name='selmake'] option:selected").val(); var maketext = $("select[name='selmake'] option:selected").text(); var modelindex= $("select[name='selmodel'] option:selected").val(); var modeltext = $("select[name='selmodel'] option:selected").text(); $("select#selbody").removeClass('SelectGray').addClass('SelectFirst'); // alert("YI=" + yearindex + ", Year=" + yeartext); $("select#selbody").load("es-getbodysbyyrmkmd.php", {yearid: yearindex, year: yeartext, makeid: makeindex, make: maketext, modelid: modelindex, model: modeltext, ajax: 'true'}, function(resp, stat, xhr) { if (stat == "success") { var sellen = $("#selbody option").length; var optlen = (sellen > 30 ) ? 30 : sellen; // console.log("Body: Sel=" + sellen + ", Opt=" + optlen); $("select#selbody").attr('size', optlen); // $("select#selbody").css('top', '89px'); // $("select#selbody").css('right', '3%'); $("select#selbody").css('top', '40px'); $("select#selbody").css('position', 'absolute'); $("select#selbody").css('height', 'auto'); } // success }) // ajax function $("select#selbody").removeClass('SelectGray').addClass('SelectFirst'); $("select#selmodel").css('position', 'static'); $("select#selmodel").attr('size', 1); $("#selmodelid").val(modelindex); $("select#selengine").val(''); // 20140120 $("#selengineid").val(0); // 20140120 if ($("select#selengine").attr('size') > 1) { $("select#selengine").attr('size', 1); $("select#selengine").css('position', 'static'); } } // END function fillBodys function fillEngines() { var yearindex = $("select[name='selyear'] option:selected").val(); var yeartext = $("select[name='selyear'] option:selected").text(); var makeindex = $("select[name='selmake'] option:selected").val(); var maketext = $("select[name='selmake'] option:selected").text(); var modelindex= $("select[name='selmodel'] option:selected").val(); var modeltext = $("select[name='selmodel'] option:selected").text(); var bodyindex = $("select[name='selbody'] option:selected").val(); var bodytext = $("select[name='selbody'] option:selected").text(); // alert("YI=" + yearindex + ", Year=" + yeartext); $("select#selengine").removeClass('SelectGray').addClass('SelectFirst'); $("select#selengine").load("es-getengsbyyrmkmdbs.php", {yearid: yearindex, year: yeartext, makeid: makeindex, make: maketext, modelid: modelindex, model: modeltext, bodyid: bodyindex, body: bodytext, ajax: 'true'}, function(resp, stat, xhr) { if (stat == "success") { var sellen = $("#selengine option").length; var optlen = (sellen > 30 ) ? 30 : sellen; // console.log("Eng: Sel=" + sellen + ", Opt=" + optlen); $("select#selengine").attr('size', optlen); // $("select#selengine").css('top', '89px'); //$("select#selengine").css('right', '3%'); $("select#selengine").css('top', '40px'); $("select#selengine").css('position', 'absolute'); $("select#selengine").css('height', 'auto'); } // success }) // ajax function $("select#selengine").removeClass('SelectGray').addClass('SelectFirst'); $("select#selbody").css('position', 'static'); $("select#selbody").attr('size', 1); $("#selbodyid").val(bodyindex); $("select#selengine").val(''); // 20140120 $("#selengineid").val(0); // 20140120 } // END function fillEngines function submitForm() { var engineindex = $("select[name='selengine'] option:selected").val(); var prevengindex= $("#selengineid").val(); if (engineindex != prevengindex) { $("select#selengine").css('position', 'static'); $("select#selengine").attr('size', 1); $("#submitaction").val('Select'); $("#selengineid").val(engineindex); logEvent('SP', ''); // 20150831 $("#partsinquiry").submit(); } } // END function submitForm function dispImage(stockno, prodtype, fileextn, eatonno, wintype) { // 20180409 var winhgt = 420; // 20180409 var winwid = 600; // 20180409 if (prodtype == "coil") { winhgt = 620; // 20180409 winwid = 600; // 20180409 } else if (prodtype == "leaf") { winhgt = 420; // 20180409 winwid = 650; // 20180409 } else if (prodtype == "shock") { winhgt = 420; // 20180409 winwid = 450; // 20180409 } else if (prodtype == "ikit") { winhgt = 520; // 20180409 winwid = 450; // 20180409 } else if (prodtype == "timbren") { winhgt = 420; // 20180409 winwid = 450; // 20180409 } else if (prodtype == "other") { winhgt = 420; // 20180409 winwid = 450; // 20180409 } var imgname = "pdf/" + prodtype + "/" + stockno + fileextn; getImageAjax(imgname, stockno, eatonno, wintype); // 20180409 return false; } // END dispImage /* function getImageAjax(imgname,stockno,eatonno) { $.ajax( { url : 'es-getimagesize.php', type : 'POST', data : {imgsrc: imgname }, success : function(xhrdata, xhrstatus, xhr) { // console.log ('R=' + xhrdata + ', S=' + xhrstatus); if (xhrstatus == 'success') { resps = xhrdata.split("|"); rinfo = resps[1]; rdata = rinfo.split("~"); if (resps[0] == 'NO') { alert("The Image source was not passed. \n"); } // NF else { // NOT NF - Found body if (resps[0] == 'OK' || resps[0] == 'DF') { imghgt = parseInt(rdata[0]); imgwid = parseInt(rdata[1]); if (imgwid > 0) { winhgt=imghgt + 99; winwid=imgwid + 80; } var winopts = 'status=0,location=0,menubar=0,'+ 'titlebar=0,toolbar=0,top=400,left=10,'+ 'width='+winwid+',height='+winhgt+"'"; // alert("Src:" + imgname + ", Opt:" + winopts); var dispprod = window.open('', "imgwin", winopts); setTimeout(function() { dispprod.document.write('
Vehicle | Dealer | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Year | Make | Model | Body Style | Engine Size | Brochure | |||||||
Coil Springs | Order | EATON No. | Qualifier | P/V | Price | Wt. | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Front Coil springs Vehicle has not been selected | ||||||||||||||
Rear Coil springs Vehicle has not been selected | ||||||||||||||
Note: On orders for non-stock ride height, there is an upcharge per pair of coil springs, applied on the order. | ||||||||||||||
Leaf Springs | Order | EATON No. | Qualifier | Width | Lvs | Rate | P/V | Price | Wt. | |||||
Front Leaf springs Vehicle has not been selected | ||||||||||||||
Rear Leaf springs Vehicle has not been selected | ||||||||||||||
Note: On orders for non-stock ride height, there is an upcharge per pair of leaf springs, applied on the order. | ||||||||||||||
Install Kits | Order | EATON No. | Installation Kit Description | P/V | Price | Wt. | ||||||||
Front Install Kit Vehicle has not been selected | ||||||||||||||
Rear Install Kit Vehicle has not been selected | ||||||||||||||
Shocks | Order | EATON No. | Shock Absorber Description | P/V | Price | Wt. | ||||||||
Front Shocks Vehicle has not been selected | ||||||||||||||
Rear Shocks Vehicle has not been selected | ||||||||||||||
Other Prods | Order | EATON No. | Other Product Description | P/V | Price | Wt. | ||||||||
Other Products Vehicle has not been selected |