// JavaScript Document function SoftFlooringCalculator(theDiv, style,costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW){ creatediv("alesscoZipCode"); document.getElementById('alesscoZipCode').value = 0; if (style=='1A' || style=='1a') { var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if (style=='1B' || style=='1b') { var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='2A' || style=='2a'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='2B' || style=='2b'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='3A' || style=='3a'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='3B' || style=='3b'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='4A' || style=='4a'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='4B' || style=='4b'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='5A'){ var html ='
'; html+=''; html+=''; html+=''; html+=''; html+=' '; html+=''; html+=' '; html+=' '; html+=''; html+=''; html+=''; html+=' '; html+='
'; html+=''; html+=''; html+=' '; html+=''; html+=' '; html+='
'; html+=''; html+='
'; html+='
'; } else if(style=='5B'){ var html ='
'; html+=''; html+=''; html+=''; html+=''; html+=' '; html+=''; html+=' '; html+=' '; html+=''; html+='
'; html+=''; html+=''; html+=' '; html+=''; html+=' '; html+='
'; html+='
'; } else if(style=='5C'){ /*var html ='
'; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+='
'; html+=' '; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+=''; html+='
'; html+=''; html+='
'; html+='
';*/ var html ='
'; html+=''; html+=''; html+=''; html+=''; html+=' '; html+=''; html+=' '; html+=' '; html+=''; html+=''; html+=''; html+=' '; html+='
'; html+=' '; html+=' '; html+=' '; html+=' '; html+=' '; html+='
'; html+=''; html+='
'; html+='
'; } else if(style=='5D' || style=='5d'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= ''; html+= '
'; html+= '
'; } else if(style=='5E' || style=='5e'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= ''; html+= '
'; html+= ''; } else if(style=='5F' || style=='5f'){ var html = '
'; html+= '
'; html+= ''; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; } else if(style=='5G' || style=='5g'){ var html = '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= ''; } document.getElementById(theDiv).innerHTML = html; } function creatediv(id){ var newdiv = document.createElement('div'); newdiv.setAttribute('id', id); newdiv.style.visibility = "hidden"; newdiv.style.height="0px"; document.body.appendChild(newdiv); } var allHTMLTags = new Array(); function getElementByClass(theClass){ //Create Array of All HTML Tags var allHTMLTags=myWindow.document.getElementsByTagName("*"); //Loop through all tags using a for loop for (i=0; i'; html+= countBoxes('total1', 'total1w', '25', '0.64', '1.28', '32', '26', '26', '16', 'cost1', 'cost1w', '4', '50px', '2', '5/8',costSF/4, 'SoftFloors', '0', '1',lF,lI,wF,wI,0)[0]; html+= countBoxes('total2', 'total2w', '25', '0.50', '0.92', '23', '26', '26', '12', 'cost2', 'cost2w', '4', '139px', '2', '1/2', costERSF1/4, 'Economy Reversible SoftFloors', '1','2',lF,lI,wF,wI,0)[0]; html+= countBoxes('total5', 'total5w', '25', '0.64', '1.28', '32', '26', '26', '16', 'cost5', 'cost5w', '4', '413px', '2', '5/8',costSW/4, 'SoftWoods', '1','5',lF,lI,wF,wI,0)[0]; html+= countBoxes('total6', 'total6w', '25', '0.64', '1.76', '44', '26', '26', '16', 'cost6', 'cost6w', '4', '504px', '2', '5/8', costSC/4, 'SoftCarpets', '1','6' ,lF,lI,wF,wI,0)[0]; html+= countBoxes('total7', 'total7w', '25', '0.64', '1.76', '44', '27', '27', '16', 'cost7', 'cost7w', '4', '596px', '2', '5/8', costESC/4, 'Economy SoftCarpets', '1','7',lF,lI,wF,wI,0)[0]; html+= countBoxes('total8', 'total8w', '20', '0.40', '2.10', '42', '26', '26', '8', 'cost8', 'cost8w', '4', '685px', '2', '3/8', costST/4, 'SoftTuff', '1','8',lF,lI,wF,wI,0)[0]; html+= countBoxes('total9', 'total9w', '12', '0.92', '4.50', '54', '27', '27', '11', 'cost9', 'cost9w', '4', '776px', '2', '3/4', costSR/4, 'SoftRubber', '1','9',lF,lI,wF,wI,0)[0]; html+= countBoxes('total10', 'total10w', '25', '0.92', '1.88', '47', '26', '26', '23', 'cost10', 'cost10w', '4', '867px', '2', '7/8', costJRSF2/4, 'Jumbo Reversible SoftFloors', '1','10',lF,lI,wF,wI,0)[0]; html+= countBoxes('total11', 'total11w', '25', '1.04', '2.32', '58', '26', '26', '26', 'cost11', 'cost11w', '4', '956px', '2', '1', costJRSF2by1/4, 'Jumbo Reversible SoftFloors', '1','11',lF,lI,wF,wI,0)[0]; html+= countBoxes1('total12', 'total12w', '10', '0.90', '5.40', '54', '42', '41', '9', 'cost12', 'cost12w', '11.34', '1050px', '1m', '7/8', costJRSF1mby1m/11.34, 'Jumbo Reversible SoftFloors', '1','12',lF,lI,wF,wI,0)[0]; html+= countBoxes4('total13', 'total13w', '10', '1.10', '9', '90', '51', '50', '11', 'cost13', 'cost13w', '16', '1141px', '4', '1', costJRSF4/16, 'Jumbo Reversible SoftFloors', '1','13',lF,lI,wF,wI,0)[0]; //SM html+= countBoxesMats('1321px','14',costSM,'totalSM',lF,lI,wF,wI,0)[0]; //SOFTBAMBOO html+=countBoxesBambooNarrow1('1321px','15',costSBN1,'totalSBN1',lF,lI,wF,wI,0)[0]; html+=countBoxesBambooNarrow2('1321px','16',costSBN2,'totalSBN2',lF,lI,wF,wI,0)[0]; html+= countBoxesBambooWide('1321px','17',costSBW,'totalSBW',lF,lI,wF,wI,0)[0]; html+= countBoxes('total3', 'total3w', '25', '0.50', '0.92', '23', '26', '26', '12', 'cost3', 'cost3w', '4','229px', '2', '1/2', costERSF2/4, 'Economy Reversible SoftFloors', '1','3',lF,lI,wF,wI,0)[0]; //PL html+=playLearn('total4', 'total4w', '4', costPL1310, costPL1311,lF,lI,wF,wI,0)[0]; return html; } ///////////// function resultsTest1(costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW,lF,lI,wF,wI,enteredPieces){ //////////////// creatediv("total1"); creatediv('cost1'); creatediv('total1w'); creatediv('cost1w'); creatediv('borderArea'); creatediv('insideArea'); creatediv('borderWall'); creatediv('insideWall'); creatediv('lenghtArea'); creatediv('widthArea'); creatediv('lenghtWall'); creatediv('widthWall'); creatediv('total2'); creatediv('cost2'); creatediv('total2w'); creatediv('cost2w'); creatediv('total3'); creatediv('cost3'); creatediv('total3w'); creatediv('cost3w'); creatediv('total4'); creatediv('cost4'); creatediv('total4w'); creatediv('cost4w'); creatediv('lenghtPLArea'); creatediv('widthPLArea'); creatediv('lenghtPLWall'); creatediv('widthPLWall'); creatediv('total5'); creatediv('cost5'); creatediv('total5w'); creatediv('cost5w'); creatediv('total6'); creatediv('cost6'); creatediv('total6w'); creatediv('cost6w'); creatediv('total7'); creatediv('cost7'); creatediv('total7w'); creatediv('cost7w'); creatediv('total8'); creatediv('cost8'); creatediv('total8w'); creatediv('cost8w'); creatediv('total9'); creatediv('cost9'); creatediv('total9w'); creatediv('cost9w'); creatediv('total10'); creatediv('cost10'); creatediv('total10w'); creatediv('cost10w'); creatediv('total11'); creatediv('cost11'); creatediv('total11w'); creatediv('cost11w'); creatediv('total12'); creatediv('cost12'); creatediv('total12w'); creatediv('cost12w'); creatediv('lenght1mby1mArea'); creatediv('width1mby1mArea'); creatediv('lenght1mby1mWall'); creatediv('width1mby1mWall'); creatediv('total13'); creatediv('cost13'); creatediv('total13w'); creatediv('cost13w'); creatediv('lenght4by4Area'); creatediv('width4by4Area'); creatediv('lenght4by4Wall'); creatediv('width4by4Wall'); creatediv('totalSM'); creatediv('totalSBN1'); creatediv('totalSBN2'); creatediv('totalSBW'); creatediv('calSM'); creatediv('wyniki'); creatediv('boxes'); countPieces1('alesscoPieces',costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW); //SF var total1 = document.getElementById('total1'); var total1w = document.getElementById('total1w'); var cost1 = document.getElementById('cost1'); var cost1w = document.getElementById('cost1w'); //SC var total6 = document.getElementById('total6'); var total6w = document.getElementById('total6w'); var cost6 = document.getElementById('cost6'); var cost6w = document.getElementById('cost6w'); //SW var total5 = document.getElementById('total5'); var total5w = document.getElementById('total5w'); var cost5 = document.getElementById('cost5'); var cost5w = document.getElementById('cost5w'); //ERSF var total2 = document.getElementById('total2'); var total2w = document.getElementById('total2w'); var cost2 = document.getElementById('cost2'); var cost2w = document.getElementById('cost2w'); //ERSF1 var total3 = document.getElementById('total3'); var total3w = document.getElementById('total3w'); var cost3 = document.getElementById('cost3'); var cost3w = document.getElementById('cost3w'); //ESC var total7 = document.getElementById('total7'); var total7w = document.getElementById('total7w'); var cost7 = document.getElementById('cost7'); var cost7w = document.getElementById('cost7w'); //ST var total8 = document.getElementById('total8'); var total8w = document.getElementById('total8w'); var cost8 = document.getElementById('cost8'); var cost8w = document.getElementById('cost8w'); //SR var total9 = document.getElementById('total9'); var total9w = document.getElementById('total9w'); var cost9 = document.getElementById('cost9'); var cost9w = document.getElementById('cost9w'); //JRSF7 var total10 = document.getElementById('total10'); var total10w = document.getElementById('total10w'); var cost10 = document.getElementById('cost10'); var cost10w = document.getElementById('cost10w'); //JRSF2 var total11 = document.getElementById('total11'); var total11w = document.getElementById('total11w'); var cost11 = document.getElementById('cost11'); var cost11w = document.getElementById('cost11w'); //JRSF1 var total12 = document.getElementById('total12'); var total12w = document.getElementById('total12w'); var cost12 = document.getElementById('cost12'); var cost12w = document.getElementById('cost12w'); //JRSF4 var total13 = document.getElementById('total13'); var total13w = document.getElementById('total13w'); var cost13 = document.getElementById('cost13'); var cost13w = document.getElementById('cost13w'); //PL var total4 = document.getElementById('total4'); var total4w = document.getElementById('total4w'); var cost4 = document.getElementById('cost4'); var cost4w = document.getElementById('cost4w'); //SM var totalSM = document.getElementById('totalSM'); //SB var totalSBN1 = document.getElementById('totalSBN1'); var totalSBN2 = document.getElementById('totalSBN2'); var totalSBW = document.getElementById('totalSBW'); //// //////////////// var html='
'; //html+='
'; //html+='
'; html+='
'; html+= countBoxes('total1', 'total1w', '25', '0.64', '1.28', '32', '26', '26', '16', 'cost1', 'cost1w', '4', '50px', '2', '5/8',costSF/4, 'SoftFloors', '0', '1',lF,lI,wF,wI,1)[0]; html+= countBoxes('total2', 'total2w', '25', '0.50', '0.92', '23', '26', '26', '12', 'cost2', 'cost2w', '4', '139px', '2', '1/2', costERSF1/4, 'Economy Reversible SoftFloors', '1','2',lF,lI,wF,wI,1)[0]; html+= countBoxes('total5', 'total5w', '25', '0.64', '1.28', '32', '26', '26', '16', 'cost5', 'cost5w', '4', '413px', '2', '5/8',costSW/4, 'SoftWoods', '1','5',lF,lI,wF,wI,1)[0]; html+= countBoxes('total6', 'total6w', '25', '0.64', '1.76', '44', '26', '26', '16', 'cost6', 'cost6w', '4', '504px', '2', '5/8', costSC/4, 'SoftCarpets', '1','6' ,lF,lI,wF,wI,1)[0]; html+= countBoxes('total7', 'total7w', '25', '0.64', '1.76', '44', '27', '27', '16', 'cost7', 'cost7w', '4', '596px', '2', '5/8', costESC/4, 'Economy SoftCarpets', '1','7',lF,lI,wF,wI,1)[0]; html+= countBoxes('total8', 'total8w', '20', '0.40', '2.10', '42', '26', '26', '8', 'cost8', 'cost8w', '4', '685px', '2', '3/8', costST/4, 'SoftTuff', '1','8',lF,lI,wF,wI,1)[0]; html+= countBoxes('total9', 'total9w', '12', '0.92', '4.50', '54', '27', '27', '11', 'cost9', 'cost9w', '4', '776px', '2', '3/4', costSR/4, 'SoftRubber', '1','9',lF,lI,wF,wI,1)[0]; html+= countBoxes('total10', 'total10w', '25', '0.92', '1.88', '47', '26', '26', '23', 'cost10', 'cost10w', '4', '867px', '2', '7/8', costJRSF2/4, 'Jumbo Reversible SoftFloors', '1','10',lF,lI,wF,wI,1)[0]; html+= countBoxes('total11', 'total11w', '25', '1.04', '2.32', '58', '26', '26', '26', 'cost11', 'cost11w', '4', '956px', '2', '1', costJRSF2by1/4, 'Jumbo Reversible SoftFloors', '1','11',lF,lI,wF,wI,1)[0]; html+= countBoxes1('total12', 'total12w', '10', '0.90', '5.40', '54', '42', '41', '9', 'cost12', 'cost12w', '11.34', '1050px', '1m', '7/8', costJRSF1mby1m/11.34, 'Jumbo Reversible SoftFloors', '1','12',lF,lI,wF,wI,1)[0]; html+= countBoxes4('total13', 'total13w', '10', '1.10', '9', '90', '51', '50', '11', 'cost13', 'cost13w', '16', '1141px', '4', '1', costJRSF4/16, 'Jumbo Reversible SoftFloors', '1','13',lF,lI,wF,wI,1)[0]; //SM html+= countBoxesMats('1321px','14',costSM,'totalSM',lF,lI,wF,wI,1)[0]; //SOFTBAMBOO html+=countBoxesBambooNarrow1('1321px','15',costSBN1,'totalSBN1',lF,lI,wF,wI,1)[0]; html+=countBoxesBambooNarrow2('1321px','16',costSBN2,'totalSBN2',lF,lI,wF,wI,1)[0]; html+= countBoxesBambooWide('1321px','17',costSBW,'totalSBW',lF,lI,wF,wI,1)[0]; html+= countBoxes('total3', 'total3w', '25', '0.50', '0.92', '23', '26', '26', '12', 'cost3', 'cost3w', '4','229px', '2', '1/2', costERSF2/4, 'Economy Reversible SoftFloors', '1','3',lF,lI,wF,wI,1)[0]; //PL html+=playLearn('total4', 'total4w', '4', costPL1310, costPL1311,lF,lI,wF,wI,1)[0]; return html; } ///////////// function results(id,costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW){ var text=/^\d+$/; var lF = document.getElementById('alesscoLenghtFeet').value; var lI = document.getElementById('alesscoLenghtInches').value; var wF = document.getElementById('alesscoWidthFeet').value; var wI = document.getElementById('alesscoWidthInches').value; if(text.test(lF)&&text.test(lI)&&text.test(wF)&&text.test(wI)){ if(lF==0 || wF==0 || lI>=12 || wI>=12){ alert('Please convert your dimensions to feet and inches'); }else{ document.getElementById(id).innerHTML = resultsTest(costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW); } }else alert('Please convert your dimensions to feet and inches'); } function isZip(s) { // Check for correct zip code reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/); if (s.length != 5) { alert("If you are outside USA please email sales@alessco.com or call 1 773 235 6287 for shipping cost"); return false; } if (s == "00000") { alert("If you are outside USA please email sales@alessco.com or call 1 773 235 6287 for shipping cost"); return false; } if (!reZip.test(s)) { alert("If you are outside USA please email sales@alessco.com or call 1 773 235 6287 for shipping cost"); return false; } return true; } function newWindow(style,costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW){ var text=/^\d+$/; var lF = document.getElementById('alesscoLenghtFeet').value; var lI = document.getElementById('alesscoLenghtInches').value; var wF = document.getElementById('alesscoWidthFeet').value; var wI = document.getElementById('alesscoWidthInches').value; var eP = document.getElementById('alesscoPieces').value; var zipCode = document.getElementById('alesscoZipCode').value; if(text.test(lF)&&text.test(lI)&&text.test(wF)&&text.test(wI)||text.test(eP)){ if((lF==0 || wF==0 || lI>=12 || wI>=12) && eP==0){ alert('Please convert your dimensions to feet and inches OR enter your number of pieces'); } else if(((lF!=0 || wF!=0) && (lI<12 || wI<12)) && eP!=0){ alert('Please enter your dimensions OR your number of pieces'); } else{ if(isZip(zipCode)){ myWindow=window.open('http://www.alessco.com/cal/js/indexChild1p.php?style='+style+'&costSF='+costSF+'&costERSF1='+costERSF1+'&costERSF2='+costERSF2+'&costSW='+costSW+'&costSC='+costSC+'&costESC='+costESC+'&costST='+costST+'&costSR='+costSR+'&costJRSF2='+costJRSF2+'&costJRSF2by1='+costJRSF2by1+'&costJRSF1mby1m='+costJRSF1mby1m+'&costJRSF4='+costJRSF4+'&costPL1310='+costPL1310+'&costPL1311='+costPL1311+'&costSM='+costSM+'&costSBN1='+costSBN1+'&costSBN2='+costSBN2+'&costSBW='+costSBW+'','','width=1060,height=800,scrollbars=yes'); myWindow.focus(); //showResults(); } } } else{ alert('Please convert your dimensions to feet and inches'); } } function closeWindow(){ myWindow.close(); //document.getElementById('boxes').style.visibility = "hidden"; } function closeBlue(obj){ obj.src = "http://www.alessco.com/images/closeButtonOver.png"; } function closeGrey(obj){ obj.src = "http://www.alessco.com/images/closeButton.png"; } function closeBlueEnd(){ document.getElementById('closeButtonEnd').src = "http://www.alessco.com/images/closeButtonOver.png"; } function closeGreyEnd(){ document.getElementById('closeButtonEnd').src = "http://www.alessco.com/images/closeButton.png"; } function changeBackgroundColor(objDivID) { var els = document.getElementsByTagName('div'); for (i=0; i < els.length; i++) { els[i].style.backgroundColor = '#ffffff'; } document.getElementById(objDivID).style.backgroundColor = '#c0c0c0'; } function goButtonBlue(obj){ obj.src ="http://www.alessco.com/images/CalculatorGoOver.png"; } function goButtonGrey(obj){ obj.src ="http://www.alessco.com/images/CalculatorGo.png"; } function orderHereButtonBlue(id){ var link = 'buttonLink'+id+''; document.getElementById(link).src ="http://www.alessco.com/images/placeordernoanimOver.jpg"; } function goButtonOver(obj){ obj.src ="http://www.alessco.com/images/SoftFlooringCalculatorGoOver.png"; } function goButtonOut(obj){ obj.src ="http://www.alessco.com/images/SoftFlooringCalculatorGo.png"; } function sendButtonOver(obj){ obj.src ="http://www.alessco.com/images/sendShippingButtonOver.png"; } function sendButtonOut(obj){ obj.src ="http://www.alessco.com/images/sendShippingButton.png"; } //////////// ///////////// function waitPreloadPage() { //DOM if (document.getElementById) { document.getElementById('prepage').style.visibility='hidden'; } else { if (document.layers) { //NS4 document.prepage.visibility = 'hidden'; } else { //IE4 document.all.prepage.style.visibility = 'hidden'; } } } ///////////// function hideDiv(id){ document.getElementById(id).style.visibility = "hidden"; } function showClue(id, position){ var html = 'To see more details fill out the form'; document.getElementById(id).innerHTML = html; document.getElementById(id).style.top = position; document.getElementById(id).style.visibility = "visible"; } function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function countPieces(lFeet, lInches, wFeet, wInches,costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW){ var lenFeet = opener.document.getElementById(lFeet).value; var lenInches = opener.document.getElementById(lInches).value; var widFeet = opener.document.getElementById(wFeet).value; var widInches = opener.document.getElementById(wInches).value; if(lenFeet < 2 ){lenFeet=2; lenInches =0;} if(widFeet < 2 ){widFeet=2; widInches = 0;} if(lenFeet == 0 && lenInches != 0){lenFeet = 2; lenInches = 0;} if(widFeet == 0 && widInches != 0){widFeet = 2; widInches = 0;} var lenFeet4 = opener.document.getElementById(lFeet).value; var lenInches4 = opener.document.getElementById(lInches).value; var widFeet4 = opener.document.getElementById(wFeet).value; var widInches4 = opener.document.getElementById(wInches).value; /*if(lenFeet4 < 4 ){lenFeet4=4; lenInches4 =0;} if(widFeet4 < 4){widFeet4=4; widInches4 = 0;} if(lenFeet4 == 0 && lenInches4 != 0){lenFeet4 = 4; lenInches4 = 0;} if(widFeet4 == 0 && widInches4 != 0){widFeet4 =4; widInches4 = 0;}*/ var text=/^\d+$/; if(text.test(lenFeet) && (lenFeet != 0 || widInches != 0) && text.test(lenInches) && text.test(widFeet) && text.test(widInches)){ if((lenInches==0 && widInches==0) || (lenInches4==0 && widInches4==0)){ var wallSM = Math.ceil((lenFeet * widFeet)/24); var wallSB = Math.ceil((lenFeet * widFeet)/50); var lenghtArea = Math.floor(lenFeet/2)*2; var widthArea = Math.floor(widFeet/2)*2; var totalArea = Math.floor(lenFeet/2) * Math.floor(widFeet/2); var borderArea = (Math.floor(lenFeet/2) - 2)*2 + (Math.floor(widFeet/2) - 2)*2; var insideArea = (Math.floor(lenFeet/2) - 2)*(Math.floor(widFeet/2) - 2); var num = new Number(lenFeet); var num1 = new Number(widFeet); var lenghtPLArea = num - 1; var widthPLArea = num1 - 1; var lenghtPLWall = num; var widthPLWall = num1; var totalPLArea = lenghtPLArea * widthPLArea; var totalPLWall = lenghtPLWall * widthPLWall; var totalWall = Math.ceil(lenFeet/2) * Math.ceil(widFeet/2); var lenghtWall = Math.ceil(lenFeet/2)*2; var widthWall = Math.ceil(widFeet/2)*2; var borderWall = (Math.ceil(lenFeet/2) - 2)*2 + (Math.ceil(widFeet/2) - 2)*2; var insideWall = (Math.ceil(lenFeet/2) - 2)*(Math.ceil(widFeet/2) - 2); var total4by4Area = Math.floor(lenFeet4/4) * Math.floor(widFeet4/4); var lenght4by4Area = Math.floor(lenFeet4/4)*4; var width4by4Area = Math.floor(widFeet4/4)*4; var total4by4Wall = Math.ceil(lenFeet4/4) * Math.ceil(widFeet4/4); var lenght4by4Wall = Math.ceil(lenFeet4/4)*4; var width4by4Wall = Math.ceil(widFeet4/4)*4; var total1mby1mArea = Math.floor(lenFeet/3.375) * Math.floor(widFeet/3.28); var lenght1mby1mArea = Math.floor(lenFeet/3.375)*3.375; var width1mby1mArea = Math.floor(widFeet/3.375)*3.375; var total1mby1mWall = Math.ceil(lenFeet/3.375) * Math.ceil(widFeet/3.375); var lenght1mby1mWall = Math.ceil(lenFeet/3.375)*3.375; var width1mby1mWall = Math.ceil(widFeet/3.375)*3.375; var html=''; html+='Area Rug '+totalArea+'\nWall to Wall '+totalWall+'\n4by4 Area Rug '+total4by4Area+'\n4b4 Wall to Wall '+total4by4Wall+'\n1m by 1m Area Rug '+total1mby1mArea+'\n1m by 1m Wall To Wall '+total1mby1mWall+''; } else if((lenInches!=0 && widInches==0) || (lenInches4!=0 && widInches4==0)){ if(lenInches>=12){ alert('Please convert your dimensions to feet and inches'); }else{ var num = new Number(lenFeet); var num1 = new Number(lenInches); var numa = new Number(widFeet); var lenFeetArea1 = num - num1 + num1; var lenFeetWall1 = num + 1; var num4 = new Number(lenFeet4); var num14 = new Number(lenInches4); var numa4 = new Number(widFeet4); var lenFeetArea14 = num4 - num14 + num14; var lenFeetWall14 = num4 + 1; if(lenInches <= 6){ if(lenInches == 6){ var lenghtPLArea = num; var widthPLArea = numa - 1; }else{ var lenghtPLArea = num - 1; var widthPLArea = numa - 1; } var lenghtPLWall = num; var widthPLWall = numa; }else{ var lenghtPLArea = num; var widthPLArea = numa - 1; var lenghtPLWall = num + 1; var widthPLWall = widFeet; } var totalPLArea = lenghtPLArea * widthPLArea; var totalPLWall = lenghtPLWall * widthPLWall; var lenghtArea = Math.floor(lenFeetArea1/2)*2; var widthArea = Math.floor(widFeet/2)*2; var totalArea = Math.floor(lenFeetArea1/2) * Math.floor(widFeet/2); var borderArea = (Math.floor(lenFeetArea1/2) - 2)*2 + (Math.floor(widFeet/2) - 2)*2; var insideArea = (Math.floor(lenFeetArea1/2) - 2)*(Math.floor(widFeet/2) - 2); var lenghtWall = Math.ceil(lenFeetWall1/2)*2; var widthWall = Math.ceil(widFeet/2)*2; var totalWall = Math.ceil(lenFeetWall1/2) * Math.ceil(widFeet/2); var borderWall = (Math.ceil(lenFeetWall1/2) - 2)*2 + (Math.ceil(widFeet/2) - 2)*2; var insideWall = (Math.ceil(lenFeetWall1/2) - 2)*(Math.ceil(widFeet/2) - 2); var wallSM = Math.ceil((lenFeetWall1 * widFeet)/24); var wallSB = Math.ceil((lenFeetWall1 * widFeet)/50); var total4by4Area = Math.floor(lenFeetArea14/4) * Math.floor(widFeet4/4); var lenght4by4Area = Math.floor(lenFeetArea14/4)*4; var width4by4Area = Math.floor(widFeet4/4)*4; var total4by4Wall = Math.ceil(lenFeetWall14/4) * Math.ceil(widFeet4/4); var lenght4by4Wall = Math.ceil(lenFeetWall14/4)*4; var width4by4Wall = Math.ceil(widFeet4/4)*4; var total1mby1mArea = Math.floor(lenFeetArea1/3.375) * Math.floor(widFeet/3.375); var lenght1mby1mArea = Math.floor(lenFeetArea1/3.3758)*3.375; var width1mby1mArea = Math.floor(widFeet/3.375)*3.375; var total1mby1mWall = Math.ceil(lenFeetWall1/3.375) * Math.ceil(widFeet/3.375); var lenght1mby1mWall = Math.ceil(lenFeetWall1/3.375)*3.375; var width1mby1mWall = Math.ceil(widFeet/3.375)*3.375; var html=''; html+='Area Rug '+totalArea+'\nWall to Wall '+totalWall+'\n4by4 Area Rug '+total4by4Area+'\n4b4 Wall to Wall '+total4by4Wall+'\n1m by 1m Area Rug '+total1mby1mArea+'\n1m by 1m Wall To Wall '+total1mby1mWall+''; //alert(html); } } else if((lenInches==0 && widInches!=0) || (lenInches4==0 && widInches4!=0)){ if(widInches>=12){ alert('Please convert your dimensions to feet and inches'); }else{ var num = new Number(widFeet); var numa = new Number(lenFeet); var num1 = new Number(widInches); var widFeetArea1 = num - num1 + num1; var widFeetWall1 = num+1; var num4 = new Number(widFeet4); var numa4 = new Number(lenFeet4); var num14 = new Number(widInches4); var widFeetArea14 = num4 - num14 + num14; var widFeetWall14 = num4+1; if(widInches <= 6){ if(widInches == 6){ var lenghtPLArea = numa - 1; var widthPLArea = num; }else{ var lenghtPLArea = numa - 1; var widthPLArea = num - 1; } var lenghtPLWall = numa; var widthPLWall = num; }else{ var lenghtPLArea = numa -1; var widthPLArea = num; var lenghtPLWall = numa; var widthPLWall = num+1; } var totalPLArea = lenghtPLArea * widthPLArea; var totalPLWall = lenghtPLWall * widthPLWall; var lenghtArea = Math.floor(lenFeet/2)*2; var widthArea = Math.floor(widFeetArea1/2)*2; var totalArea = Math.floor(lenFeet/2) * Math.floor(widFeetArea1/2); var borderArea = (Math.floor(lenFeet/2) - 2)*2 + (Math.floor(widFeetArea1/2) - 2)*2; var insideArea = (Math.floor(lenFeet/2) - 2)*(Math.floor(widFeetArea1/2) - 2); var lenghtWall = Math.ceil(lenFeet/2)*2; var widthWall = Math.ceil(widFeetWall1/2)*2; var totalWall = Math.ceil(lenFeet/2) * Math.ceil(widFeetWall1/2); var borderWall = (Math.ceil(lenFeet/2) - 2)*2 + (Math.ceil(widFeetWall1/2) - 2)*2; var insideWall = (Math.ceil(lenFeet/2) - 2)*(Math.ceil(widFeetWall1/2) - 2); var wallSM = Math.ceil((lenFeet* widFeetWall1)/24); var wallSB = Math.ceil((lenFeet* widFeetWall1)/50); var total4by4Area = Math.floor(lenFeet4/4) * Math.floor(widFeetArea14/4); var lenght4by4Area = Math.floor(lenFeet4/4)*4; var width4by4Area = Math.floor(widFeetArea14/4)*4; var total4by4Wall = Math.ceil(lenFeet4/4) * Math.ceil(widFeetWall14/4); var lenght4by4Wall = Math.ceil(lenFeet4/4)*4; var width4by4Wall = Math.ceil(widFeetWall14/4)*4; var total1mby1mArea = Math.floor(lenFeet/3.375) * Math.floor(widFeetArea1/3.375); var lenght1mby1mArea = Math.floor(lenFeet/3.375)*3.375; var width1mby1mArea = Math.floor(widFeetArea1/3.375)*3.375; var total1mby1mWall = Math.ceil(lenFeet/3.375) * Math.ceil(widFeetWall1/3.375); var lenght1mby1mWall = Math.ceil(lenFeet/3.375)*3.375; var width1mby1mWall = Math.ceil(widFeetWall1/3.375)*3.375; var html=''; html+='Area Rug '+totalArea+'\nWall to Wall '+totalWall+'\n4by4 Area Rug '+total4by4Area+'\n4b4 Wall to Wall '+total4by4Wall+'\n1m by 1m Area Rug '+total1mby1mArea+'\n1m by 1m Wall To Wall '+total1mby1mWall+''; //alert(html); } } else{ if(lenInches>=12 || widInches>=12){ alert('Please convert your dimensions to feet and inches'); }else{ var num = new Number(lenFeet); var numa = new Number(lenInches); var lenFeetArea1 = num - numa + numa; var lenFeetWall1 = num + 1; var num1 = new Number(widFeet); var num1a = new Number(widInches); var widFeetArea1 = num1 - num1a + num1a; var widFeetWall1 = num1 + 1; if(lenInches <=6 && widInches <=6){ if(lenInches == 6 && widInches != 6){ var lenghtPLArea = num; var widthPLArea = num1 - 1; }else if(lenInches != 6 && widInches == 6){ var lenghtPLArea = num - 1; var widthPLArea = num1; }else if(lenInches == 6 && widInches == 6){ var lenghtPLArea = num; var widthPLArea = num1; }else{ var lenghtPLArea = num - 1; var widthPLArea = num1 - 1; } var lenghtPLWall = num; var widthPLWall = num1; }else if(lenInches>6 && widInches <=6){ if(widInches == 6){ var widthPLArea = num1; }else{ var widthPLArea = num1 - 1; } var lenghtPLArea = num; var lenghtPLWall = num+1; var widthPLWall = num1; }else if(lenInches <= 6 && widInches > 6){ if(lenInches == 6){ var lenghtPLArea = num; }else{ var lenghtPLArea = num-1; } var widthPLArea = num1; var lenghtPLWall = num; var widthPLWall = num1+1; }else if(lenInches>6 && widInches > 6){ var lenghtPLArea = num; var widthPLArea = num1; var lenghtPLWall = num+1; var widthPLWall = num1+1; } var totalPLArea = lenghtPLArea * widthPLArea; var totalPLWall = lenghtPLWall * widthPLWall; var lenghtArea = Math.floor(lenFeetArea1/2)*2; var widthArea = Math.floor(widFeetArea1/2)*2; var totalArea = Math.floor(lenFeetArea1/2) * Math.floor(widFeetArea1/2); var borderArea = (Math.floor(lenFeetArea1/2) - 2)*2 + (Math.floor(widFeetArea1/2) - 2)*2; var insideArea = (Math.floor(lenFeetArea1/2) - 2)*(Math.floor(widFeetArea1/2) - 2); var lenghtWall = Math.ceil(lenFeetWall1/2)*2; var widthWall = Math.ceil(widFeetWall1/2)*2; var totalWall = Math.ceil(lenFeetWall1/2) * Math.ceil(widFeetWall1/2); var borderWall = (Math.ceil(lenFeetWall1/2) - 2)*2 + (Math.ceil(widFeetWall1/2) - 2)*2; var insideWall = (Math.ceil(lenFeetWall1/2) - 2)*(Math.ceil(widFeetWall1/2) - 2); var wallSM = Math.ceil((lenFeetWall1* widFeetWall1)/24); var wallSB = Math.ceil((lenFeetWall1* widFeetWall1)/50); var total4by4Area = Math.floor(lenFeetArea1/4) * Math.floor(widFeetArea1/4); var lenght4by4Area = Math.floor(lenFeetArea1/4)*4; var width4by4Area = Math.floor(widFeetArea1/4)*4; var total4by4Wall = Math.ceil(lenFeetWall1/4) * Math.ceil(widFeetWall1/4); var lenght4by4Wall = Math.ceil(lenFeetWall1/4)*4; var width4by4Wall = Math.ceil(widFeetWall1/4)*4; var total1mby1mArea = Math.floor(lenFeetArea1/3.375) * Math.floor(widFeetArea1/3.28); var lenght1mby1mArea = Math.floor(lenFeetArea1/3.375)*3.375; var width1mby1mArea = Math.floor(widFeetArea1/3.375)*3.375; var total1mby1mWall = Math.ceil(lenFeetWall1/3.375) * Math.ceil(widFeetWall1/3.375); var lenght1mby1mWall = Math.ceil(lenFeetWall1/3.375)*3.375; var width1mby1mWall = Math.ceil(widFeetWall1/3.375)*3.375; var html=''; html+='Area Rug '+totalArea+'\nWall to Wall '+totalWall+'\n4by4 Area Rug '+total4by4Area+'\n4b4 Wall to Wall '+total4by4Wall+'\n1m by 1m Area Rug '+total1mby1mArea+'\n1m by 1m Wall To Wall '+total1mby1mWall+''; //alert(html); } } //Prices per piece /*var costSF = xmlDoc.getElementsByTagName("SoftFloors")[0].childNodes[0].nodeValue; var costERSF1 = xmlDoc.getElementsByTagName("EconomySoftFloors1")[0].childNodes[0].nodeValue; var costERSF2 = xmlDoc.getElementsByTagName("EconomySoftFloors2")[0].childNodes[0].nodeValue; var costSW = xmlDoc.getElementsByTagName("SoftWoods")[0].childNodes[0].nodeValue; var costSC = xmlDoc.getElementsByTagName("SoftCarpets")[0].childNodes[0].nodeValue; var costESC = xmlDoc.getElementsByTagName("EconomySoftCarpets")[0].childNodes[0].nodeValue; var costST = xmlDoc.getElementsByTagName("SoftTuff")[0].childNodes[0].nodeValue; var costSR = xmlDoc.getElementsByTagName("SoftRubber")[0].childNodes[0].nodeValue; var costJRSF2 = xmlDoc.getElementsByTagName("Jumbo2by2by7")[0].childNodes[0].nodeValue; var costJRSF2by1 = xmlDoc.getElementsByTagName("Jumbo2by2by1")[0].childNodes[0].nodeValue; var costJRSF1mby1m = xmlDoc.getElementsByTagName("Jumbo1mby1m")[0].childNodes[0].nodeValue; var costJRSF4 = xmlDoc.getElementsByTagName("Jumbo4by4")[0].childNodes[0].nodeValue;*/ document.getElementById('total1').innerHTML = totalArea; document.getElementById('total1').value = totalArea; document.getElementById('total1w').innerHTML = totalWall; document.getElementById('total1w').value = totalWall; document.getElementById('borderArea').value = borderArea; document.getElementById('insideArea').value = insideArea; document.getElementById('borderWall').value = borderWall; document.getElementById('insideWall').value = insideWall; document.getElementById('lenghtArea').value = lenghtArea; document.getElementById('widthArea').value = widthArea; document.getElementById('lenghtWall').value = lenghtWall; document.getElementById('widthWall').value = widthWall; costs(totalArea, costSF, 'cost1'); costs(totalWall, costSF, 'cost1w'); document.getElementById('total2').innerHTML = totalArea; document.getElementById('total2').value = totalArea; document.getElementById('total2w').innerHTML = totalWall; document.getElementById('total2w').value = totalWall; costs(totalArea, costERSF1, 'cost2'); costs(totalWall, costERSF1, 'cost2w'); document.getElementById('total3').innerHTML = totalArea; document.getElementById('total3').value = totalArea; document.getElementById('total3w').innerHTML = totalWall; document.getElementById('total3w').value = totalWall; costs(totalArea, costERSF2, 'cost3'); costs(totalWall, costERSF2, 'cost3w'); document.getElementById('total4').innerHTML = totalPLArea; document.getElementById('total4').value = totalPLArea; document.getElementById('total4w').innerHTML = totalPLWall; document.getElementById('total4w').value = totalPLWall; document.getElementById('lenghtPLArea').value = lenghtPLArea; document.getElementById('widthPLArea').value = widthPLArea; document.getElementById('lenghtPLWall').value = lenghtPLWall; document.getElementById('widthPLWall').value = widthPLWall; document.getElementById('total5').innerHTML = totalArea; document.getElementById('total5').value = totalArea; document.getElementById('total5w').innerHTML = totalWall; document.getElementById('total5w').value = totalWall; costs(totalArea, costSW, 'cost5'); costs(totalWall, costSW, 'cost5w'); document.getElementById('total6').innerHTML = totalArea; document.getElementById('total6').value = totalArea; document.getElementById('total6w').innerHTML = totalWall; document.getElementById('total6w').value = totalWall; costs(totalArea, costSC, 'cost6'); costs(totalWall, costSC, 'cost6w'); document.getElementById('total7').innerHTML = totalArea; document.getElementById('total7').value = totalArea; document.getElementById('total7w').innerHTML = totalWall; document.getElementById('total7w').value = totalWall; costs(totalArea, costESC, 'cost7'); costs(totalWall, costESC, 'cost7w'); document.getElementById('total8').innerHTML = totalArea; document.getElementById('total8').value = totalArea; document.getElementById('total8w').innerHTML = totalWall; document.getElementById('total8w').value = totalWall; costs(totalArea, costST, 'cost8'); costs(totalWall, costST, 'cost8w'); document.getElementById('total9').innerHTML = totalArea; document.getElementById('total9').value = totalArea; document.getElementById('total9w').innerHTML = totalWall; document.getElementById('total9w').value = totalWall; costs(totalArea, costSR, 'cost9'); costs(totalWall, costSR, 'cost9w'); document.getElementById('total10').innerHTML = totalArea; document.getElementById('total10').value = totalArea; document.getElementById('total10w').innerHTML = totalWall; document.getElementById('total10w').value = totalWall; costs(totalArea, costJRSF2, 'cost10'); costs(totalWall, costJRSF2, 'cost10w'); document.getElementById('total11').innerHTML = totalArea; document.getElementById('total11').value = totalArea; document.getElementById('total11w').innerHTML = totalWall; document.getElementById('total11w').value = totalWall; costs(totalArea, costJRSF2by1, 'cost11'); costs(totalWall, costJRSF2by1, 'cost11w'); if(total1mby1mArea==0){total1mby1mArea=1; lenght1mby1mArea=3.375; width1mby1mArea=3.375;}; if(total1mby1mWall==0){total1mby1mWall=1; lenght1mby1mWall=3.375; width1mby1mWall=3.375;}; document.getElementById('total12').innerHTML = total1mby1mArea; document.getElementById('total12').value = total1mby1mArea; document.getElementById('total12w').innerHTML = total1mby1mWall; document.getElementById('total12w').value = total1mby1mWall; document.getElementById('lenght1mby1mArea').value = lenght1mby1mArea; document.getElementById('width1mby1mArea').value = width1mby1mArea; document.getElementById('lenght1mby1mWall').value = lenght1mby1mWall; document.getElementById('width1mby1mWall').value = width1mby1mWall; costs(total1mby1mArea, costJRSF1mby1m, 'cost12'); costs(total1mby1mWall, costJRSF1mby1m, 'cost12w'); if(total4by4Area==0){total4by4Area=1; lenght4by4Area=4; width4by4Area=4;}; if(total4by4Wall==0){total4by4Wall=1; lenght4by4Wall=4; width4by4Wall=4;}; document.getElementById('total13').innerHTML = total4by4Area; document.getElementById('total13').value = total4by4Area; document.getElementById('total13w').innerHTML = total4by4Wall; document.getElementById('total13w').value = total4by4Wall; document.getElementById('lenght4by4Area').value = lenght4by4Area; document.getElementById('width4by4Area').value = width4by4Area; document.getElementById('lenght4by4Wall').value = lenght4by4Wall; document.getElementById('width4by4Wall').value = width4by4Wall; costs(total4by4Area, costJRSF4, 'cost13'); costs(total4by4Wall, costJRSF4, 'cost13w'); document.getElementById('totalSM').innerHTML = wallSM; document.getElementById('totalSM').value = wallSM; document.getElementById('totalSBN1').innerHTML = wallSB; document.getElementById('totalSBN1').value = wallSB; document.getElementById('totalSBN2').innerHTML = wallSB; document.getElementById('totalSBN2').value = wallSB; document.getElementById('totalSBW').innerHTML = wallSB; document.getElementById('totalSBW').value = wallSB; document.getElementById('wyniki').style.visibility="visible"; }else{ alert('Please convert your dimensions to feet and inches'); } } //////////////////// function countPieces1(enteredArea,costSF,costERSF1,costERSF2,costSW,costSC,costESC,costST,costSR,costJRSF2,costJRSF2by1,costJRSF1mby1m,costJRSF4,costPL1310,costPL1311,costSM,costSBN1,costSBN2,costSBW){ var entereArea = opener.document.getElementById(enteredArea).value; //alert(entereArea); document.getElementById('total1').innerHTML = entereArea; document.getElementById('total1').value = entereArea; document.getElementById('total1w').innerHTML = entereArea; document.getElementById('total1w').value = entereArea; document.getElementById('borderArea').value = 0; document.getElementById('insideArea').value = 0; document.getElementById('borderWall').value = 0; document.getElementById('insideWall').value = 0; document.getElementById('lenghtArea').value = 0; document.getElementById('widthArea').value = 0; document.getElementById('lenghtWall').value = 0; document.getElementById('widthWall').value = 0; costs(entereArea, costSF, 'cost1'); costs(entereArea, costSF, 'cost1w'); document.getElementById('total2').innerHTML = entereArea; document.getElementById('total2').value = entereArea; document.getElementById('total2w').innerHTML = entereArea; document.getElementById('total2w').value = entereArea; costs(entereArea, costERSF1, 'cost2'); costs(entereArea, costERSF1, 'cost2w'); document.getElementById('total3').innerHTML = entereArea; document.getElementById('total3').value = entereArea; document.getElementById('total3w').innerHTML = entereArea; document.getElementById('total3w').value = entereArea; costs(entereArea, costERSF2, 'cost3'); costs(entereArea, costERSF2, 'cost3w'); document.getElementById('total4').innerHTML = entereArea; document.getElementById('total4').value = entereArea; document.getElementById('total4w').innerHTML = entereArea; document.getElementById('total4w').value = entereArea; document.getElementById('lenghtPLArea').value = 0; document.getElementById('widthPLArea').value = 0; document.getElementById('lenghtPLWall').value = 0; document.getElementById('widthPLWall').value = 0; document.getElementById('total5').innerHTML = entereArea; document.getElementById('total5').value = entereArea; document.getElementById('total5w').innerHTML = entereArea; document.getElementById('total5w').value = entereArea; costs(entereArea, costSW, 'cost5'); costs(entereArea, costSW, 'cost5w'); document.getElementById('total6').innerHTML = entereArea; document.getElementById('total6').value = entereArea; document.getElementById('total6w').innerHTML = entereArea; document.getElementById('total6w').value = entereArea; costs(entereArea, costSC, 'cost6'); costs(entereArea, costSC, 'cost6w'); document.getElementById('total7').innerHTML = entereArea; document.getElementById('total7').value = entereArea; document.getElementById('total7w').innerHTML = entereArea; document.getElementById('total7w').value = entereArea; costs(entereArea, costESC, 'cost7'); costs(entereArea, costESC, 'cost7w'); document.getElementById('total8').innerHTML = entereArea; document.getElementById('total8').value = entereArea; document.getElementById('total8w').innerHTML = entereArea; document.getElementById('total8w').value = entereArea; costs(entereArea, costST, 'cost8'); costs(entereArea, costST, 'cost8w'); document.getElementById('total9').innerHTML = entereArea; document.getElementById('total9').value = entereArea; document.getElementById('total9w').innerHTML = entereArea; document.getElementById('total9w').value = entereArea; costs(entereArea, costSR, 'cost9'); costs(entereArea, costSR, 'cost9w'); document.getElementById('total10').innerHTML = entereArea; document.getElementById('total10').value = entereArea; document.getElementById('total10w').innerHTML = entereArea; document.getElementById('total10w').value = entereArea; costs(entereArea, costJRSF2, 'cost10'); costs(entereArea, costJRSF2, 'cost10w'); document.getElementById('total11').innerHTML = entereArea; document.getElementById('total11').value = entereArea; document.getElementById('total11w').innerHTML = entereArea; document.getElementById('total11w').value = entereArea; costs(entereArea, costJRSF2by1, 'cost11'); costs(entereArea, costJRSF2by1, 'cost11w'); document.getElementById('total12').innerHTML = entereArea; document.getElementById('total12').value = entereArea; document.getElementById('total12w').innerHTML = entereArea; document.getElementById('total12w').value = entereArea; document.getElementById('lenght1mby1mArea').value = 0; document.getElementById('width1mby1mArea').value = 0; document.getElementById('lenght1mby1mWall').value = 0; document.getElementById('width1mby1mWall').value = 0; costs(entereArea, costJRSF1mby1m, 'cost12'); costs(entereArea, costJRSF1mby1m, 'cost12w'); document.getElementById('total13').innerHTML = entereArea; document.getElementById('total13').value = entereArea; document.getElementById('total13w').innerHTML = entereArea; document.getElementById('total13w').value = entereArea; document.getElementById('lenght4by4Area').value = entereArea; document.getElementById('width4by4Area').value = entereArea; document.getElementById('lenght4by4Wall').value = entereArea; document.getElementById('width4by4Wall').value = entereArea; costs(entereArea, costJRSF4, 'cost13'); costs(entereArea, costJRSF4, 'cost13w'); document.getElementById('totalSM').innerHTML = entereArea; document.getElementById('totalSM').value = entereArea; document.getElementById('totalSBN1').innerHTML = entereArea; document.getElementById('totalSBN1').value = entereArea; document.getElementById('totalSBN2').innerHTML = entereArea; document.getElementById('totalSBN2').value = entereArea; document.getElementById('totalSBW').innerHTML = entereArea; document.getElementById('totalSBW').value = entereArea; document.getElementById('wyniki').style.visibility="visible"; } //////////////// function costs(total, price, id){ var cost = (total * price).toFixed(2); //var cost = addCommas((total * price).toFixed(2)); document.getElementById(id).innerHTML = '$'+cost+''; document.getElementById(id).value = cost; } function countBoxes(totalArea, totalWall, pieces, thick1piece, weight1p, weight25p, widthTotal, heightTotal,thickTotal, costArea, costWall, sqft1, position, sqftOnePice, thickOnePiece, price, name, ident, header,lenFeet,lenInches,widFeet,widInches,p){ if(document.getElementById(totalArea).value==0 || document.getElementById(totalWall).value==0){ //alert('Insert dimensions'); //document.getElementById('boxes').style.visibility = 'hidden'; }else{ var myBoxes=new Array(); //alert(document.getElementById(totalArea).value) ; var html = null; var lenghtArea = document.getElementById('lenghtArea').value; var widthArea = document.getElementById('widthArea').value; var lenghtWall = document.getElementById('lenghtWall').value; var widthWall = document.getElementById('widthWall').value; if(ident==0){ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var lenghtArea = document.getElementById('lenghtArea').value; var widthArea = document.getElementById('widthArea').value; var lenghtWall = document.getElementById('lenghtWall').value; var widthWall = document.getElementById('widthWall').value; if(a==1 && p==0){ var textArea = '
0 Corners + 0 Borders + '+a+' Inside =  '+a+' Piece
'; } if(p==1 && a==1 ){ var textArea = '
'+a+' Inside
'; } if(p==1 && a!=1 ){ var textArea = '
'+a+' Insides
'; } else{ var corner =4; var borderArea = document.getElementById('borderArea').value; var insideArea = document.getElementById('insideArea').value; var borderWall = document.getElementById('borderWall').value; var insideWall = document.getElementById('insideWall').value; var textArea = '
'+corner+' Corners + '+borderArea+ ' Borders + '+insideArea+' Insides =  '+a+' Pieces
'; //var textWall = '
'+corner+' Corners + '+borderWall+ ' Borders + '+insideWall+' Insides =  '+b+' Pieces
'; } if(b==1){ var textWall = '
'+b+' Inside
'; }else { var textWall = '
'+b+' Insides
'; } }else if(ident==2){ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var textArea = '
'+a/4+' Sets of 4 x 1\' x 1\' x 5/8 \"
'; var textWall = '
'+b/4+' Sets of 4 x 1\' x 1\' x 5/8 \"
'; } else{ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var corner = 0; var borderArea = 0; var insideArea = a; var borderWall = 0; var insideWall = b; if(a==1)var textArea = '
'+a+' Inside with detachable Corner & Border pieces
'; else var textArea = '
'+a+' Insides with detachable Corner & Border pieces
'; if(b==1) var textWall = '
'+b+' Inside with detachable Corner & Border pieces
'; else var textWall = '
'+b+' Insides with detachable Corner & Border pieces
'; } var totalArea = document.getElementById(totalArea).value; var costArea = document.getElementById(costArea).value; var totalWall = document.getElementById(totalWall).value; var costWall = document.getElementById(costWall).value; var sqftArea = Math.round(totalArea*sqft1); var sqftWall = Math.round(totalWall*sqft1); var count = 0; var count1 = 0; //var qMasAR = 0; var totalWeightArea = 0; var totalWeightWall = 0; var masterCartonArea = Math.floor(totalArea/pieces); var partialCartonArea = totalArea - pieces*masterCartonArea; var masterCartonWall = Math.floor(totalWall/pieces); var partialCartonWall = totalWall - pieces*masterCartonWall; //FIRST CASE if(partialCartonArea != 0 && partialCartonWall != 0){ var qParAR = 1; var qParWW = 1; if(totalArea<=25){ var html = '
'; html += '
'; // html += '
'; }else{ //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; } html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; }else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } totalWeightArea+=(count-1)*weight25p; if(count == 1){ var qMasAR = count-1; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs   $256.06
'; html+='
'; html+='
'; html+='
'; //WALL TO WALL HEADER if(totalWall<25){ html += '
'; // html += '
'; }else{ html += '
'; //html += '
'; } html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; }else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; /*html+='

Box '+k+':   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs.

';*/ count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1-1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var boxW = 'boxes'; var qMasWW = count1 - 1; html+='
1 of '+count+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='

Box 1:   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs.

'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; html +='
'; } //SECOND CASE else if(partialCartonArea != 0 && partialCartonWall == 0){ var qParAR = 1; var qParWW = 0; //AREA RUG HEADER if(totalWall<=25){ var html = '
'; html += '
'; //html += '
'; }else{ var html = '
'; html += '
'; //html += '
'; } html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; }else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(thickTotal); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } if(count == 1){ var qMasAR = count-1; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } totalWeightArea+=(count-1)*weight25p; html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; html+='
'; //WALL TO WALL HEADER if(totalWall<=25){ html += '
'; // html += '
'; }else{ html += '
'; // html += '
'; } html += '
'; // html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; } else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price)+' sq.ft.)
'; html+='
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; html+='
'; } //THIRD CASE else if(partialCartonArea == 0 && partialCartonWall != 0){ var qParAR = 0; var qParWW = 1; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; } else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var boxA = 'boxes'; var qMasAR = count; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; }else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var qMasWW = count1-1; var boxW = 'boxes'; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; //html+='
'; html+='
'; html+='
'; html+='
'; } //FOURTH CASE else if(partialCartonArea == 0 && partialCartonWall == 0){ var qParAR = 0; var qParWW = 0; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; }else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasAR = count; var boxA = 'boxes'; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; // html += '
'; html += '
'; //html += '
'; if(p==0){ html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; }else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; // html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; /*html+='

