$().ready(function(){function a(f,c){var e=0;for(var d=0,b=c.length;d<b;d++){if(f==c[d]){e=d}else{if(f>c[d]){e=d}else{break}}}return e}$(".printLinkTrans").click(function(b){window.open("/calculator/print-material-handling/","sac","width=860,height=400,scrollbars=yes,resizable=yes")});$("#calcSelect").change(function(c){var b=$(c.target).val();if(b==""){$(".calcClass").hide()}else{$(".calcClass").hide();$("#"+b).show()}});$("#roi .calc_button").click(function(l){var k=$("#purchase_price").val();var i=$("#avg_cost").val();var n=$("#hours").val();var j=$("#rate").val();var c=$("#selling_price").val();if(k==""){$("#purchase_price").addClass("formCalcError");alert("You must provide a Purchase Price");$("#purchase_price").focus();return false}else{if(k!=""&&isNaN(k)){$("#purchase_price").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#purchase_price").focus();return false}else{$("#purchase_price").removeClass("formCalcError")}}if(i==""){$("#avg_cost").addClass("formCalcError");alert("You must provide an Average Cost of Operation");$("#avg_cost").focus();return false}else{if(i!=""&&isNaN(i)){$("#avg_cost").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#avg_cost").focus();return false}else{$("#avg_cost").removeClass("formCalcError")}}if(n==""){$("#hours").addClass("formCalcError");alert("You must provide the Operating Hours");$("#hours").focus();return false}else{if(n!=""&&isNaN(n)){$("#hours").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#hours").focus();return false}else{$("#hours").removeClass("formCalcError")}}if(j==""){$("#rate").addClass("formCalcError");alert("You must provide the Production Rate");$("#rate").focus();return false}else{if(j!=""&&isNaN(j)){$("#rate").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#rate").focus();return false}else{$("#rate").removeClass("formCalcError")}}if(c==""){$("#selling_price").addClass("formCalcError");alert("You must provide the Product Selling Price");$("#selling_price").focus();return false}else{if(c!=""&&isNaN(c)){$("#selling_price").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#selling_price").focus();return false}else{$("#selling_price").removeClass("formCalcError")}}var k=(k!="")?parseFloat(k):0;var i=(i!="")?parseFloat(i):0;var n=(n!="")?parseFloat(n):0;var j=(j!="")?parseFloat(j):0;var c=(c!="")?parseFloat(c):0;var g=n*j;$("#production").val(g.toFixed(2));var f=c*g;$("#production_value").val(f.toFixed(2));var d=i*n;$("#operating_cost").val(d.toFixed(2));var b=f-d;$("#net_income").val(b.toFixed(2));var m=b-k;$("#net_roi_year").val(m.toFixed(2));var h=m/g;$("#net_roi_ton").val(h.toFixed(2))});$("#discharge .calc_button").click(function(f){var c=$("#discharge_length").val();var b=$("#discharge_angle").val();if(c==""){$("#discharge_length").addClass("formCalcError");alert("You must provide the Discharge Length");$("#discharge_length").focus();return false}else{if(c!=""&&isNaN(c)){$("#discharge_length").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#discharge_length").focus();return false}else{$("#discharge_length").removeClass("formCalcError")}}if(b==""){$("#discharge_angle").addClass("formCalcError");alert("You must provide the Discharge Length");$("#discharge_angle").focus();return false}else{if(b!=""&&isNaN(b)){$("#discharge_angle").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#discharge_angle").focus();return false}else{$("#discharge_angle").removeClass("formCalcError")}}var c=(c!="")?parseFloat(c):0;var b=(b!="")?parseFloat(b):0;var d=Math.round(c*Math.sin(b*Math.PI/180)+2);$("#discharge_height").val(d)});$("#stockpile .calc_button").click(function(h){var b=$("#stockpile_length").val();var k=$("#stockpile_angle").val();var i=$("#stockpile_travel").val();if(b==""){$("#stockpile_length").addClass("formCalcError");alert("You must provide the Conveyor Length");$("#stockpile_length").focus();return false}else{$("#stockpile_length").removeClass("formCalcError")}if(k==""){$("#stockpile_angle").addClass("formCalcError");alert("You must provide the Angle of Inclination");$("#stockpile_angle").focus();return false}else{$("#stockpile_angle").removeClass("formCalcError")}if(i==""){$("#stockpile_travel").addClass("formCalcError");alert("You must provide the Degrees of Radial Travel");$("#stockpile_travel").focus();return false}else{if(i!=""&&isNaN(i)){$("#stockpile_travel").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#stockpile_travel").focus();return false}else{$("#stockpile_travel").removeClass("formCalcError")}}var b=+(b);var k=+(k);var i=+(i);var m=Math.sin(k*Math.PI/180)*b+2;$("#stockpile_pile_height").val(Math.round(m));var j=m/Math.tan(37.5*Math.PI/180)*2;$("#stockpile_d").val(Math.round(j));var c=0.066*(Math.pow(m,3));$("#stockpile_conical_volume").val(Math.round(c));var l=c*1.35;$("#stockpile_conical_volume_pcf").val(Math.round(l));var g=c+((Math.pow(m,2)*(Math.cos(k*Math.PI/180)*b)*0.00084246)*i);$("#stockpile_radial_volume").val(Math.round(g));var f=g*1.35;$("#stockpile_radial_volume_pcf").val(Math.round(f))});$("#super_stacker .calc_button").click(function(j){var c=$("#super_stacker_length").val();var f=$("#super_stacker_pile_type").val();var g=$("#super_stacker_travel").val();if(c==""){$("#super_stacker_length").addClass("formCalcError");alert("You must provide the Conveyor Length");$("#super_stacker_length").focus();return false}else{$("#super_stacker_length").removeClass("formCalcError")}if(f==""){$("#super_stacker_pile_type").addClass("formCalcError");alert("You must provide the Type of Pile");$("#super_stacker_pile_type").focus();return false}else{$("#super_stacker_pile_type").removeClass("formCalcError")}if(g==""){$("#super_stacker_travel").addClass("formCalcError");alert("You must provide the Degrees of Radial Travel");$("#super_stacker_travel").focus();return false}else{if(g!=""&&isNaN(g)){$("#super_stacker_travel").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#super_stacker_travel").focus();return false}else{$("#super_stacker_travel").removeClass("formCalcError")}}var c=+(c);var f=+(f);var g=+(g);switch(c){case 130:var n=(f==1)?44:33;var k=(f==1)?128:87.5;var h=(f==1)?5810:2555;var b=(f==1)?241.7:100.5;break;case 136:var n=(f==1)?42:28.4;var k=(f==1)?125.3:75.5;var h=(f==1)?5605:1572;var b=(f==1)?230.9:78.3;break;case 150:var n=(f==1)?51:37;var k=(f==1)?152:97.5;var h=(f==1)?9964:3384;var b=(f==1)?380:140.8;break}$("#super_stacker_pile_height").val(n);$("#super_stacker_d").val(k);$("#super_stacker_conical_volume").val(h);var l=h*1.35;$("#super_stacker_conical_volume_pcf").val(Math.round(l));var i=h+(b*g);$("#super_stacker_radial_volume").val(Math.round(i));var m=i*1.35;$("#super_stacker_radial_volume_pcf").val(Math.round(m))});$("#belt_capacity .calc_button").click(function(d){var c=$("#belt_capacity_speed").val();var b=$("#belt_capacity_width").val();if(c==""){$("#belt_capacity_speed").addClass("formCalcError");alert("You must provide the Belt Speed");$("#belt_capacity_speed").focus();return false}else{$("#belt_capacity_speed").removeClass("formCalcError")}if(b==""){$("#belt_capacity_width").addClass("formCalcError");alert("You must provide the Belt Width");$("#belt_capacity_width").focus();return false}else{$("#belt_capacity_width").removeClass("formCalcError")}var f=[[69,103,138,172,207,241,276,310,345,379,414],[132,198,264,330,396,462,528,594,660,726,792],[215,322,430,537,645,752,860,967,1075,1182,1290],[318,477,636,795,954,1113,1272,1431,1590,1749,1908],[441,661,882,1102,1323,1543,1764,1984,2205,2425,2646],[585,877,1170,1462,1755,2047,2340,2632,2925,3217,3510],[748,1122,1496,1870,2244,2618,2992,3366,3740,4114,4488],[932,1398,1864,2330,2796,3262,3728,4194,4660,5126,5592],[1360,2040,2720,3400,4080,4760,5440,6120,6800,7480,8160]];var c=+(c);var b=+(b);$("#belt_width_capacity").val(f[b][c])});$("#belt_width .calc_button").click(function(f){var b=$("#belt_width_top").val();var i=$("#belt_width_tph").val();var c=$("#belt_width_gradation").val();if(b==""){$("#belt_width_top").addClass("formCalcError");alert("You must provide the Material Top Size");$("#belt_width_top").focus();return false}else{$("#belt_width_top").removeClass("formCalcError")}if(i==""){$("#belt_width_tph").addClass("formCalcError");alert("You must provide the TPH");$("#belt_width_tph").focus();return false}else{if(i!=""&&isNaN(i)){$("#belt_width_tph").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#belt_width_tph").focus();return false}else{if(+(i)<0||+(i)>1100){$("#belt_width_tph").addClass("formCalcError");alert("You may only enter values between 0 and 1100");$("#belt_width_tph").focus();return false}else{$("#belt_width_tph").removeClass("formCalcError")}}}if(c==""){$("#belt_width_gradation").addClass("formCalcError");alert("You must provide the Material Gradation");$("#belt_width_gradation").focus();return false}else{$("#belt_width_gradation").removeClass("formCalcError")}var b=+(b);var i=+(i);var c=+(c);var h=[100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000,1050,1100];var d=a(i,h);switch(c){case 1:var g=[[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,42,42,42,42],[42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42],[48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48],[54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54],[60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60],[60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60]];break;case 2:var g=[[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,42,42,42,42],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,42,42,42,42],[42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42],[48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48],[48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48]];break;case 3:var g=[[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[24,24,24,24,24,24,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[30,30,30,30,30,30,30,30,30,30,30,36,36,36,36,36,36,42,42,42,42],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,42,42,42,42],[36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,42,42,42,42]];break}$("#belt_width_width").val(g[b][d])});$("#horsepower .calc_button").click(function(l){var i=$("#horsepower_conveyor_width").val();var h=$("#horsepower_center").val();var b=$("#horsepower_elevation").val();var n=$("#horsepower_capacity").val();if(i==""){$("#horsepower_conveyor_width").addClass("formCalcError");alert("You must provide the Conveyor Width");$("#horsepower_conveyor_width").focus();return false}else{$("#horsepower_conveyor_width").removeClass("formCalcError")}if(h==""){$("#horsepower_center").addClass("formCalcError");alert("You must provide the Conveyor Center to Center");$("#horsepower_center").focus();return false}else{if(h!=""&&isNaN(h)){$("#horsepower_center").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#horsepower_center").focus();return false}else{if(+(h)<0||+(h)>400){$("#horsepower_center").addClass("formCalcError");alert("You may only enter values between 0 and 400");$("#horsepower_center").focus();return false}else{$("#horsepower_center").removeClass("formCalcError")}}}if(b==""){$("#horsepower_elevation").addClass("formCalcError");alert("You must provide the Change in Elevation");$("#horsepower_elevation").focus();return false}else{if(b!=""&&isNaN(b)){$("#horsepower_elevation").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#horsepower_elevation").focus();return false}else{if(+(b)<0||+(b)>100){$("#horsepower_elevation").addClass("formCalcError");alert("You may only enter values between 0 and 100");$("#horsepower_elevation").focus();return false}else{$("#horsepower_elevation").removeClass("formCalcError")}}}if(n==""){$("#horsepower_capacity").addClass("formCalcError");alert("You must provide the Change in Elevation");$("#horsepower_capacity").focus();return false}else{if(n!=""&&isNaN(n)){$("#horsepower_capacity").addClass("formCalcError");alert("You may only enter numerical values for this field");$("#horsepower_capacity").focus();return false}else{if(+(n)<0||+(n)>1000){$("#horsepower_elevation").addClass("formCalcError");alert("You may only enter values between 0 and 1000");$("#horsepower_elevation").focus();return false}else{$("#horsepower_capacity").removeClass("formCalcError")}}}var i=+(i);var h=+(h);var b=+(b);var n=+(n);if(i==0&&n>241){var s=confirm("Required capacity exceeds the maximum carrying capacity of this belt width at 350 FPM.\nContinue?");if(!s){return false}}if(i==1&&n>462){var s=confirm("Required capacity exceeds the maximum carrying capacity of this belt width at 350 FPM.\nContinue?");if(!s){return false}}if(i==2&&n>752){var s=confirm("Required capacity exceeds the maximum carrying capacity of this belt width at 350 FPM.\nContinue?");if(!s){return false}}if(b/h>0.309){var s=confirm("Conveyor Incline exceeds 18 degrees.\n(Maximum Incline recommended for aggregate applications is 18 degrees.)\nContinue?");if(!s){return false}}var g=[[0.7,0.8,0.9,1.1,1.15,1.2,1.25,1.3,1.35,1.4,1.55,1.7,1.75,1.8,1.9,2],[0.9,1.1,1.2,1.4,1.5,1.6,1.7,1.8,1.9,2,2.05,2.1,2.2,2.3,2.4,2.5],[1.4,1.6,1.8,1.9,2.05,2.2,2.35,2.5,2.65,2.8,2.9,3,3.1,3.2,3.35,3.5],[1.8,2,2.1,2.6,2.75,2.9,3,3.1,3.25,3.4,3.6,3.8,4,4.2,4.3,4.4],[2.1,2.5,2.7,3,3.25,3.5,3.6,3.7,3.95,4.2,4.4,4.6,4.95,5.3,5.65,6],[2.7,2.8,3.2,3.4,3.55,3.7,3.95,4.2,4.75,5.3,5.45,5.6,5.9,6.2,6.45,6.7]];var c=[25,50,75,100,125,150,175,200,225,250,275,300,325,350,375,400];var q=a(h,c);var m=g[i][q];if(n==0){var o=0;var f=0}else{var r=[[0.5,0.6,0.7,0.8,0.85,0.9,0.95,1,1.05,1.1,1.2,1.3,1.35,1.4,1.45,1.5],[0.8,0.9,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.1,2.2,2.3],[1,1.2,1.3,1.5,1.6,1.7,1.85,2,2.1,2.2,2.35,2.5,2.65,2.8,2.9,3],[1.3,1.5,1.6,1.9,2,2.1,2.3,2.5,2.65,2.8,2.95,3.1,3.3,3.5,3.65,3.8],[1.5,1.8,2,2.3,2.5,2.6,2.8,3,3.15,3.3,3.55,3.8,4,4.2,4.35,4.5],[1.8,2.1,2.3,2.6,2.8,3,3.25,3.5,3.7,3.9,4.15,4.4,4.6,4.9,5.1,5.3],[2,2.4,2.6,3,3.2,3.4,3.7,4,4.2,4.4,4.7,5,5.3,5.6,5.8,6],[2.5,3,3.3,3.8,4.05,4.3,4.65,5,5.25,5.5,5.9,6.3,6.66,7,7.25,7.5],[3,3.6,3.9,4.5,4.8,5.1,5.55,6,6.3,6.6,7.05,7.5,7.95,8.4,8.7,9],[3.5,4.2,4.6,5.3,5.65,6,6.5,7,7.35,7.7,8.25,8.8,9.3,9.8,10.15,10.5],[4,4.8,5.2,6,6.4,6.8,7.4,8,8.4,8.8,9.4,10,10.6,11.2,11.6,12],[4.5,5.4,5.9,6.8,7.25,7.7,8.35,9,9.45,9.9,10.6,11.3,11.95,12.6,13.05,13.5],[5,6,6.5,7.5,8,8.5,9.25,10,10.5,11,12,13,13.5,14,14.5,15]];q=a(h,c);var p=[100,150,200,250,300,350,400,500,600,700,800,900,1000];var k=a(n,p);var o=r[k][q];if(b==0){var f=0}else{var j=[[1,2,3,4,5,6,7,8,9,10],[1.5,3,4.5,6,7.5,9,10.5,12,13.5,15],[2,4,6,8,10,12,14,16,18,20],[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25],[3,6,9,12,15,18,21,24,27,30],[3.5,7,10.5,14,17.5,21,24.5,28,31.5,35],[4,8,12,16,20,24,28,32,36,40],[5,10,15,20,25,30,35,40,45,50],[6,12,18,24,30,36,42,48,54,60],[7,14,21,28,35,42,49,56,63,70],[8,16,24,32,40,48,56,64,72,80],[9,18,27,36,45,54,63,72,81,90],[10,20,30,40,50,60,70,80,90,100]];var d=[10,20,30,40,50,60,70,80,90,100];q=a(b,d);k=a(n,p);var f=j[k][q]}}$("#horsepower_hp").val(+(m)+ +(o)+ +(f))})});
