function getInfo(){
var query = (location.href.indexOf("?")+1);
if (query)
{
var code = location.href.substring(query);
// alert(query);
// alert(code);
var siz = code.substring(0, 1);
// alert('size='+siz);
var bod = code.substring(3, 4);
// alert('bod='+bod);
var sel = code.substring(4, 5);
// alert('sel='+sel);
var act = code.substring(6, 10);
// alert('act='+act);
var act2 = code.substring(6, 9);
// alert('act2='+act2);
if (siz == "C"){document.codeform.size[0].checked = 1;}
if (siz == "D"){document.codeform.size[1].checked = 1;}
if (siz == "E"){document.codeform.size[2].checked = 1;}
if (siz == "G"){document.codeform.size[3].checked = 1;}
if (siz == "H"){document.codeform.size[4].checked = 1;}
if (siz == "J"){document.codeform.size[5].checked = 1;}
if (siz == "K"){document.codeform.size[6].checked = 1;}
if (sel == "E"){document.codeform.seal[0].checked = 1;}
if (sel == "V"){document.codeform.seal[1].checked = 1;}
if (bod == "P"){document.codeform.body[0].checked = 1;}
if (bod == "C"){document.codeform.body[1].checked = 1;}
if (act == "06SC"){document.codeform.actuator[0].checked = 1; var acc = code.substring(10);}
if (act == "08SC"){document.codeform.actuator[1].checked = 1; var acc = code.substring(10);}
if (act == "06SO"){document.codeform.actuator[2].checked = 1; var acc = code.substring(10);}
if (act == "08SO"){document.codeform.actuator[3].checked = 1; var acc = code.substring(10);}
if (act2 == "06D"){document.codeform.actuator[4].checked = 1; var acc = code.substring(9);}
if (act2 == "08D"){document.codeform.actuator[5].checked = 1; var acc = code.substring(9);}
if (act2 == "R4A"){document.codeform.actuator[6].checked = 1;}
if (act2 == "R4B"){document.codeform.actuator[7].checked = 1;}
if (act2 == "R4F"){document.codeform.actuator[8].checked = 1;}
if (act2 == "V4A"){document.codeform.actuator[6].checked = 1;}
if (act2 == "V4B"){document.codeform.actuator[7].checked = 1;}
if (act2 == "V4F"){document.codeform.actuator[8].checked = 1;}
if (act2 == "B7A"){document.codeform.actuator[9].checked = 1;}
if ((act2.substring(0, 1) == "M") || (act2.substring(0, 1) == "G")){document.codeform.actuator[10].checked = 1;}
if (acc == "YA"){document.codeform.limit[1].checked = 1;}
if (acc == "UB"){document.codeform.limit[2].checked = 1;}
if (acc == "E3A"){document.codeform.solenoid[1].checked = 1;}
if (acc == "E3AYA"){document.codeform.solenoid[1].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "E3AUB"){document.codeform.solenoid[1].checked = 1;
document.codeform.limit[2].checked = 1;}
if (acc == "E3B"){document.codeform.solenoid[2].checked = 1;}
if (acc == "E3BYA"){document.codeform.solenoid[2].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "E3BUB"){document.codeform.solenoid[2].checked = 1;
document.codeform.limit[2].checked = 1;}
if (acc == "E2A"){document.codeform.solenoid[3].checked = 1;}
if (acc == "E2AYA"){document.codeform.solenoid[3].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "E2AUB"){document.codeform.solenoid[3].checked = 1;
document.codeform.limit[2].checked = 1;}
if (acc == "C3A"){document.codeform.solenoid[1].checked = 1;}
if (acc == "C3AYA"){document.codeform.solenoid[1].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "C3AUB"){document.codeform.solenoid[1].checked = 1;
document.codeform.limit[2].checked = 1;}
if (acc == "C3B"){document.codeform.solenoid[2].checked = 1;}
if (acc == "C3BYA"){document.codeform.solenoid[2].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "C3BUB"){document.codeform.solenoid[2].checked = 1;
document.codeform.limit[2].checked = 1;}
if (acc == "C2A"){document.codeform.solenoid[3].checked = 1;}
if (acc == "C2AYA"){document.codeform.solenoid[3].checked = 1;
document.codeform.limit[1].checked = 1;}
if (acc == "C2AUB"){document.codeform.solenoid[3].checked = 1;
document.codeform.limit[2].checked = 1;}
changeCode();
}
}
function changeCode(){
// clear variables
var baseweight = 0;
var mc = "";
var err = "";
var ser = "";
var psi = "";
var price = "";
var baseweight = 0;
var baseprice = 0;
var basedescrip = "";
var actweight = 0;
var actprice = 0;
var actdescrip = "";
var actvoltage = "";
var failpos = "";
var mountprice = 0;
var mountweight = 0;
var solprice = 0;
var limprice = 0;
var solweight = 0;
var limweight = 0;
var siz = "";
var nqs = "no";
var infotext = "";
var bodymat = "";
var sizedescrip = "";
var condescrip = "";
var infoflo = "";
var sel = "";
var sol = "";
var solt = "";
var solpic = "";
var limpic = "";
var seldescrip = "";
var selprice = 0;
var soldescrip = "";
var solvoltage = "";
var limdescrip = "";
document.codeform.price.value = "";
// get all user selections
if (document.codeform.body[0].checked) {var bod = "P"; var bodymat = "PVC"};
if (document.codeform.body[1].checked) {var bod = "C"; var bodymat = "CPVC"};
if (document.codeform.size[0].checked) {var siz = "C"; var sizedescrip = "1/2"};
if (document.codeform.size[1].checked) {var siz = "D"; var sizedescrip = "3/4 inch"};
if (document.codeform.size[2].checked) {var siz = "E"; var sizedescrip = "1 inch"};
if (document.codeform.size[3].checked) {var siz = "G"; var sizedescrip = "1 1/2 inch"};
if (document.codeform.size[4].checked) {var siz = "H"; var sizedescrip = "2 inch"};
if (document.codeform.size[5].checked) {var siz = "J"; var sizedescrip = "3 inch"};
if (document.codeform.size[6].checked) {var siz = "K"; var sizedescrip = "4 inch"};
// Seat Material ---------------------------
if (document.codeform.seal[0].checked) {var sel = "E"; var seldescrip = "EPDM"};
if (document.codeform.seal[1].checked) {var sel = "V"; var seldescrip = "Viton"};
// Actuators ---------------------------
// Pneumatic actuators
if (document.codeform.actuator[0].checked) {var act = "08SC"; var actpic = "08S"; var failpos = " (Fail to CLOSED)"; var psi = "80"; var solt="E"};
if (document.codeform.actuator[1].checked) {var act = "06SC"; var actpic = "08S"; var failpos = " (Fail to CLOSED)"; var psi = "60"; var solt="E"};
if (document.codeform.actuator[2].checked) {var act = "08SO"; var actpic = "08S"; var failpos = " (Fail to OPEN)"; var psi = "80"; var solt="E"};
if (document.codeform.actuator[3].checked) {var act = "06SO"; var actpic = "08S"; var failpos = " (Fail to OPEN)"; var psi = "60"; var solt="E"};
if (document.codeform.actuator[4].checked) {var act = "08D"; var actpic = "08D"; var psi = "80"; var solt="C"};
if (document.codeform.actuator[5].checked) {var act = "06D"; var actpic = "08D"; var psi = "60"; var solt="C"};
// Electric actuators
if (document.codeform.actuator[6].checked) {var act = "R4A"; var actpic = "R4"; var actvoltage = "120 VAC"};
if (document.codeform.actuator[7].checked) {var act = "R4B"; var actpic = "R4"; var actvoltage = "24 VDC"};
if (document.codeform.actuator[8].checked) {var act = "R4F"; var actpic = "R4"; var actvoltage = "12 VDC"};
if (document.codeform.actuator[9].checked) {var act = "B7A"; var actpic = "B7"; var actvoltage = "120 VAC"};
// Manual Handle actuators
if (document.codeform.actuator[10].checked) {var act = "M"; var actpic = "M"};
// Solenoids ---------------------------
if (document.codeform.solenoid[0].checked) {var solc = ""};
if (document.codeform.solenoid[1].checked) {var solc = "3"};
if (document.codeform.solenoid[2].checked) {var solc = "4"};
if (document.codeform.solenoid[3].checked) {var solc = "5"};
if (document.codeform.solenoid[4].checked) {var solc = "6"};
if (document.codeform.solenoid[5].checked) {var solc = "2"};
if (document.codeform.solenoidv[0].checked) {var solv = "A"; var solvoltage="120 VAC"};
if (document.codeform.solenoidv[1].checked) {var solv = "B"; var solvoltage="24 VDC"};
if (document.codeform.solenoidv[2].checked) {var solv = "F"; var solvoltage="12 VDC"};
if (solc!=""){var sol=solt+solc+solv; var solpic=solt+"3";
if (solc=="2"){ var solpic=solt+"2";}
}
// Limit Switches ---------------------------
if (document.codeform.limit[0].checked) {var lim = ""};
if (document.codeform.limit[1].checked) {var lim = "YF"};
if (document.codeform.limit[2].checked) {var lim = "UB"};
// Set correct Solenoid ---------------------------
//
// if ((sol == "E3A") && (actpic == "08D")){
// var sol = "C3A"; var solpic = "C3"
// }
// if ((sol == "E3B") && (actpic == "08D")){
// var sol = "C3B"; var solpic = "C3"
// }
// if ((sol == "E2A") && (actpic == "08D")){
// var sol = "C2A"; var solpic = "C2"
// }
// Check for exceptions ----------------------------------------------------------
// Remove Solenoid valves from Manual & Electric Actuators
if ((act == "M" || actpic == "R4" || actpic == "B7") && (sol != "")){
alert('Solenoid Valves are only for use on Pneumatic Actuators.\rThe solenoid valve will be reset to NONE.');
document.codeform.solenoid[0].checked = 1;
var sol = "";
var solpic = ""
}
// Alert for Explosion Proof Solenoid & Limit Switch
if ((lim != "") && (sol == "E2A" || sol == "C2A")){
alert('Explosion Proof Limit Switches are not QuickShip items but are available.\r\rPlease call 1-800-899-0553 for price and availability.');
var price = "call 1-800-899-0553"
}
// Remove Limit Switch for Electric Actuators
if ((lim != "") && (actpic == "R4" || actpic == "B7")){
alert('All electric actuators include position switches.\rThe Limit Switch will be reset to NONE.');
document.codeform.limit[0].checked = 1;
var lim = ""
}
// Remove Limit switches for Manual Actuators
if ((act == "M") && (lim != "")){
alert('Limit switches are only for use with Pneumatic Actuators.\rThe limit switch will be reset to NONE.');
document.codeform.limit[0].checked = 1;
var lim = ""
}
// Set correct Electric Actuator ---------------------------
var eact = act.substring(0, 2);
if ((eact == "R4") && (siz == "C" || siz == "D" || siz == "E")){
var eact2 = act.substring(2);
var act = "V4"+eact2; var actpic = "V4"
}
// Set correct MANUAL HANDLE ---------------------------
if ((act == "M") && (siz == "N" || siz == "O" || siz == "P")){
var act = "G"; var actpic="G"}
// Set model code & pic variables ---------------------------
var pmc = ""+act+sol+lim;
var pic = bod+actpic+solpic+lim;
var mc = siz+"PB"+bod+sel+"X"+act+sol+lim;
// Set Prices -----------------------------------------------
var baseprice = eval('baseprice_'+bod+siz);
var baseweight = eval('baseweight_'+bod+siz);
var mountprice = eval(siz+'PBPMK_price');
var mountweight = eval(siz+'PBPMK_weight');
if (siz == "K" && actpic != "R4"){
var mountprice = KBMK_price;
var mountweight = KBMK_weight;}
if (act == "B7A"){
var mountprice = eval(siz+'BMK_price');
var mountweight = eval(siz+'BMK_weight');}
if (act=="06SO" || act=="06SC"){
var actprice = eval('SR6_'+bod+siz+'[1]'); var actweight = eval('SR6_'+bod+siz+'[2]'); var actdescrip = eval('SR6_'+bod+siz+'[3]')+" "+failpos}
if (act=="08SO" || act=="08SC"){
var actprice = eval('SR8_'+bod+siz+'[1]'); var actweight = eval('SR8_'+bod+siz+'[2]'); var actdescrip = eval('SR8_'+bod+siz+'[3]')+" "+failpos}
if (act=="06D"){
var actprice = eval('DA6_'+bod+siz+'[1]'); var actweight = eval('DA6_'+bod+siz+'[2]'); var actdescrip = eval('DA6_'+bod+siz+'[3]')+" "+failpos}
if (act=="08D"){
var actprice = eval('DA8_'+bod+siz+'[1]'); var actweight = eval('DA8_'+bod+siz+'[2]'); var actdescrip = eval('DA8_'+bod+siz+'[3]')+" "+failpos}
if (act=="R4A" || act == "V4A"){
var actprice = eval('EN4A_'+bod+siz+'[1]'); var actweight = eval('EN4A_'+bod+siz+'[2]'); var actdescrip = eval('EN4A_'+bod+siz+'[3]')+" "+actvoltage}
if (act=="R4B" || act=="R4F" || act == "V4B" || act == "V4F"){
var actprice = eval('EN4B_'+bod+siz+'[1]'); var actweight = eval('EN4B_'+bod+siz+'[2]'); var actdescrip = eval('EN4B_'+bod+siz+'[3]')+" "+actvoltage}
if (act=="B7A"){
var actprice = eval('EXPA_'+bod+siz+'[1]'); var actweight = eval('EXPA_'+bod+siz+'[2]'); var actdescrip = eval('EXPA_'+bod+siz+'[3]')+" "+actvoltage}
if (act=="M"){
var actprice = eval('MAN_'+bod+siz+'[1]'); var actweight = eval('MAN_'+bod+siz+'[2]'); var actdescrip = eval('MAN_'+bod+siz+'[3]');
var mountprice = 0;
var mountweight = 0;}
// solenoid pricing, weight, & description
if (sol !=''){
var solbeg2 = sol.substring(0, 2);
var solprice = eval('sol_'+solt+solc+'_price');
var solweight = eval('sol_'+solt+solc+'_weight');
var soldescrip = (eval('sol_'+solt+solc+'_descrip'))+" "+solvoltage;
}
// limit switch pricing, weight, & description
if (lim =='YF'){
var limprice = YF_price;
var limweight = YF_weight;
var limdescrip = YF_descrip;
}
if (lim =='UB'){
var limprice = UB_price;
var limweight = UB_weight;
var limdescrip = UB_descrip;
}
// viton pricing
if (sel =='V'){
var selprice = eval('vitonseal_'+bod+siz);
}
// TOTAL PRICE
var price = Math.round(baseprice+actprice+mountprice+solprice+limprice+selprice);
// TOTAL WEIGHT
var weight = baseweight+actweight+mountweight+solweight+limweight;
// DESCRIPTIONS
var infotext = " Body Material: "+bodymat+"
"+
" Size & Connection: "+sizedescrip+" "+condescrip+"
"+
" Seats: "+seldescrip+"
"+
" Actuator: "+actdescrip;
if (psi != "") {
var infotext = infotext +"
(sized for using "+psi+"psi supply air in applications up to 300psi DP)";}
var infotext = infotext + "
";
// " Flow Plan: "+infoflo+"
"+
if (soldescrip != "") {
var infotext = infotext +"Actuator Solenoid: "+soldescrip+"
";}
if (limdescrip != "") {
var infotext = infotext +"Limit Switch: "+limdescrip+"
";}
if (siz == ""){var pic = "E8S"; var price = ""; var mc = "Select Size"}
document.codeform.price.value = price;
document.codeform.modelcode.value = mc;
document.codeform.imgsrc.value = "/PBV/models/"+pic+".jpg";
document.codeform.id.value = mc;
document.codeform.info.value = infotext;
document.codeform.weight.value = weight;
document.codeform.prodname.value = 'PBV Series';
document.codeform.prodseries.value = 'Plastic ('+bodymat+') 2-way Ball Valves';
var summary = 'price = base:'+baseprice+' act:'+actprice+' mount:'+mountprice+' sol:'+solprice+' lim:'+limprice;
var summary = summary + '\r\rweight = base:'+baseweight+' act:'+actweight+' mount:'+mountweight+' sol:'+solweight+' lim:'+limweight;
// ------------------------------------------------------------------------
// alert(summary);
var imgbl = new Image();
imgbl.src = "models/"+pic+".jpg";
document.images[ "mainimg" ].src = eval( "imgbl.src" )
}
function add2cart(){
if((document.codeform.price.value!="call 1-800-899-0553")&&(document.codeform.modelcode.value!="Select Size")){
var PN = document.codeform.modelcode.value;
document.location="http://www.goemerchant1.com/index.cgi?ST=buy&Action=add&Merchant=assuredautomation&ItemNumber="+PN
}else{
if (document.codeform.price.value=="call 1-800-899-0553"){
alert('This model not available for online ordering.\rplease call 1-800-899-0553 to order.')}
if (document.codeform.modelcode.value=="Select Size"){alert('Please Select Size,\rand specify all options')}
}
}