Box '+k+':   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs.

';*/ count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; html+='
'; } //html += '
'; /*getElementByClass('popTextRed'); getElementByClass('popTextBlack'); getElementByClass('rightSide'); getElementByClass('leftSide');*/ //myWindow.document.getElementById('boxes').innerHTML += html; //document.getElementById('boxes').style.top = position; //myWindow.document.getElementById('boxes').style.visibility="visible"; myBoxes[0] = html; myBoxes[1] = qMasAR; myBoxes[2] = widthTotal; myBoxes[3] = heightTotal; myBoxes[4] = thickTotal; myBoxes[5] = weight25p; myBoxes[6] = qParAR; myBoxes[7] = thickArea; myBoxes[8] = weightArea; myBoxes[9] = qMasWW; myBoxes[10] = qParWW; myBoxes[11] = thickWall; myBoxes[12] = weightWall; myBoxes[13] = costArea; myBoxes[14] = costWall; myBoxes[15] = lenghtArea; myBoxes[16] = widthArea; myBoxes[17] = lenghtWall; myBoxes[18] = widthWall; myBoxes[19] = corner; myBoxes[20] = borderArea; myBoxes[21] = insideArea; myBoxes[22] = borderWall; myBoxes[23] = insideWall; myBoxes[24] = a; return myBoxes; } } /**************************************************/ function countBoxes4(totalArea, totalWall, pieces, thick1piece, weight1p, weight25p, widthTotal, heightTotal,thickTotal, costArea, costWall, sqft1, position, sqftOnePice, thickOnePiece, price, name, ident, header,lenFeet,lenInches,widFeet,widInches,p ){ if(document.getElementById(totalArea).value==0 || document.getElementById(totalWall).value==0){ //alert(document.getElementById(totalArea).value); //document.getElementById('boxes').style.visibility = 'hidden'; }else{ var lenghtArea = document.getElementById('lenght4by4Area').value; var widthArea = document.getElementById('width4by4Area').value; var lenghtWall = document.getElementById('lenght4by4Wall').value; var widthWall = document.getElementById('width4by4Wall').value; var myBoxes=new Array(); var thickArea = 0; var thickWall = 0; var weightArea = 0; var weightWall =0; if(ident==0){ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var lenghtArea = document.getElementById('lenghtArea').value; var widthArea = document.getElementById('widthArea').value; var lenghtWall = document.getElementById('lenghtWall').value; var widthWall = document.getElementById('widthWall').value; var corner =4; var borderArea = document.getElementById('borderArea').value; var insideArea = document.getElementById('insideArea').value; var borderWall = document.getElementById('borderWall').value; var insideWall = document.getElementById('insideWall').value; var textArea = '
'+corner+' Corners + '+borderArea+ ' Borders + '+insideArea+' Insides =  '+a+' Pieces
'; var textWall = '
'+corner+' Corners + '+borderWall+ ' Borders + '+insideWall+' Insides =  '+b+' Pieces
'; }else{ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var textArea = '
'+a+' Insides with detachable Corner & Border pieces
'; var textWall = '
'+b+' Insides with detachable Corner & Border pieces
'; } var totalArea = document.getElementById(totalArea).value; var costArea = document.getElementById(costArea).value; var totalWall = document.getElementById(totalWall).value; var costWall = document.getElementById(costWall).value; var sqftArea = Math.round(totalArea*sqft1); var sqftWall = Math.round(totalWall*sqft1); var count = 0; var count1 = 0; var totalWeightArea = 0; var totalWeightWall = 0; var masterCartonArea = Math.floor(totalArea/pieces); var partialCartonArea = totalArea - pieces*masterCartonArea; var masterCartonWall = Math.floor(totalWall/pieces); var partialCartonWall = totalWall - pieces*masterCartonWall; //FIRST CASE if(partialCartonArea != 0 && partialCartonWall != 0){ var qParAR = 1; var qParWW = 1; //AREA RUG HEADER if(totalArea<10){ var html = '
'; html += '
'; //html += '
'; }else{ var html = '
'; html += '
'; //html += '
'; } html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } totalWeightArea+=(count-1)*weight25p; if(count == 1){ var qMasAR = count-1; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER if(totalWall<10){ html += '
'; //html += '
'; }else{ html += '
'; //html += '
'; } html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1-1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var qMasWW = count1-1; var boxW = 'boxes'; html+='
1 of '+count+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; //html+='

