var pemsatl_msf = { getTimestamp : function() { let date = new Date(); let y = date.getUTCFullYear(); let m = date.getUTCMonth()+1; m = '0' + m; m = m.slice(-2); let d = date.getUTCDate(); d = '0' + d; d = d.slice(-2); let hrs = date.getUTCHours(); hrs = '0' + hrs; hrs = hrs.slice(-2); let mins = date.getUTCMinutes(); mins = '0' + mins; mins = mins.slice(-2); let timestamp = `[${y}-${m}-${d}][${hrs}:${mins}]`; return timestamp; },
sections : [ 'pemsatl_msf-section-customer-contactinformation', 'pemsatl_msf-section-competitiveinformation', 'pemsatl_msf-section-purpose', 'pemsatl_msf-section-identification', 'pemsatl_msf-section-specifications-critical', 'pemsatl_msf-section-specifications-frame_or_diameter', 'pemsatl_msf-section-specifications-shaft', 'pemsatl_msf-section-specifications-rpmorpoles', 'pemsatl_msf-section-specifications-additional', 'pemsatl_msf-section-specifications-wiring', 'pemsatl_msf-section-specifications-bearings', 'pemsatl_msf-section-explosionproof', 'pemsatl_msf-section-mountingposition', 'pemsatl_msf-section-brakemotor', 'pemsatl_msf-section-spaceheater', 'pemsatl_msf-section-RTDs', 'pemsatl_msf-section-TStats', 'pemsatl_msf-section-additionalinformation-quantity', 'pemsatl_msf-section-additionalinformation-notesquestionscomments', 'pemsatl_msf-section-reviewsubmit' ],
section_index : 0,
gotoSection : function(target_section=0) {
this.initialize();
let errormessage = '';
if(target_section < 0) errormessage += 'Error: gotoSection() failed. Target index less than 0\n'; if(target_section > this.sections.length) errormessage += 'Error: gotoSection() failed. Target index larger than sections.length\n';
if(errormessage.trim().length > 0) { alert(errormessage); return false; }
let from_id = this.sections[this.section_index]; let to_id = this.sections[target_section];
let from_section = document.getElementById(from_id); let to_section = document.getElementById(to_id);
from_section.classList.add('pemsatl_msf-section-hidden'); to_section.classList.remove('pemsatl_msf-section-hidden');
this.section_index = target_section;
window.scrollTo(0, 0); },
gotoPreviousSection : function() { this.gotoSection(this.section_index-1); },
gotoNextSection : function() { this.gotoSection(this.section_index+1); },
validate_purpose : function() { let errormessage = ''; let purpose = document.getElementById('pemsatl_msf-input-purpose').value.trim(); if( ! purpose.length > 0) errormessage += 'Error: Purpose is required. Please enter the motor\'s purpose to continue';
if(errormessage.trim().length) { alert(errormessage); return false; }
return true; },
validate_getstarted : function() { let errormessage = ''; let accountnumber = document.getElementById('pemsatl_msf-input-accountnumber').value.trim(); if( ! accountnumber.length > 0) errormessage += 'Error: Account Number is required. Please enter an account number to continue';
if(errormessage.trim().length > 0) { alert(errormessage); return false; }
return true; },
validate_contactinformation : function() { let name = document.getElementById('pemsatl_msf-input-customercontactinformation-name').value.trim(); let email = document.getElementById('pemsatl_msf-input-customercontactinformation-email').value.trim();
let errormessage = '';
if( ! name.length > 0) errormessage += 'Error: Name is required to continue.\n'; if( ! email.length > 0) errormessage += 'Error: Email is required to continue.\n';
if(errormessage.trim().length > 0) { alert(errormessage); return false; }
return true; },
validate_specificationscritical : function() { let powerfactor = document.getElementById('pemsatl_msf-input-specifications-critical-powerfactor').value.trim();
let horsepower = document.getElementById('pemsatl_msf-input-specifications-critical-hp').value.trim(); let watts = document.getElementById('pemsatl_msf-input-specifications-critical-watts').value.trim(); let kilowatts = document.getElementById('pemsatl_msf-input-specifications-critical-kilowatts').value.trim();
let electricaltype = document.getElementById('pemsatl_msf-input-specifications-critical-electricaltype').value.trim(); let voltage = document.getElementById('pemsatl_msf-input-specifications-critical-voltage').value.trim(); let amperage = document.getElementById('pemsatl_msf-input-specifications-critical-amperage').value.trim(); let enclosure = document.getElementById('pemsatl_msf-input-specifications-critical-enclosure').value.trim();
let errormessage = '';
if( powerfactor.localeCompare('HP') == 0) { if( ! horsepower.length > 0) { errormessage += '\nError: Horsepower is required to continue.'; } } if( powerfactor.localeCompare('Watts') == 0 ) { if( ! watts.length > 0) { errormessage += '\nError: Watts is required to continue.'; } } if( powerfactor.localeCompare('Kilowatts') == 0) { if( ! kilowatts.length > 0) { errormessage += '\nError: Kilowatts is required to continue.'; } }
if( ! electricaltype.localeCompare('Select One')) errormessage += '\nError: Electrical Type is required to continue.'; if( ! voltage.length > 0) errormessage += '\nError: Voltage is required to continue.'; if( ! enclosure.length > 0) errormessage += '\nError: Enclosure is required to continue.';
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_frame_or_diameter : function() { let frame = document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-frame').value.trim(); let diameter = document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-diameter').value.trim();
let errormessage = ''; if( ! frame.length > 0 ) { if( ! diameter.length > 0) { errormessage += 'Error: Either frame or diameter is required to proceed.\n'; } }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_shaft : function() { let frame = document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-frame').value.trim(); let isZFrame = frame.substring(frame.length - 1).toUpperCase().localeCompare('Z') == 0; let shaftdiameter = document.getElementById('pemsatl_msf-input-specifications-shaft-diameter').value.trim(); let shaftlength = document.getElementById('pemsatl_msf-input-specifications-shaft-length').value.trim(); let errormessage = '';
if(isZFrame) { if( ! shaftdiameter.length > 0 || ! shaftlength.length > 0) errormessage += 'Error: Shaft dimensions required when a Z frame motor is specified.\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_rpmorpoles : function() { let rpm = document.getElementById('pemsatl_msf-input-specifications-rpm').value.trim(); let poles = document.getElementById('pemsatl_msf-input-specifications-poles').value.trim();
let errormessage = '';
if( ! rpm.length > 0 ) { if( ! poles.length > 0) { errormessage += 'Error: RPM or poles is required.\n'; } }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_brakemotor : function() { let checkbox = document.getElementById('pemsatl_msf-input-brakemotor-checkbox'); let errormessage = '';
if(checkbox.checked) { let torque = document.getElementById('pemsatl_msf-input-brakemotor-torque').value.trim(); let voltage = document.getElementById('pemsatl_msf-input-brakemotor-voltage').value.trim();
if( ! torque.length > 0) errormessage += 'Error: Brake torque is required when motor requires a brake\n'; if( ! voltage.length > 0) errormessage += 'Error: Brake voltage is required when motor requires a break\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_RTDs : function() { let checkbox = document.getElementById('pemsatl_msf-input-RTDs-checkbox'); let errormessage = '';
if(checkbox.checked) { let rtds = document.getElementById('pemsatl_msf-input-RTDs').value.trim(); if( ! rtds.length > 0) errormessage += 'Error: RTDs is required if the checkbox is marked as yes.\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_TStats : function() { let checkbox = document.getElementById('pemsatl_msf-input-TStats-checkbox'); let errormessage = '';
if(checkbox.checked) { let tstats = document.getElementById('pemsatl_msf-input-TStats').value.trim(); if( ! tstats.length > 0) errormessage += 'Error: TStats is required if the checkbox is marked as yes.\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_spaceheater : function() { let checkbox = document.getElementById('pemsatl_msf-input-spaceheater-checkbox'); let errormessage = '';
if(checkbox.checked) { let voltage = document.getElementById('pemsatl_msf-input-spaceheater-voltage').value.trim();
if( ! voltage.length > 0) errormessage += 'Error: Space heater voltage is required when motor is a space heater motor\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
validate_verticalhollowshaft : function() {
let mountingposition = this.getRadioValue('pemsatl_msf-conduitboxposition-radio').trim();
if( mountingposition.substring(0,1).localeCompare('W') == 0 ) { if( parseInt(mountingposition.substring(1)) >= 5 ) { let checkbox = document.getElementById('pemsatl_msf-input-verticalhollowshaft-checkbox'); let errormessage = '';
if(checkbox.checked) { let basediameter = document.getElementById('pemsatl_msf-motor-vertialhollowshaftmotors-basediameter').value.trim(); let couplingboresize = document.getElementById('pemsatl_msf-motor-vertialhollowshaftmotors-couplingboresize').value.trim(); let steadybushingrequired = document.getElementById('pemsatl_msf-motor-vertialhollowshaftmotors-steadybushingrequired').value.trim(); let thrustrequirement = document.getElementById('pemsatl_msf-motor-vertialhollowshaftmotors-thrustrequirement').value.trim();
if( ! basediameter.length > 0) errormessage += 'Error: Base Diameter is required when motor is a Vertical Hollow Shaft\n'; if( ! couplingboresize.length > 0) errormessage += 'Error: Coupling Bore Size is required when motor is a Vertical Hollow Shaft\n'; if( ! steadybushingrequired.length > 0) errormessage += 'Error: Steady Bushing is required when motor is a Vertical Hollow Shaft\n'; if( ! thrustrequirement.length > 0) errormessage += 'Error: Thrust Requirement is required when motor is a Vertical Hollow Shaft\n';
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; } } }
return true; },
validate_explosionproof : function() { let checkbox = document.getElementById('pemsatl_msf-input-explosionproof-checkbox'); let errormessage = '';
if(checkbox.checked) { let explosionproofclass = document.getElementById('pemsatl_msf-input-explosionproof-class').value.trim(); let groups = document.getElementById('pemsatl_msf-input-explosionproof-groups').value.trim(); let tempcode = document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim();
if( ! explosionproofclass.length > 0) errormessage += 'Error: Class is required when motor is an explosion proof motor\n'; if( ! groups.length > 0) errormessage += 'Error: Groups is required when motor is an explosion proof motor\n'; if( ! tempcode.length > 0) errormessage += 'Error: Temperature code is required when motor is an explosion proof motor\n'; }
if(errormessage.length > 0) { alert(errormessage); return false; }
return true; },
compileoutput : function() {
let timestamp = this.getTimestamp(); let customername = document.getElementById('pemsatl_msf-input-customercontactinformation-name').value.trim(); let customeremail = document.getElementById('pemsatl_msf-input-customercontactinformation-email').value.trim();
let customercontactinformation = { 'Phone' : document.getElementById('pemsatl_msf-input-customercontactinformation-phonenumber').value.trim(), 'Fax' : document.getElementById('pemsatl_msf-input-customercontactinformation-fax').value.trim(), 'Company' : document.getElementById('pemsatl_msf-input-customercontactinformation-company').value.trim(), 'City' : document.getElementById('pemsatl_msf-input-customercontactinformation-city').value.trim(), 'State' : document.getElementById('pemsatl_msf-input-customercontactinformation-state').value.trim() };
let orderdetails = { 'Price' : document.getElementById('pemsatl_msf-input-identification-catalognumber').value.trim(), 'Quantity' : document.getElementById('pemsatl_msf-input-additionalinformation-quantity').value.trim(), 'Notes / Questions / Additional Information' : document.getElementById('pemsatl_msf-input-additionalinformation-notesquestionscomments').value.trim() }
let competitiveinformation = { 'Competitor - Brand' : document.getElementById('pemsatl_msf-input-competitiveinformation-brand').value.trim(), 'Competitor - Price' : document.getElementById('pemsatl_msf-input-competitiveinformation-price').value.trim() };
let motoridentification = { 'Purpose' : document.getElementById('pemsatl_msf-input-purpose').value.trim(), 'Brand' : document.getElementById('pemsatl_msf-input-identification-manufacturerorbrand').value.trim(), 'Model Number' : document.getElementById('pemsatl_msf-input-identification-modelnumber').value.trim(), 'ID Number' : document.getElementById('pemsatl_msf-input-identification-idnumber').value.trim() };
let motorspecifications_explosionproof = { 'Motor Is Explosion Proof Motor' : document.getElementById('pemsatl_msf-input-explosionproof-checkbox').checked, 'Explosion Proof - Class' : document.getElementById('pemsatl_msf-input-explosionproof-class').value.trim(), 'Explosion Proof - Groups' : document.getElementById('pemsatl_msf-input-explosionproof-groups').value.trim(), 'Explosion Proof - Temperature Code' : document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim() };
if( ! motorspecifications_explosionproof['Motor Is Explosion Proof Motor'] ) { delete motorspecifications_explosionproof['Explosion Proof - Class']; delete motorspecifications_explosionproof['Explosion Proof - Groups']; delete motorspecifications_explosionproof['Explosion Proof - Temperature Code']; }
let motorspecifications_mountingposition = { 'Mounting Type' : document.getElementById('pemsatl_msf-input-specifications-mounting-type').value.trim(), 'Mounting Position' : this.getRadioValue('pemsatl_msf-conduitboxposition-radio').trim(), 'Motor Is Vertical Hollow Shaft Motor' : document.getElementById('pemsatl_msf-input-verticalhollowshaft-checkbox').checked, 'Vertical Hollow Shaft - Base Diameter' : document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim(), 'Vertical Hollow Shaft - Coupling Bore Size' : document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim(), 'Vertical Hollow Shaft - Steady Bushing Required' : document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim(), 'Vertical Hollow Shaft - Thrust Requirement' : document.getElementById('pemsatl_msf-input-explosionproof-temperaturecode').value.trim() };
if( ! motorspecifications_mountingposition['Motor Is Vertical Hollow Shaft Motor'] ) { delete motorspecifications_mountingposition['Vertical Hollow Shaft - Base Diameter']; delete motorspecifications_mountingposition['Vertical Hollow Shaft - Coupling Bore Size']; delete motorspecifications_mountingposition['Vertical Hollow Shaft - Steady Bushing Required']; delete motorspecifications_mountingposition['Vertical Hollow Shaft - Thrust Requirement']; }
let motorspecifications_critical = { 'Power Rating Type' : document.getElementById('pemsatl_msf-input-specifications-critical-powerfactor').value.trim(), 'HP' : document.getElementById('pemsatl_msf-input-specifications-critical-hp').value.trim(), 'Watts' : document.getElementById('pemsatl_msf-input-specifications-critical-watts').value.trim(), 'Kilowatts' : document.getElementById('pemsatl_msf-input-specifications-critical-kilowatts').value.trim(), 'Electrical Type' : document.getElementById('pemsatl_msf-input-specifications-critical-electricaltype').value.trim(), 'Voltage' : document.getElementById('pemsatl_msf-input-specifications-critical-voltage').value.trim(), 'Amperage' : document.getElementById('pemsatl_msf-input-specifications-critical-amperage').value.trim(), 'Enclosure' : document.getElementById('pemsatl_msf-input-specifications-critical-enclosure').value.trim() };
switch(motorspecifications_critical['Power Rating Type']) { case 'HP': delete motorspecifications_critical['Watts']; delete motorspecifications_critical['Kilowatts']; break; case 'Watts': delete motorspecifications_critical['HP']; delete motorspecifications_critical['Kilowatts']; break; case 'Kilowatts': delete motorspecifications_critical['HP']; delete motorspecifications_critical['Watts']; break; default: break; }
let motorspecifications_frame_or_diameter = { 'Frame' : document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-frame').value.trim(), 'Diameter' : document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-diameter').value.trim(), 'Diameter UOM' : document.getElementById('pemsatl_msf-input-specifications-frame_or_diameter-diameter-UOM').value.trim() };
if(motorspecifications_frame_or_diameter['Frame'].trim().length > 0) { delete motorspecifications_frame_or_diameter['Diameter']; delete motorspecifications_frame_or_diameter['Diameter UOM']; } else { delete motorspecifications_frame_or_diameter['Frame']; }
let motorspecifications_shaftdimensions = { 'Shaft - Diameter' : document.getElementById('pemsatl_msf-input-specifications-shaft-diameter').value.trim(), 'Shaft - Diameter UOM' : document.getElementById('pemsatl_msf-input-specifications-shaft-diameter-UOM').value.trim(), 'Shaft - Length' : document.getElementById('pemsatl_msf-input-specifications-shaft-length').value.trim(), 'Shaft - Length UOM' : document.getElementById('pemsatl_msf-input-specifications-shaft-length-UOM').value.trim() };
let motorspecifications_rpm_or_poles = { 'RPM' : document.getElementById('pemsatl_msf-input-specifications-rpm').value.trim(), 'Poles' : document.getElementById('pemsatl_msf-input-specifications-poles').value.trim() };
if(motorspecifications_rpm_or_poles['RPM'].trim().length > 0) delete motorspecifications_rpm_or_poles['Poles'];
let motorspecifications_additional = { 'Rotation' : document.getElementById('pemsatl_msf-input-specifications-rotation').value.trim(), 'C-Dimension' : document.getElementById('pemsatl_msf-input-specifications-cDimension').value.trim(), 'IP Rating' : document.getElementById('pemsatl_msf-input-specifications-IPRating').value.trim(), 'Ambient' : document.getElementById('pemsatl_msf-input-specifications-ambient').value.trim(), 'Ambient UOM' : document.getElementById('pemsatl_msf-input-specifications-ambient-UOM').value.trim(), 'NEMA Design' : document.getElementById('pemsatl_msf-input-specifications-NEMADesign').value.trim(), };
let motorspecifications_TStats = { 'Requires TStats' : document.getElementById('pemsatl_msf-input-TStats-checkbox').checked, 'T-Stats' : document.getElementById('pemsatl_msf-input-TStats').value.trim() };
if( ! motorspecifications_TStats['Requires TStats'] ) delete motorspecifications_TStats['T-Stats'];
let motorspecifications_RTDs = { 'Requires RTDs' : document.getElementById('pemsatl_msf-input-RTDs-checkbox').checked, 'RTDs' : document.getElementById('pemsatl_msf-input-RTDs').value.trim() };
if( ! motorspecifications_RTDs['Requires RTDs'] ) delete motorspecifications_RTDs['RTDs'];
let motorspecifications_bearings = { 'Bearings SE' : document.getElementById('pemsatl_msf-input-specifications-bearings-shaftend').value.trim(), 'Bearings OSE' : document.getElementById('pemsatl_msf-input-specifications-bearings-oppositeshaftend').value.trim() };
let motorspecifications_wiring = { 'Wiring' : document.getElementById('pemsatl_msf-motor-wiring').value.trim(), 'VFD Speed Ratio' : document.getElementById('pemsatl_msf-input-specifications-speedratio').value.trim(), 'Would you like a shaft grounding ring?' : document.getElementById('pemsatl_msf-input-shaftgroundingring-details-checkbox').checked, 'Shaft Grounding Ring' : document.getElementById('pemsatl_msf-input-specifications-shaftgroundingring').value.trim() };
if( ! motorspecifications_wiring['Wiring'].trim().localeCompare('VFD') == 0 ) { delete motorspecifications_wiring['VFD Speed Ratio']; delete motorspecifications_wiring['Would you like a shaft grounding ring?']; delete motorspecifications_wiring['Shaft Grounding Ring']; }
let motorspecifications_brake = { 'Motor Requires Brake' : document.getElementById('pemsatl_msf-input-brakemotor-checkbox').checked, 'Brake Torque' : document.getElementById('pemsatl_msf-input-brakemotor-torque').value.trim(), 'Brake Voltage' : document.getElementById('pemsatl_msf-input-brakemotor-voltage').value.trim() };
if( ! motorspecifications_brake['Motor Requires Brake'] ) { delete motorspecifications_brake['Brake Torque']; delete motorspecifications_brake['Brake Voltage']; }
let motorspecifications_spaceheater = { 'Requires Space Heater' : document.getElementById('pemsatl_msf-input-spaceheater-checkbox').checked, 'Space Heater - Voltage' : document.getElementById('pemsatl_msf-input-spaceheater-voltage').value.trim() };
if( ! motorspecifications_spaceheater['Requires Space Heater'] ) delete motorspecifications_spaceheater['Space Heater Voltage'];
let arrays = [ customercontactinformation, orderdetails, competitiveinformation, motoridentification, motorspecifications_explosionproof, motorspecifications_mountingposition, motorspecifications_critical, motorspecifications_frame_or_diameter, motorspecifications_shaftdimensions, motorspecifications_rpm_or_poles, motorspecifications_additional, motorspecifications_TStats, motorspecifications_RTDs, motorspecifications_bearings, motorspecifications_brake, motorspecifications_spaceheater ];
let data = '';
for(let arr in arrays) { for(let attr in arrays[arr]) { data += `${attr}:${'\t'}${arrays[arr][attr]}${'\n'}`; } data += `${'\n'}`; }
let field_timestamp = document.getElementById('wpforms-1549-field_40'); let field_name = document.getElementById('wpforms-1549-field_42'); let field_email = document.getElementById('wpforms-1549-field_43'); let field_data = document.getElementById('wpforms-1549-field_41');
field_timestamp.value = timestamp; field_name.value = customername; field_email.value = customeremail; field_data.value = data; },
getRadioValue : function(name) {
let radios = document.getElementsByName(name);
var value = '';
for(let i=0, z=radios.length; i
Our online web quote form is currently disabled as we investigate a technical issue. Please contact our customer service department at 800-234-5687 for immediate assistance. Thank you.