';
}
//FOURTH CASE
else if(partialCartonArea == 0 && partialCartonWall == 0){
var qParAR = 0;
var qParWW = 0;
//AREA RUG HEADER
var 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;
}