Box 1:   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs.

'; html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //SECOND CASE else if(partialCartonArea != 0 && partialCartonWall == 0){ var qParAR = 1; var qParWW = 0; //AREA RUG HEADER if(totalWall<=10){ var html = '
'; html += '
'; //html += '
'; }else{ var html = '
'; html += '
'; //html += '
'; } html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(thickTotal); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } if(count == 1){ var qMasAR = count; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } totalWeightArea+=(count-1)*weight25p; html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER if(totalWall<=10){ html += '
'; //html += '
'; }else{ html += '
'; //html += '
'; } html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; // html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //THIRD CASE else if(partialCartonArea == 0 && partialCartonWall != 0){ var qParAR = 0; var qParWW = 1; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //var html = '
'; //html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasAR = count; var boxA = 'boxes'; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' x '+widthWall+'\' WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var qMasWW = count1-1; var boxW = 'boxes'; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"    '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //FOURTH CASE else if(partialCartonArea == 0 && partialCartonWall == 0){ var qParAR = 0; var qParWW = 0; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //var html = '
'; //html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtArea+'\' x '+widthArea+'\' = '+sqftArea+' sq.ft.
'; for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasAR = count; var boxA = 'boxes'; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' x '+widthArea+'\' AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWall+'\' x '+widthWall+'\' = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; /*html+='

