function selectModel(pn) {
var size = pn.substr(0, 7);
var access = pn.substr(7);
// alert(size);
// alert(voltage);
var extras = pn.substr(9);
// alert(extras);
//----------------------------------- SELECT SIZE ----------------------------
if (size == "EV1S1V1") {
document.codeform.size[0].checked=true;
}
if (size == "EV1S3V8") {
document.codeform.size[1].checked=true;
}
if (size == "EV1S3V9") {
document.codeform.size[2].checked=true;
}
if (size == "EV3S2V1") {
document.codeform.size[3].checked=true;
}
if (size == "EV3S1V1") {
document.codeform.size[4].checked=true;
}
if (size == "EV3S3V8") {
document.codeform.size[5].checked=true;
}
if (size == "EV3S3V9") {
document.codeform.size[6].checked=true;
}
//----------------------------------- Just C2 ----------------------------
if (access.length == 2 || access.length == 11) {
document.codeform.xs.checked=true;
showHideAccess('xs');
}
if (access.length == 11 || access.length == 9) {
document.codeform.mod.checked=true;
showHideAccess('mod');
//----------------------------------- C2 & T1 ----------------------------
if (access.length == 11) {
var type = access.substr(5);
alert(type);
if (type == "EP420C") {
document.codeform.posType[0].checked=true;
}
if (type == "EP420O") {
document.codeform.posType[0].checked=true;
document.codeform.modHigh.checked = true;
}
if (type == "EP010C") {
document.codeform.posType[1].checked=true;
}
if (type == "EP010O") {
document.codeform.posType[1].checked=true;
document.codeform.modHigh.checked = true;
}
}
//----------------------------------- Just T1 ----------------------------
if (access.length == 9) {
var type = access.substr(3);
alert(type);
if (type == "EP420C") {
document.codeform.posType[0].checked=true;
}
if (type == "EP420O") {
document.codeform.posType[0].checked=true;
document.codeform.modHigh.checked = true;
}
if (type == "EP010C") {
document.codeform.posType[1].checked=true;
}
if (type == "EP010O") {
document.codeform.posType[1].checked=true;
document.codeform.modHigh.checked = true;
}
}
}
changeCode();
}
function changeCode() {
// set vars that don't change and initialize others
var voltage = "";
var size = "";
var solCon = "";
var actDescrip = "Actuator Type: Low-Cost, Compact, Industrial Electric, Quarter-turn
Enclosure: Epoxy coated aluminum cover and zinc alloy base
Electrical Connection: One 1/2" NPT with pre-wired leads";
var sizeDescrip = "";
var sealDescrip = "";
var limDescrip = "";
var posDescrip = "";
var solConDescrip = "";
var solVoltDescrip = "";
var solTypeDescrip = "";
var solRatingDescrip = "";
var accessDescrip = ""; // ----------- actuator accesories on assembly
var accessoryDescrip = ""; // ------- accesories that ship loose
var voltDescrip= "";
var actpic = "";
var solpic = "";
var limpic = "";
var pospic = "";
var failPos = "";
var modDescrip = "";
var xsDescrip = "";
var modFail = "";
var modSig = "";
var modSignal = "";
var mod = "";
var xs = "";
var torque = "";
var accPrice = 0;
var priceSum = "Pricing:";
var weightSum = "Weight:";
var limPrice = 0;
var limWeight = 0;
var solPrice = 0;
var solWeight = 0;
var posPrice = 0;
var posWeight = 0;
var price = 0;
var accessPrice = 0;
var accessoryPrice = 0;
var assemblyWeight = 0;
var accessWeight = 0;
var accessoryWeight = 0;
var actcad = "";
var S4mod = "";
var S4bat = "";
var S4din = "";
var s4kitName = "";
var step1summary = "";
var step2summary = "";
var step3summary = "";
var alertNote = "";
// ====================== reset classes of all selection divs and table cells to UN-selected state
resetSizeDivs();
// ================= reset summary boxes ==========================
document.getElementById('priceSummary').innerHTML = "Error!";
document.getElementById('weightSummary').innerHTML = "Error!";
// ================================================ SIZE ====================================================
if (document.codeform.size[0].checked) { document.getElementById('size1').className="selectionChecked"; var siz = "EV1S1V1"; var torque = "125"; var ISO = "F03/05"; var stem = "14"; var speed = "3"; var voltDescrip = "120VAC"; var duty = "75";
}
if (document.codeform.size[1].checked) { document.getElementById('size2').className="selectionChecked"; var siz = "EV1S3V8"; var torque = "125"; var ISO = "F03/05"; var stem = "14"; var speed = "3"; var voltDescrip = "12VDC"; var duty = "100";
}
if (document.codeform.size[2].checked) { document.getElementById('size3').className="selectionChecked"; var siz = "EV1S3V9"; var torque = "125"; var ISO = "F03/05"; var stem = "14"; var speed = "3"; var voltDescrip = "24VDC"; var duty = "100";
}
if (document.codeform.size[3].checked) { document.getElementById('size4').className="selectionChecked"; var siz = "EV3S2V1"; var torque = "300"; var ISO = "F03/05"; var stem = "14"; var speed = "7"; var voltDescrip = "120VAC"; var duty = "25";
}
if (document.codeform.size[4].checked) { document.getElementById('size5').className="selectionChecked"; var siz = "EV3S1V1"; var torque = "300"; var ISO = "F03/05"; var speed = "7"; var stem = "14"; var voltDescrip = "120VAC"; var duty = "75";
}
if (document.codeform.size[5].checked) { document.getElementById('size6').className="selectionChecked"; var siz = "EV3S3V8"; var torque = "300"; var ISO = "F03/05"; var speed = "6"; var stem = "14"; var voltDescrip = "12VDC"; var duty = "100";
}
if (document.codeform.size[6].checked) { document.getElementById('size7').className="selectionChecked"; var siz = "EV3S3V9"; var torque = "300"; var ISO = "F03/05"; var speed = "6"; var stem = "14"; var voltDescrip = "24VDC"; var duty = "100";
}
// ================================================= OPTIONS =============================================
if (document.codeform.xs.checked) {
// alert('Xtra switches');
var xsDescrip = "Extra Switches: 2 extra SPDT limit switches";
}
// ================================================= ACTUATORS =============================================
var sizeDescrip = "Torque: "+torque+" in/lbs.";
var voltDescrip = "Voltage: "+voltDescrip;
var isoDescrip = "Direct Mount Valve Mounting Pattern: "+ISO;
var stemDescrip = "Stem Square: "+stem + "mm";
var speedDescrip = "Speed: "+speed+" sec.";
var dutyDescrip = "Duty Cycle: "+duty+"%";
var limitDescrip = "Limit Switches: Two end of travel, non-isolated contacts";
var step1summary = actDescrip + "
" + sizeDescrip + "
" + limitDescrip + "
" + voltDescrip + "
" + dutyDescrip + "
" + isoDescrip + "
" + stemDescrip + "
" + speedDescrip;
if (xsDescrip != "") {
}
if (xsDescrip != "") {
var step2summary = xsDescrip;
var xs = "C2";
}
document.getElementById('step1summary').innerHTML = step1summary;
// ======================================================== SET step 2 summary ==================================================
var actDescrip = "Actuator: "+actDescrip+" ("+siz+")";
if (accessoryDescrip != "") {
if (step2summary != "") {
var step2summary = step2summary + "
" + accessoryDescrip;
} else {
var step2summary = accessoryDescrip;
}
}
if (step2summary == "") {
var step2summary = "none selected";
}
document.getElementById('step2summary').innerHTML = step2summary;
// =========================================================== SET MODEL CODE =============================================
var mc=siz+xs;
var CADmc=siz;
var pic = "V4";
document.getElementById('PN').innerHTML =mc;
document.codeform.id.value=mc;
document.getElementById('MClinks').innerHTML =mc;
document.getElementById('mainIMG').src = "/V4-electric-actuators/models/V4.jpg";
document.codeform.imgsrc.value="/V4-electric-actuators/models/V4.jpg";
//----------- SET Dimension & Wiring Diagram PAGE =-=-------------------------
document.codeform.wireDiagPage.value = "/literature/V4_datasheet.pdf#page=2";
document.codeform.dimPage.value = "/literature/V4_datasheet.pdf#page=2";
// document.codeform.CADmc.value=CADmc;
// =========================================================== SET PRICING =============================================
var qty = document.codeform.qty.value;
// ACTUATOR =--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
var actName = siz;
var actPrice = eval(actName+".price");
var actWeight = eval(actName+".weight");
var priceSum = priceSum + "
Actuator Price: "+actPrice+" ("+actName+")";
var weightSum = weightSum + "
Actuator: "+actWeight+" ("+actName+")";
if (document.codeform.xs.checked) {
var priceSum = priceSum + "
V2X (2 xtra SPDT): "+V2X.price+" (V2X)";
var weightSum = weightSum + "
V2X (2 xtra SPDT): "+V2X.weight+" (V2X)";
var actPrice = actPrice + V2X.price;
var actWeight = actWeight + V2X.weight;
}
// LABOR =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
var fullPrice = Math.ceil(actPrice);
var fullWeight = Math.ceil(actWeight);
document.getElementById('price').innerHTML = fullPrice;
document.codeform.price.value=fullPrice;
document.codeform.weight.value=fullWeight;
document.getElementById('priceSummary').innerHTML = priceSum;
document.getElementById('weightSummary').innerHTML = weightSum+"
TOTAL: "+fullWeight+" lbs.";
var totalPrice = (fullPrice + accessoryPrice) * qty;
document.getElementById('totalPrice').innerHTML = totalPrice;
// =========================================================== SET DESCRIPTION =============================================
var fullSummary = step1summary;
if (step2summary != "none selected") {
var fullSummary = step1summary + "
" + step2summary; // + "
"; + step3summary;
}
if (alertNote != "") {
//alert('oooooops');
var fullSummary = fullSummary + "
" + alertNote;
}
document.getElementById('fullSummary').innerHTML = fullSummary;
document.codeform.info.value=fullSummary;
if (accessoryPrice != 0) {
document.getElementById('accessoryPriceText').style.display="block";
document.getElementById('accessoryPrice').innerHTML=accessoryPrice;
document.getElementById('accessorySummary').innerHTML=accessoryDescrip;
} else {
document.getElementById('accessoryPriceText').style.display="none";
}
}
// ================================================== END OF MAIN changecode FUNCTION ============================================================
// ============================================================= OTHER FUNCTIONS =========================================================
function addToCart() {
document.codeform.submit();
// alert ('not quite yet... need to add in pricing');
}
function showHideAccess(item) {
if (document.getElementById(item+"BOX").style.display == "none") {
document.getElementById(item+"BOX").style.display = "block";
document.getElementById(item+"HEAD").className = "accessHeadOpen";
document.getElementById(item).checked = 1;
} else {
document.getElementById(item+"BOX").style.display = "none";
document.getElementById(item+"HEAD").className = "accessHead";
document.getElementById(item).checked = 0;
}
}
function resetSizeDivs() {
document.getElementById('size1').className="selection";
document.getElementById('size2').className="selection";
document.getElementById('size3').className="selection";
document.getElementById('size4').className="selection";
document.getElementById('size5').className="selection";
document.getElementById('size6').className="selection";
document.getElementById('size7').className="selection";
}
function closeStep(step) {
document.getElementById('step'+step+'close').style.display="none";
document.getElementById('step'+step+'edit').style.display="block";
document.getElementById('step'+step+'section').style.display="none";
document.getElementById('step'+step+'summary').style.display="block";
}
function editStep(step) {
document.getElementById('step'+step+'close').style.display="block";
document.getElementById('step'+step+'edit').style.display="none";
document.getElementById('step'+step+'section').style.display="block";
document.getElementById('step'+step+'summary').style.display="none";
}