Box '+k+':   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs.

';*/ count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+price+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } myBoxes[0] = html; myBoxes[1] = qMasAR; myBoxes[2] = widthTotal; myBoxes[3] = heightTotal; myBoxes[4] = thickTotal; myBoxes[5] = weight25p; myBoxes[6] = qParAR; myBoxes[7] = thickArea; myBoxes[8] = weightArea; myBoxes[9] = qMasWW; myBoxes[10] = qParWW; myBoxes[11] = thickWall; myBoxes[12] = weightWall; myBoxes[13] = lenghtWall; myBoxes[14] = widthWall; myBoxes[15] = lenghtArea; myBoxes[16] = widthArea; myBoxes[17] = costArea; myBoxes[18] = costWall; myBoxes[19] = 0; myBoxes[20] = 0; myBoxes[21] = totalArea; myBoxes[22] = 0; myBoxes[23] = totalWall; return myBoxes; } } /******************************************************/ function countBoxes1(totalArea, totalWall, pieces, thick1piece, weight1p, weight25p, widthTotal, heightTotal,thickTotal, costArea, costWall, sqft1, position, sqftOnePice, thickOnePiece, price, name, ident, header,lenFeet,lenInches,widFeet,widInches,p){ if(document.getElementById(totalArea).value==0 || document.getElementById(totalWall).value==0){ //alert('Insert dimensions'); //document.getElementById('boxes').style.visibility = 'hidden'; }else{ var myBoxes=new Array(); var thickArea = 0; var thickWall = 0; var weightArea = 0; var weightWall =0; var lenghtArea = document.getElementById('lenght1mby1mArea').value; var widthArea = document.getElementById('width1mby1mArea').value; var lenghtWall = document.getElementById('lenght1mby1mWall').value; var widthWall = document.getElementById('width1mby1mWall').value; var lenghtAreaFeet = Math.floor(lenghtArea); var lenghtAreaInch = ((lenghtArea - lenghtAreaFeet)*12).toFixed(0); var widthAreaFeet = Math.floor(widthArea); var widthAreaInch = ((widthArea - widthAreaFeet)*12).toFixed(0); var lenghtWallFeet = Math.floor(lenghtWall); var lenghtWallInch = ((lenghtWall - lenghtWallFeet)*12).toFixed(0); var widthWallFeet = Math.floor(widthWall); var widthWallInch = ((widthWall - widthWallFeet)*12).toFixed(0); if(ident==0){ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var lenghtArea = document.getElementById('lenghtArea').value; var widthArea = document.getElementById('widthArea').value; var lenghtWall = document.getElementById('lenghtWall').value; var widthWall = document.getElementById('widthWall').value; var corner =4; var borderArea = document.getElementById('borderArea').value; var insideArea = document.getElementById('insideArea').value; var borderWall = document.getElementById('borderWall').value; var insideWall = document.getElementById('insideWall').value; var textArea = '
'+corner+' Corners + '+borderArea+ ' Borders + '+insideArea+' Insides =  '+a+' Pieces
'; var textWall = '
'+corner+' Corners + '+borderWall+ ' Borders + '+insideWall+' Insides =  '+b+' Pieces
'; }else{ var a = document.getElementById(totalArea).value; var b = document.getElementById(totalWall).value; var textArea = '
'+a+' Insides with detachable Corner & Border pieces
'; var textWall = '
'+b+' Insides with detachable Corner & Border pieces
'; } var totalArea = document.getElementById(totalArea).value; var costArea = document.getElementById(costArea).value; var totalWall = document.getElementById(totalWall).value; var costWall = document.getElementById(costWall).value; var sqftArea = Math.round(totalArea*sqft1); var sqftWall = Math.round(totalWall*sqft1); var count = 0; var count1 = 0; var totalWeightArea = 0; var totalWeightWall = 0; var masterCartonArea = Math.floor(totalArea/pieces); var partialCartonArea = totalArea - pieces*masterCartonArea; var masterCartonWall = Math.floor(totalWall/pieces); var partialCartonWall = totalWall - pieces*masterCartonWall; //FIRST CASE if(partialCartonArea != 0 && partialCartonWall != 0){ var qParAR = 1; var qParWW = 1; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } totalWeightArea+=(count-1)*weight25p; if(count == 1){ var qMasAR = count-1; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" = '+sqftWall+' sq.ft.
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; /*html+='

Box '+k+':   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs.

';*/ count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1-1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var qMasWW = count1-1; var boxW = 'boxes'; html+='
1 of '+count+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //SECOND CASE else if(partialCartonArea != 0 && partialCartonWall == 0){ var qParAR = 1; var qParWW = 0; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" = '+sqftArea+' sq.ft.
'; var thickArea = Math.round(partialCartonArea*thick1piece); var weightArea = Math.round(partialCartonArea*weight1p); var thickWall = Math.round(thickTotal); count+=1; totalWeightArea+=weightArea; for(var i=1; i<=masterCartonArea; i++){ var masterCarton1Area = pieces; j = i+1; count+=1; } if(count == 1){ var qMasAR = count; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; var boxA = 'box'; }else{ var qMasAR = count-1; var boxA = 'boxes'; html+='
1 of '+count+'   '+partialCartonArea+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickArea+'\"   '+Math.round(weightArea)+' lbs
'; html+='
2 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } totalWeightArea+=(count-1)*weight25p; html+='
$'+addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //THIRD CASE else if(partialCartonArea == 0 && partialCartonWall != 0){ var qParAR = 0; var qParWW = 1; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" = '+sqftArea+' sq.ft.
'; var thickWall = Math.round(partialCartonWall*thick1piece); var weightWall = Math.round(partialCartonWall*weight1p); for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasAR = count; var boxA = 'boxes'; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; //html+='
'+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" = '+sqftWall+' sq.ft.
'; html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; count1+=1; totalWeightWall+=weightWall; for(var i=1; i<=masterCartonWall; i++){ var masterCarton1Wall = pieces; k = i+1; count1+=1; } totalWeightWall+=(count1-1)*weight25p; if(count1 == 1){ var qMasWW = count1; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; var boxW = 'box'; }else{ var qMasWW = count1-1; var boxW = 'boxes'; html+='
'; html+='
1 of '+count1+'   '+partialCartonWall+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickWall+'\"   '+Math.round(weightWall)+' lbs
'; html+='
2 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+addCommas(costWall)+' + Freight
'; //html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } //FOURTH CASE else if(partialCartonArea == 0 && partialCartonWall == 0){ var qParAR = 0; var qParWW = 0; //AREA RUG HEADER var html = '
'; html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" AREA RUG = '+sqftArea+' sq.ft.
'; else html+= '
'+totalArea+' = '+sqftArea+' sq.ft.
'; html+=''+textArea+''; //html+='
'+lenghtAreaFeet+'\' '+lenghtAreaInch+'\" x '+widthAreaFeet+'\' '+widthAreaInch+'\" = '+sqftArea+' sq.ft.
'; for(var i=1; i<=masterCartonArea; i++){ count+=1; } totalWeightArea+=(count)*weight25p; if(count == 1){ var qMasAR = count; var boxA = 'box'; html+='
1 of '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; }else{ var qMasAR = count; var boxA = 'boxes'; html+='
1 to '+count+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs
'; } html+='
$'+addCommas(costArea)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costArea)+' + Freight
'; //html+='
'+count+' '+boxA+'   '+totalArea+' pieces   '+totalWeightArea+' lbs
'; html+='
'; html+='
'; //WALL TO WALL HEADER html += '
'; //html += '
'; html += '
'; //html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" WALL TO WALL = '+sqftWall+' sq.ft.
'; else html+= '
'+totalWall+' = '+sqftWall+' sq.ft.
'; html+=''+textWall+''; // html+='
'+lenghtWallFeet+'\' '+lenghtWallInch+'\" x '+widthWallFeet+'\' '+widthWallInch+'\" = '+sqftWall+' sq.ft.
'; for(var i=1; i<=masterCartonWall; i++){ k = i+1; /*html+='

Box '+k+':   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"   '+weight25p+' lbs.

';*/ count1+=1; } totalWeightWall+=(count1)*weight25p; if(count1 == 1){ var qMasWW = count1; var boxW = 'box'; html+='
1 of '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"    '+weight25p+' lbs
'; }else{ var qMasWW = count1; var boxW = 'boxes'; html+='
1 to '+count1+'   '+pieces+' pieces   '+widthTotal+'\" x '+heightTotal+'\" x '+thickTotal+'\"    '+weight25p+' lbs
'; } html+='
$'+ addCommas(costWall)+'   ($'+(price*sqft1).toFixed(2)+' per piece or $'+(price).toFixed(2)+' sq.ft.)
'; html+='
'; html+='
$'+addCommas(costWall)+' + Freight
'; html+='
'+count1+' '+boxW+'   '+totalWall+' pieces   '+totalWeightWall+' lbs
'; html+='
'; html+='
'; } myBoxes[0] = html; myBoxes[1] = qMasAR; myBoxes[2] = widthTotal; myBoxes[3] = heightTotal; myBoxes[4] = thickTotal; myBoxes[5] = weight25p; myBoxes[6] = qParAR; myBoxes[7] = thickArea; myBoxes[8] = weightArea; myBoxes[9] = qMasWW; myBoxes[10] = qParWW; myBoxes[11] = thickWall; myBoxes[12] = weightWall; myBoxes[13] = lenghtWall; myBoxes[14] = widthWall; myBoxes[15] = lenghtArea; myBoxes[16] = widthArea; myBoxes[17] = costArea; myBoxes[18] = costWall; myBoxes[20] = 0; myBoxes[21] = totalArea; myBoxes[22] = 0; myBoxes[23] = totalWall; return myBoxes; } } function playLearn(totalArea, totalWall, header, cost1310, cost1311,lenFeet,lenInches,widFeet,widInches,p){ if(document.getElementById(totalArea).value==0 || document.getElementById(totalWall).value==0){ //alert('Insert dimensions'); //document.getElementById('boxes').style.visibility = 'hidden'; }else{ var myBoxes=new Array(); var lenghtArea = document.getElementById('lenghtPLArea').value; var widthArea = document.getElementById('widthPLArea').value; var lenghtWall = document.getElementById('lenghtPLWall').value; var widthWall = document.getElementById('widthPLWall').value; var q1310AR = 0; var q1310WW = 0; var lenght1310 = 26; var width1310 = 15; var height1310 = 14; var weight1310 = 13; var q1311AR = 0; var q1311WW = 0; var lenght1311 = 26; var width1311 = 25; var height1311 = 14; var weight1311 = 24; var position = '0px'; var area = document.getElementById(totalArea).value; var wall = document.getElementById(totalWall).value; var edgesArea = 2*lenghtArea + 2*widthArea; var edgesWall = 2*lenghtWall + 2*widthWall; var cost1310 = new Number(cost1310); var cost1311 = new Number(cost1311); var moreBoxesArea = ''; /*AREA RUG*/ var html = '
'; html += '
'; //html += '
'; html += '
'; /*COUNTING AREA PIECES*/ if(area <= 36){ var q1310AR = 1; if(area < 36){ var extraPiecesArea = 36-area; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
1 Set of Style 1310 = '+36+' total pieces minus '+area+' needed pieces = '+extraPiecesArea+' extra pieces which can be used for cubes, names, walls, etc.
'; }else{ html+= '
1 Set of Style 1310 = '+36+' total pieces
'; } //html+='
'+lenghtArea+'\' 6\" x '+widthArea+'\' 6\"
'; var boxArea ='1 of 1    36 pieces    26\" x 15\" x 14\"   13lbs'; html+='
'+boxArea+'
'; var totalA = '1 box   36 pieces   13lbs'; var costArea = cost1310; var commentArea = '($'+cost1310+' per set of style 1310)'; html+='
$'+costArea+'   '+commentArea+'
'; html+='
'; //html+='
'+totalA+'
'; html+='
'; html+='
'; if(area<36){ //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(area > 36 && area < 72 || area == 72){ var q1311AR = 1; var costArea = cost1311; var commentArea = '($'+cost1311+' per set of style 1311)'; var boxArea ='1 of 1   72 pieces   26\" x 25\" x 14\"   24lbs'; var totalA = '1 box   72 pieces   24lbs'; if(area == 72){ if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
1 Set of Style 1311 = 72 total pieces
'; }else if(area > 36 && area < 72){ var extraPiecesArea = 72 - area; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
1 Set of Style 1311 = '+72+' total pieces minus '+area+' needed pieces = '+extraPiecesArea+' extra pieces which can be used for cubes, names, walls, etc.
'; } //html+='
'+lenghtArea+'\' 6\" x '+widthArea+'\' 6\"
'; html+='
'+boxArea+'
'; html+='
$'+costArea+'   '+commentArea+'
'; html+='
'; //html+='
'+totalA+'
'; html+='
'; html+='
'; if(area > 36 && area < 72){ //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(area > 72){ var setArea = Math.floor(area/72); var difArea = area - 72*setArea; if(setArea == 1 ){var set = 'Set';}else{var set = 'Sets';} if(difArea <= 36 && difArea != 0){ var q1310AR = 1; var q1311AR = setArea; var totalSet = setArea*72 + 36; var extraPieces = totalSet - area; var totalBoxArea = setArea +1; var totalWeight = weight1311*setArea + weight1310; var costArea = addCommas((setArea*cost1311 + cost1310).toFixed(2)); var commentArea = '($'+cost1310+' per set of style 1310 and $'+cost1311+' per set of style 1311)'; var boxArea ='1 of '+totalBoxArea+'   36 pieces    26\" x 15\" x 14\"   13lbs'; var moreBoxesArea = '2 to '+totalBoxArea+'   72 pieces   26\" x 25\" x 14\"   24lbs'; var totalA = ''+totalBoxArea+' boxes   '+totalSet+' pieces   '+totalWeight+'lbs'; if(difArea == 36){ if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
Combine 1 Set of Style 1310 + '+setArea+' '+set+' of Style 1311 = '+totalSet+' total pieces
'; }else{ if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
Combine 1 Set of Style 1310 + '+setArea+' '+set+' of Style 1311 = '+totalSet+' total pieces minus '+area+' needed pieces = '+extraPieces+' extra pieces which can be used for cubes, names, walls, etc.
'; } // html+='
'+lenghtArea+'\' 6\" x '+widthArea+'\' 6\"
'; html+='
'+boxArea+'
'; html+='
'+moreBoxesArea+'
'; html+='
$'+costArea+'    '+commentArea+'
'; html+='
'; //html+='
'+totalA+'
'; html+='
'; html+='
'; if(difArea != 36){ //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(difArea == 0){ var totalSet = setArea*72; var q1310AR = 0; var q1311AR = setArea; var extraPieces = totalSet - area; var costArea = addCommas((setArea*cost1311).toFixed(2)); var totalWeight = weight1311*setArea; var commentArea = '($'+cost1311+' per set of style 1311)'; var boxArea ='1 to '+setArea+'   72 pieces   26\" x 25\" x 14\"   24lbs'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; var totalA = ''+setArea+' boxes   '+totalSet+' pieces   '+totalWeight+'lbs'; html+= '
Combine '+setArea+' '+set+' of Style 1311 = '+totalSet+' total pieces
'; // html+='
'+lenghtArea+'\' 6\" x '+widthArea+'\' 6\"
'; html+='
'+boxArea+'
'; html+='
$'+costArea+'    '+commentArea+'
'; html+='
'; //html+='
'+totalA+'
'; html+='
'; html+='
'; }else if(difArea > 36){ setArea += 1; var q1311AR = setArea; var totalSet = setArea*72; var costArea = addCommas((setArea*cost1311).toFixed(2)); var commentArea = '($'+cost1311+' per set of style 1311)'; var totalWeight = weight1311 * setArea; var extraPieces = totalSet - area; var totalA = ''+setArea+' boxes   '+totalSet+' pieces   '+totalWeight+' lbs'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtArea+'\' 6\" x '+widthArea+'\' 6\" AREA RUG
'; html+= '
Combine '+setArea+' Sets of Style 1311 = '+totalSet+' total pieces minus '+area+' needed pieces = '+extraPieces+' extra pieces which can be used for cubes, names, walls, etc.
'; // html+='
'+lenghtArea+'\' 6\" x '+widthArea+'\' 6\"
'; html+='
'+boxArea+'
'; var boxArea ='1 to '+setArea+'    72 Pieces    26\" x 25\" x 14\"    24lbs'; html+='
$'+costArea+'   '+commentArea+'
'; html+='
'; html+='
'; html+='
'; } } html+='
'; html+='
'; /*WALL TO WALL*/ html += '
'; //html += '
'; html += '
'; /*COUNTING WALL TO WALL*/ if(wall <= 36){ var q1310WW = 1; if(wall < 36){ var extraPiecesWall = 36-wall; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' 6\" x '+widthWall+'\' 6\" WALL TO WALL
'; html+= '
1 Set of Style 1310 = '+36+' total pieces minus '+wall+' needed pieces = '+extraPiecesWall+' extra pieces which can be used for cubes, names, walls, etc.
'; }else{ html+= '
1 Set of Style 1310 = '+36+' total pieces
'; } //html+='
'+lenghtWall+'\' 6\" x '+widthWall+'\' 6\"
'; var boxWall ='1 of 1   36 pieces   26\" x 15\" x 14\"   13lbs'; html+='
'+boxWall+'
'; var costWall = cost1310; var commentWall = '($'+cost1310+' per set of style 1310)'; html+='
$'+costWall+'   '+commentWall+'
'; html+='
'; var totalW = '1 box   36 pieces   13lbs'; //html+='
'+totalW+'
'; html+='
'; html+='
'; if(wall<36){ // html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(wall > 36 && wall < 72 || wall == 72){ var q1311WW = 1; var costWall = cost1311; var commentWall = '($'+cost1311+' per set of style 1311)'; var boxWall ='1 of 1   72 pieces   26\" x 25\" x 14\"   24lbs'; var totalW = '1 box   72 pieces   24lbs'; if(wall == 72){ if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' 6\" x '+widthWall+'\' 6\" WALL TO WALL
'; html+= '
1 Set of Style 1311 = 72 total pieces
'; }else if(wall > 36 && wall < 72){ var extraPiecesWall = 72 - wall; html+= '
1 Set of Style 1311 = '+72+' total pieces minus '+wall+' needed pieces = '+extraPiecesWall+' extra pieces which can be used for cubes, names, walls, etc.
'; } //html+='
'+lenghtWall+'\' 6\" x '+widthWall+'\' 6\"
'; html+='
'+boxWall+'
'; html+='
$'+costWall+'   '+commentWall+'
'; html+='
'; //html+='
'+totalW+'
'; html+='
'; html+='
'; if(wall > 36 && wall < 72){ //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(wall > 72){ var setWall = Math.floor(wall/72); var difWall = wall - 72*setWall; if(setWall == 1 ){var set = 'Set';}else{var set = 'Sets';} if(difWall <= 36 && difWall != 0){ var q1310WW = 1; var q1311WW = setWall; var totalSet = setWall*72 + 36; var extraPieces = totalSet - wall; var totalBoxWall = setWall +1; var totalWeight = weight1311*setWall + weight1310; var costWall = addCommas((setWall*cost1311 + cost1310).toFixed(2)); var commentWall = '($'+cost1310+' per set of style 1310 and $'+cost1311+' per set of style 1311)'; var boxWall ='1 of '+totalBoxWall+'   36 pieces   26\" x 15\" x 14\"   13lbs'; var moreBoxesWall = '2 to '+totalBoxWall+'   72 pieces   26\" x 25\" x 14\"   24lbs'; var totalW = ''+totalBoxWall+' boxes   '+totalSet+' pieces   '+totalWeight+'lbs'; if(difWall == 36){ if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' 6\" x '+widthWall+'\' 6\" WALL TO WALL
'; html+= '
Combine 1 Set of Style 1310 + '+setWall+' '+set+' of Style 1311 = '+totalSet+' total pieces
'; }else{ html+= '
Combine 1 Set of Style 1310 + '+setWall+' '+set+' of Style 1311 = '+totalSet+' total pieces minus '+wall+' needed pieces = '+extraPieces+' extra pieces which can be used for cubes, names, walls, etc.
'; } //html+='
'+lenghtWall+'\' 6\" x '+widthWall+'\' 6\"
'; html+='
'+boxWall+'
'; html+='
$'+costWall+'   '+commentWall+'
'; html+='
'; html+='
'+moreBoxesWall+'
'; //html+='
'+totalW+'
'; html+='
'; html+='
'; if(difWall != 36){ //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } }else if(difWall == 0){ var q1310WW = 0; var q1311WW = setWall; var totalSet = setWall*72; var extraPieces = totalSet - wall; var costWall = addCommas((setWall*cost1311).toFixed(2)); var totalWeight = weight1311*setWall; var commentWall = '($'+cost1311+' per set of style 1311)'; var boxWall ='1 to '+setWall+'   72 pieces   26\" x 25\" x 14\"   24lbs'; var totalW = ''+setWall+' boxes   '+totalSet+' pieces   '+totalWeight+'lbs'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' 6\" x '+widthWall+'\' 6\" WALL TO WALL
'; html+= '
Combine '+setWall+' '+set+' of Style 1311 = '+totalSet+' total pieces
'; //html+='
'+lenghtWall+'\' 6\" x '+widthWall+'\' 6\"
'; html+='
'+boxWall+'
'; html+='
$'+costWall+'   '+commentWall+'
'; html+='
'; //html+='
'+totalW+'
'; html+='
'; html+='
'; }else if(difWall > 36){ setWall += 1; var q1311WW = setWall; var totalSet = setWall*72; var costWall = addCommas((setWall*cost1311).toFixed(2)); var commentWall = '($'+cost1311+' per set of style 1311)'; var totalWeight = weight1311 * setWall; var extraPieces = totalSet - wall; var totalW = ''+setWall+' boxes   '+totalSet+' pieces   '+totalWeight+' lbs'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+lenghtWall+'\' 6\" x '+widthWall+'\' 6\" WALL TO WALL
'; html+= '
Combine '+setWall+' Sets of Style 1311 = '+totalSet+' total pieces minus '+wall+' needed pieces = '+extraPieces+' extra pieces which can be used for cubes, names, walls, etc.
'; //html+='
'+lenghtWall+'\' 6\" x '+widthWall+'\' 6\"
'; var boxWall ='1 to '+setWall+'    72 Pieces    26\" x 25\" x 14\"    24lbs'; html+='
'+boxWall+'
'; html+='
$'+costWall+'   '+commentWall+'
'; html+='
'; //html+='
'+totalW+'
'; html+='
'; html+='
'; //html+='
*extra pieces can be used for cubes, names, walls, etc.
'; } } html+='
'; myBoxes[0] = html; myBoxes[1] = q1310AR; myBoxes[2] = lenght1310; myBoxes[3] = width1310; myBoxes[4] = height1310; myBoxes[5] = weight1310; myBoxes[6] = q1311AR; myBoxes[7] = lenght1311; myBoxes[8] = width1311; myBoxes[9] = height1311; myBoxes[10] = weight1311; myBoxes[11] = q1310WW; myBoxes[12] = q1311WW; myBoxes[13] = costArea; myBoxes[14] = costWall; myBoxes[15] = lenghtArea; myBoxes[16] = widthArea; myBoxes[17] = lenghtWall; myBoxes[18] = widthWall; myBoxes[19] = 0; myBoxes[20] = 0; myBoxes[21] = area; myBoxes[22] = 0; myBoxes[23] = wall; return myBoxes; } } /********SoftMats************/ function countBoxesMats(position, header, costSM,totalSM,lenFeet,lenInches,widFeet,widInches,p){ var myBoxes = new Array(); var totalSM = document.getElementById(totalSM).value; var totalCostSM = (costSM*totalSM).toFixed(2); var html = ''; html+='
'; html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+totalSM+' SEPARATE 4\' x 6\' PIECES
'; else html+= '
'+totalSM+' SEPARATE 4\' x 6\' PIECES
'; if(totalSM == 1){ html += '
1 of 1   1 piece   49\" x 7\" x 7\"   6 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $1.86 sq.ft.)
'; html+='
'; html+='
'; html+='
'; }else{ html += '
1 to '+totalSM+'   1 piece   49\" x 7\" x 7\"   6 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $1.86 sq.ft.)
'; html+='
'; html+='
'; html+='
'; } //html+= '
'+costSM+'
'; //html+='
'; html +='
'; // html +='
'; // html += '
'; //html += '
'; //html += '
'; //html += '
'; //html +='
'; // myWindow.document.getElementById('boxes').innerHTML += html; //document.getElementById('boxes').style.top = position; //myWindow.document.getElementById('boxes').style.visibility="visible"; myBoxes[0] = html; myBoxes[1] = totalSM; myBoxes[2] = 49; myBoxes[3] = 7; myBoxes[4] = 7; myBoxes[5] = 6; myBoxes[6] = totalCostSM; myBoxes[7] = 0; return myBoxes; } /***********SoftBamboo NARROW***********/ function countBoxesBambooNarrow1(position, header, costSM,totalSM,lenFeet,lenInches,widFeet,widInches,p){ var myBoxes = new Array(); var totalSM = document.getElementById(totalSM).value; var totalCostSM = (costSM*totalSM).toFixed(2); var html = ''; html+='
'; html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+totalSM+' SEPARATE 5\' x 10\' PIECES
'; else html+= '
'+totalSM+' SEPARATE 5\' x 10\' PIECES
'; if(totalSM == 1){ html += '
1 of 1   1 piece   61\" x 6\" x 6\"   20 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $3.99 sq.ft. )
'; html+='
'; html+='
'; html+='
'; }else{ html += '
1 to '+totalSM+'   1 piece   61\" x 6\" x 6\"   20 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $3.99 sq.ft.)
'; html+='
'; html+='
'; html+='
'; } //html+= '
'+costSM+'
'; //html+='
'; html +='
'; // html +='
'; // html += '
'; //html += '
'; //html += '
'; //html += '
'; //html +='
'; // myWindow.document.getElementById('boxes').innerHTML += html; //document.getElementById('boxes').style.top = position; //myWindow.document.getElementById('boxes').style.visibility="visible"; myBoxes[0] = html; myBoxes[1] = totalSM; myBoxes[2] = 61; myBoxes[3] = 6; myBoxes[4] = 6; myBoxes[5] = 20; myBoxes[6] = totalCostSM; myBoxes[7] = 0; return myBoxes; } function countBoxesBambooNarrow2(position, header, costSM,totalSM,lenFeet,lenInches,widFeet,widInches,p){ var myBoxes = new Array(); var totalSM = document.getElementById(totalSM).value; var totalCostSM = (costSM*totalSM).toFixed(2); var html = ''; html+='
'; html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+totalSM+' SEPARATE 5\' x 10\' PIECES
'; else html+= '
'+totalSM+' SEPARATE 5\' x 10\' PIECES
'; if(totalSM == 1){ html += '
1 of 1   1 piece   61\" x 6\" x 6\"   20 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $4.99 sq.ft.)
'; html+='
'; html+='
'; html+='
'; }else{ html += '
1 to '+totalSM+'   1 piece   61\" x 6\" x 6\"   20 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $4.99 sq.ft.)
'; html+='
'; html+='
'; html+='
'; } //html+= '
'+costSM+'
'; //html+='
'; html +='
'; // html +='
'; // html += '
'; //html += '
'; //html += '
'; //html += '
'; //html +='
'; // myWindow.document.getElementById('boxes').innerHTML += html; //document.getElementById('boxes').style.top = position; //myWindow.document.getElementById('boxes').style.visibility="visible"; myBoxes[0] = html; myBoxes[1] = totalSM; myBoxes[2] = 61; myBoxes[3] = 6; myBoxes[4] = 6; myBoxes[5] = 20; myBoxes[6] = totalCostSM; myBoxes[7] = 0; return myBoxes; } /***********SoftBamboo WIDE************/ function countBoxesBambooWide(position, header, costSM,totalSM,lenFeet,lenInches,widFeet,widInches,p){ var myBoxes = new Array(); var totalSM = document.getElementById(totalSM).value; var totalCostSM = (costSM*totalSM).toFixed(2); var html = ''; html+='
'; html += '
'; if(p==0) html+= '
'+lenFeet+'\' '+lenInches+'\" x '+widFeet+'\' '+widInches+'\" = '+totalSM+' SEPARATE 5\' x 10\' PIECES
'; else html+= '
'+totalSM+' SEPARATE 5\' x 10\' PIECES
'; if(totalSM == 1){ html += '
1 of 1   1 piece   61\" x 9\" x 9\"   40 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $9.99 sq.ft.)
'; html+='
'; html+='
'; html+='
'; }else{ html += '
1 to '+totalSM+'   1 piece   61\" x 9\" x 9\"   40 lbs
'; html+='
$'+totalCostSM+'   ($'+costSM+' per piece or $9.99 sq.ft.)
'; html+='
'; html+='
'; html+='
'; } //html+= '
'+costSM+'
'; //html+='
'; html +='
'; // html +='
'; // html += '
'; //html += '
'; //html += '
'; //html += '
'; //html +='
'; // myWindow.document.getElementById('boxes').innerHTML += html; //document.getElementById('boxes').style.top = position; //myWindow.document.getElementById('boxes').style.visibility="visible"; myBoxes[0] = html; myBoxes[1] = totalSM; myBoxes[2] = 61; myBoxes[3] = 9; myBoxes[4] = 9; myBoxes[5] = 40; myBoxes[6] = totalCostSM; myBoxes[7] = 0; return myBoxes; }