

function TermOptionsOutput()
{
	document.write('<select name="rental_term" id="rental_term" size="1" onChange="rentalTermAssign();">');	
	for(var i=0; i< arrTermOptions.length; i++)
	{
		document.write('\n<option value="' + arrTermOptions[i]["value"] + '">' + arrTermOptions[i]["text"] + '</option>');	
	}
	
	document.write('</select>');
	
	return;

}



function outputDiscountDescription()
{
	for(var i=0; i< arrTermOptions.length; i++)
	{
		if( arrTermOptions[i]["add"] != "" && arrTermOptions[i]["toshow"] != "" )
		{
			document.write('<br>' +  arrTermOptions[i]["toshow"]);
		}
	}
	
	return;
}




function rentalTermAssign()
{
	var myIndex = document.getElementById("rental_term").selectedIndex ;
	freeTerms = 0;
	deliveryDiscount = 0;
		
	if(myIndex == 0)
	{
		document.getElementById('rental_term3').value = "";
		termLength = 0;
		prepaid = 0;
	}
	else if( arrTermOptions[myIndex]["add"] == "")
	{
		document.getElementById('rental_term3').value = document.getElementById('rental_term').options[document.getElementById('rental_term').selectedIndex].text;
		termLength = arrTermOptions[myIndex]["term"];	
		prepaid = arrTermOptions[myIndex]["prepaid"];	
	}
	else
	{
		document.getElementById('rental_term3').value = arrTermOptions[myIndex]["add"];
		termLength = arrTermOptions[myIndex]["term"];
		prepaid = arrTermOptions[myIndex]["prepaid"];	

	}
}





function outputTable_1()
{

document.write("<table class=\"table_estimator\" width=\"510\" style=\"border:1px solid white;\" cellspacing=\"0\" cellpadding=\"7\">");
document.write("<tr>");
document.write("<td colspan=\"3\">Here are some items listed that you may find in your home or office. They are organized into familiar categories. To create a estimate on how much it will cost to store your items. Enter the quantities of each item you have. For items that are not listed, please enter the total approximate cubic feet of those unlisted items in the final field of the form.</td>");
document.write("</tr>");
document.write("<tr class=\"table_estimator\">");
document.write("<td class=\"estimator_head_row\" width=\"*\">QTY</td>");
document.write("<td class=\"estimator_head_row\" width=\"90%\">&nbsp;ITEM</td>");
document.write("<td class=\"estimator_head_row\" width=\"100\" nowrap=\"nowrap\">CUBIC FIT</td>");
document.write("</tr>");

	for(var i=0; i< arrSections.length; i++)
	{
		// output a section heading
		document.write('\n<tr class="section_head">');
		document.write('\n<td colspan="3">');
		document.write('\n<a href="javascript:void(0);" title="Click to expand" onClick="if(document.getElementById(\'item_table_'+i+'\').style.display==\'none\'){document.getElementById(\'item_table_'+i+'\').style.display=\'block\';}else{document.getElementById(\'item_table_'+i+'\').style.display=\'none\';}">');
		document.write('<span style="color:#000000;text-decoration:none;">'+ arrSections[i]["name"] + '</span>');
		document.write('<span style="color:#FFFFFF;font-weight:500;text-decoration:none;"> CLICK TO OPEN/CLOSE</span></a>');
		document.write('\n</td>');
		document.write('\n</tr>');
		
		
		// output items of the section 
		document.write('\n<tr >');
		document.write('\n<td colspan="3" style="padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;">\n');
			
			outputSectionItems( arrSections[i]["id"], i )
			
			
		document.write('\n</td>');
		document.write('\n</tr>');
	
	}

	document.write("</table>");
	
	
	
	return;
}





function outputSectionItems( CurrentSectionID, i)
{
	document.write('\n<table class="item_table" style="display: none;" id="item_table_'+i+'">');
	var count = 0;
	for(var k=0; k< arrItem.length; k++)
	{
		if( arrItem[k]["section_id"] == CurrentSectionID )
		{
			// row alternating colors
			if(count % 2 == 0)
			{
				document.write('\n<tr style="background-color:'+row_color+';">');
			}
			else
			{
				document.write('\n<tr style="background-color:'+row_color_alt+';">');
			}

			document.write('\n<td width="*">');
			document.write('\n<input type="text" size="2" maxlength="4" value="0" id="item_'+ arrItem[k]["id"] +'"  onBlur="CalculateTotal();" onKeyUp="CalculateTotal();">');
			document.write('\n</td>');

			document.write('\n<td nowrap width="90%" >&nbsp;&nbsp;');
			document.write(arrItem[k]["name"]);
			document.write('\n</td>');


			document.write('\n<td width="100" nowrap >&nbsp;&nbsp;');
			document.write(arrItem[k]["volume"] + ' cu.ft.');
			document.write('\n</td>');


			document.write('\n</tr>');
			count++;
		}
	}

	document.write('\n</table>\n');

	return;
}




function CalculateTotal()
{
	var Total = 0;
	for(var k=0; k< arrItem.length; k++)
	{
		var curValue = document.getElementById("item_"+ arrItem[k]["id"]).value;
		
		if( !isNaN( parseInt( curValue )))
		{
			Total = parseInt(Total) + parseInt(curValue) * arrItem[k]["volume"];
		}
		else
		{
			document.getElementById("item_"+ arrItem[k]["id"]).value = 0;
		}
	}
	
	var AddCustom =  document.getElementById("custom_cf").value;
	
	if( !isNaN( parseInt(AddCustom) ))
	{
		Total =  parseInt(Total) +  parseInt(AddCustom);
	}
	else
	{
		document.getElementById("custom_cf").value = 0;
	}

	
	total_cuft = Total;
	

	
	// calculate number of containers
	NumberOfContainers = Math.ceil(parseInt(Total) / parseInt(one_container_cuft));
	
	
	// the case when user knows how many containers needed and did not go to the 
	// estimator, but entered number of containers in the order form field	
	if( Total==0 && parseInt(document.getElementById("number_of_containers3").value)>0)
	{
		NumberOfContainers = parseInt(document.getElementById("number_of_containers3").value);
		Total = NumberOfContainers * one_container_cuft;
		// Total = Total + " available for use";
	}
	
	
	document.getElementById("number_of_containers").value = NumberOfContainers + "";
	document.getElementById("number_of_containers2").innerHTML = NumberOfContainers + "";
	document.getElementById("number_of_containers3").value = NumberOfContainers + "";
	
	document.getElementById("total_cf2").innerHTML = Total+"";
	document.getElementById("total_cf3").value = Total + "";
	
	
	return ;
}










function ClearAll()
{
	for(var k=0; k< arrItem.length; k++)
	{
		document.getElementById("item_"+ arrItem[k]["id"]).value = 0;
	}
	
	document.getElementById("custom_cf").value = "0";
	document.getElementById("total_cf2").innerHTML = "0";
	document.getElementById("number_of_containers2").innerHTML = "0";
	
	return;
}





function outputTable_2()
{
	
	var stringOut = "";
	//stringOut += '<p id="show_hide_det" style="padding-top:5px; padding-bottom:5px;"><a  href="javascript:void(0);" style="padding:5px; border:1px solid #A0CD67;" class="estimator_turcus_11" onClick="if(document.getElementById(\'details_on_invoice\').style.display==\'none\'){document.getElementById(\'details_on_invoice\').style.display=\'block\';this.innerHTML=\'[&ndash;] Hide Details\';}else{document.getElementById(\'details_on_invoice\').style.display=\'none\';this.innerHTML=\'[+] Show Details\';}">[+] Show Details</a></p>';
	
	stringOut += '<div id="details_on_invoice" style="width:510px;display:none;">';
	stringOut += '<table class="item_table"  border="0" cellspacing="1" cellpadding="3">';

	stringOut += '<tr>';
	stringOut += '<td class="estimator_head_row" width="10" nowrap>QTY</td>';
	stringOut += '<td class="estimator_head_row" width="400">&nbsp;ITEM</td>';
	stringOut += '<td class="estimator_head_row" width="100" nowrap>CUBIC&nbsp;FIT</td>';
	stringOut += '</tr>';
	

	
	for(var i=0; i< arrSections.length; i++)
	{
		// output a section heading
		stringOut += '<tr class="section_head">';
		stringOut += '<td colspan="3">';
		stringOut += arrSections[i]["name"] ;
		stringOut += '</td>';
		stringOut += '</tr>';
		
		
		// output items of the section 
			
			stringOut += outputSectionItemsAgain( arrSections[i]["id"], i );
			
	}
	
	
	var AddCustom =  document.getElementById("custom_cf").value;

	
	if( !isNaN( parseInt(AddCustom) && parseInt(AddCustom)>0))
	{
		// output a section heading
	/*	
		stringOut += '\n<tr class="section_head">';
		stringOut += '<td colspan="3">';
		stringOut += 'Other Item Description:';
		stringOut += '</td>';
		stringOut += '</tr>';
	*/	
	
		
		// output items of the section 
		stringOut += '<tr class="section_head">';
			stringOut += '<td colspan="2" width="410">';
			stringOut += 'Approximate Cubic Feet of Other Items:';
			stringOut += '</td>';
			stringOut += '<td width="100" align="right">';
			stringOut += AddCustom + '&nbsp;cu.ft.';
			stringOut += '</td>';
		stringOut += '</tr>';			
			
	}
	
	stringOut += '</table></div>';
	
//	stringOut += '<input type="button" OnClick="CalculateInvoice();" value="Calculate Invoice">';
	return stringOut;
}





function outputSectionItemsAgain( CurrentSectionID, i)
{

	var stringOut = "";
	var stringOut2 = '';
	stringOut2 += '<table border="0" cellspacing="0" cellpadding="0" class="item_table">';
	var count = 0;
	var hasStuff = 0;
	for(var k=0; k< arrItem.length; k++)
	{
		var CurrentValue = document.getElementById("item_"+ arrItem[k]["id"]).value;
		if( arrItem[k]["section_id"] == CurrentSectionID  &&  !isNaN( parseInt(CurrentValue)) )
		{
			
			if( parseInt( CurrentValue ) > 0 )
			{
				hasStuff = 1;
				// row alternating colors
				if(count % 2 == 0)
				{
					stringOut2 += '<tr style="background-color:'+row_color+';">';
				}
				else
				{
					stringOut2 += '<tr style="background-color:'+row_color_alt+';">';
				}

				stringOut2 += '<td   style="padding-top:3px;padding-bottom:3px;" width="10">&nbsp;&nbsp;';
				stringOut2 += CurrentValue;
				stringOut2 += '</td>';

				stringOut2 += '<td   style="padding-top:3px;padding-bottom:3px;" width="400">&nbsp;&nbsp;&nbsp;';
				stringOut2 += arrItem[k]["name"];
				stringOut2 += '</td>';


				stringOut2 += '<td width="100"  style="padding-top:3px;padding-bottom:3px;" align="right">';
				stringOut2 += arrItem[k]["volume"] + '&nbsp;cu.ft.';
				stringOut2 += '</td>';


				stringOut2 += '</tr>';
				count++;
			}
		}
	}

	stringOut2 += '</table>';
	
	if (hasStuff == 1) {
		stringOut += '<tr>';
		stringOut += '<td colspan="3" style="padding-top:0;padding-bottom:0; padding-left:0;padding-right:0;">';
		stringOut += stringOut2;
		stringOut += '</td>';
		stringOut += '</tr>';

	}
	

	return stringOut;
}




function clickedEstimate()
{
	var ToFlipOrNotToFlip = "dont_flip";
	
	// check if there is any data filled in the form
	for(var k=0; k< arrItem.length; k++)
	{
		var CurrentValue = document.getElementById("item_"+ arrItem[k]["id"]).value;
		if( !isNaN( parseInt(CurrentValue))  &&  parseInt( CurrentValue ) > 0 )
		{
			
			ToFlipOrNotToFlip = "flip";	
			break;
		}
	}
	
	// how about the custom item?
	var AddCustom =  document.getElementById("custom_cf").value;	
	
	if( !isNaN( parseInt(AddCustom)) && parseInt(AddCustom)>0 )
	{
		ToFlipOrNotToFlip = "flip";
	}
	
	
	
	if( ToFlipOrNotToFlip ==  "flip")
	{
		document.getElementById('estime').innerHTML = outputTable_2();
		document.getElementById('step_1').style.display='none';
		document.getElementById('step_2').style.display='block';
	}
	else
	{
		alert("Sorry, the form is not filled in");
	}
	return;
}




function clickedBack()
{
	document.getElementById('step_1').style.display='block';
	document.getElementById('step_2').style.display='none';
	document.getElementById('step_3').style.display='none';
	return;
}



function clickedBackToForm()
{
	var ToFlipOrNotToFlip = "dont_flip";
	
	// check if there is any data filled in the form
	for(var k=0; k< arrItem.length; k++)
	{
		var CurrentValue = document.getElementById("item_"+ arrItem[k]["id"]).value;
		if( !isNaN( parseInt(CurrentValue))  &&  parseInt( CurrentValue ) > 0 )
		{
			
			ToFlipOrNotToFlip = "flip";	
			break;
		}
	}
	
	// how about the custom item?
	var AddCustom =  document.getElementById("custom_cf").value;	
	
	if( !isNaN( parseInt(AddCustom)) && parseInt(AddCustom)>0 )
	{
		ToFlipOrNotToFlip = "flip";
	}
	
	
	
	if( ToFlipOrNotToFlip ==  "flip")
	{
		CalculateTotal();
		FlipToStep1();
	}
	else
	{
		if(confirm("Sorry,\nBecause you did not select any items to store\nthe number of containers can\'t be calculated.\n\nWould you like to go back to order form page?\nClick \"OK\" to go back to order form page\nClick \"Cancel\" to stay, select items and calculate the number of containers"))
		{
			FlipToStep1();
		}
		
	}
	return;	

}




function FlipToStep1()
{
	document.getElementById('step_1').style.display='block';
	document.getElementById('step_2').style.display='none';
	document.getElementById('step_3').style.display='none';

	var obj = document.getElementById('step1_mobile_self');
	if (obj) {
		obj.focus();
	}
	return;
}




function FlipToStep2()
{
	document.getElementById('step_1').style.display='none';
	document.getElementById('step_2').style.display='block';
	document.getElementById('step_3').style.display='none';
	
	return;
}


function FlipToStep3()
{
	CalculateTotal();
	
	var CurrentNumOfContainers = parseInt((document.getElementById("number_of_containers").value+""));
	
	var FlipIt = false;
	
	//check if number of containers is entered
	if( isNaN(CurrentNumOfContainers) || CurrentNumOfContainers == 0 )
	{
	}
	else if( document.getElementById('rental_term').selectedIndex == 0) 
	{
	}
	else if( (document.getElementById('milage').value).replace(/\ /gi,"")=="" && document.getElementById('step1_outside_move').checked ) 
	{
	}
	else
	{
		FlipIt = true;
	
	}
	
	if( !FlipIt )
	{
		//alert( "Sorry, you have to enter data for the quote"); 
		alert( "Please, check if: \n\n\t- type of service needed is selected\n\t- distance is entered if outside move \n\t- length of stay is selected\n\t- number of containers is entered\n\nEnter the missing data and resubmit the form. Thank you"); 
	}
	else
	{
	
		if( document.getElementById("total_cf3").value != "" && document.getElementById("total_cf3").value != "0")
		{
			document.getElementById("estime").innerHTML = outputTable_2() ;
			document.getElementById("estime").style.display = "block" ;
			document.getElementById("show_hide_det").style.visibility = "visible" ;

			document.getElementById("invoice").innerHTML = CalculateInvoice2(); 
			document.getElementById("invoice").style.display = "block" ;

		}
		document.getElementById('step_1').style.display='none';
		document.getElementById('step_2').style.display='none';
		document.getElementById('step_3').style.display='block';
	}
	
	return;
}


function roundMoney( amount )
{
	var toReturn = 0;
	
	if(!isNaN( parseFloat(amount)))
	{
		toReturn = amount * 100;
		
		toReturn = Math.round(toReturn);
		toReturn = toReturn/100;
		
		
		toReturn = toReturn + "";
		arrSplitted = toReturn.split(".");
		
		if( arrSplitted.length==1 )
		{
			toReturn = toReturn + ".00";
		}
		else if( (arrSplitted[1]+"").length == 1)
		{
			toReturn = toReturn + "0";
		}
			
	}
	
	return toReturn;

}






function CalculateInvoice2() {

	/* 

	invoice total calculation:
	
	
	
	Initial Rental Fee = (NumberOfContainers * (monthlyRate * (termLength))
	Rental Fee Discount =  (NumberOfContainers * (monthlyRate * (freeTerms))
	Actual Monthly Rental Fee = (NumberOfContainers * (monthlyRate * (termLength - freeTerms))
	
	Initial Delivery Fee = deliveryFee;
	Delivery Fee Discount = (deliverFee * deliveryDiscount)
	Actual Delivery Fee = deliveryFee - (deliverFee * deliveryDiscount)

	Initital GST Amount = gstTax * (Initial Rental Fee + deliveryFee)
	GST Discount = gstTax * (Initial Rental Fee + deliveryFee)
	Initital GST Amount = gstTax * (Initial Rental Fee + deliveryFee)

	Total Initial Invoice = Initial Rental Fee + Delivery Fee + GSTAmount + PSTAmount
	
	
Sept.24, 2007 Valerie took of PST as per Jeremy's email, so now  
	Total Initial Invoice = Initial Rental Fee + Delivery Fee + GSTAmount 


	--------------------
	
	                                    Containers      Paid Months   Free Months
	Rental Rate             115.00          3               10            2
	Delivery Pickup Fee      93.50          3               -             -
	
	
	                        Number of Months:   12 
	                    Number of Containers:    3
	             
	           Monthly Container Rental Rate: $115.00 x 3 containers x 10 months + 2 months free = 3450.00
	   Delivery/Pickup Fee ($16.50 discount):  $93.50 x 3 containers                             =  280.50
	   
			GST   48.00
			PST   56.00
	Total Rental Cost:  
		
		15% savings  -18.50


*******************************************************

Sept 23, 2008

New logic:
No delivery discounts
$2 per mile if moving is outside Winnipeg
Price depends on prepaid rental term and quantity of units rented
Three sets of prices  were set as arrays, new element was introduced to indicate if prepaid option was selected
arrTermOptions[k]["prepaid"] indicates which set of prices should be used
For price arrays look javascript_arrays.js

arrPerMonth 
arrSixMonthPrepaid
arrTwelveMonthPrepaid


arrPriceSet = new Array()
arrPriceSet[0] = arrPerMonth;
arrPriceSet[1] = arrSixMonthPrepaid;
arrPriceSet[2] = arrTwelveMonthPrepaid;



UNS
Units      Cost /Unit
1          $99.00
2          $75.00
3          $68.00
4          $60.00
5          $60.00


Six Month Term (Paid in Advance)
UNS
Units        Cost /Unit
1$ 96.00
2$ 73.00
3$ 66.00
4$ 58.00
5$ 58.00


Twelve Month Term (Paid in Advance)
UNS
Unit     Cost /Unit
1        $93.00
2        $71.00
3        $64.00
4        $56.00
5        $56.00





May 27, 2009

New logic
Add $150.00 up to 5 containers ( if 6-10 add an other 150 and so on) for:
-Delivery of empty container at customer and pick up of loaded container for warehouse storage
-Delivery of loaded container from warehouse storage and pick up of empty container at customer

ON SITE STORAGE (Customer residence) $ 75.00 Up to 5 Containers ( if 6-10 add an other 75 and so on) for:
-Delivery of empty container at customer for on site storage
-Pick up of empty conatiner when finished

TRAVEL OUTSIDE OF WINNIPEG
$2.00 per/mile for all miles travelled loaded or empty -- as it was before



*/


	


	var aRental = 0;
	var aDelivery = 0;
	
	var subtotal = 0;
	var gstAmount = 0;
	var pstAmount = 0;
	var totalInvoice = 0;
	
	var lf = "\n";
	var msg = "";

	
	
	rentalTermAssign();

	var noSavingsRate = 0;
	var noSavingsRental = 0;
	
	currentPriceSet = arrPriceSet[prepaid];
	if( NumberOfContainers >= currentPriceSet.length)
	{
		monthlyRate = currentPriceSet[ currentPriceSet.length-1 ];
		noSavingsRate = arrPriceSet[0][arrPriceSet[0].length-1];
	}
	else
	{
		monthlyRate = currentPriceSet[ NumberOfContainers ];
		noSavingsRate = arrPriceSet[0][NumberOfContainers];
	}


	aRental = NumberOfContainers * monthlyRate * termLength;
	noSavingsRental = NumberOfContainers * noSavingsRate * termLength;
	
	var curMilage = 0;
	

	
	
	// since delivery fee now applies per 5 containers 
	var FeeMultiplyTimes  = 1;
	if( NumberOfContainers / 5 <=1 )                  // five containers or less
	{
		FeeMultiplyTimes = 1;
	}
	else if( NumberOfContainers % 5 == 0 )            // more then five containers, but 5 even number:10, 15, 20 ...
	{
		FeeMultiplyTimes = NumberOfContainers / 5;
	}
	else                                              // more then five containers, but 5 odd number:6,7,8,9,11,12,13,14,16, ...
	{
		FeeMultiplyTimes = (NumberOfContainers / 5) + 1;
		
		var calc1 = (NumberOfContainers / 5);
		var calc2 = calc1+ "";
		arrNumberParts = calc2.split(".");
		FeeMultiplyTimes = parseInt( arrNumberParts[0]+"") + 1;
	} 	
	
	
	
	
	
	
	if( document.getElementById('step1_client_self').checked ) 
	{
		aDelivery = deliveryFeeOnSite * FeeMultiplyTimes;
	}


	if( document.getElementById('step1_warehouse').checked ) 
	{
		aDelivery = deliveryFeeWarehouse * FeeMultiplyTimes;
	}
	
	
	if( document.getElementById('step1_local_move').checked ) 
	{
		aDelivery = deliveryFeeMoveInsideWinnipeg;
	}
	
	if( document.getElementById('step1_outside_move').checked ) 
	{
		var qtyMiles = parseInt( document.getElementById('milage').value );
		if( isNaN( qtyMiles))
		{  qtyMiles = 0;}

		var curMilage = qtyMiles * One_Mile_Price  * FeeMultiplyTimes;
		aDelivery = deliveryFeeMoveOutsideWinnipeg;
	}
	





	
	subtotal = aRental + aDelivery + curMilage;
	
	gstAmount = subtotal * gstTax;
	
// see the note above
//	pstAmount = subtotal * pstTax;
//	totalInvoice = subtotal + gstAmount + pstAmount;


	totalInvoice = subtotal + gstAmount ;
	
	
/* 	
	msg = msg + "aRental = "+aRental + lf;
	msg = msg + "FeeMultiplyTimes = "+FeeMultiplyTimes + lf;
	msg = msg + "aDelivery = "+aDelivery + lf;
	msg = msg + "subtotal = "+subtotal + lf;
	msg = msg + "gstAmount = "+gstAmount + lf;
	msg = msg + "pstAmount = "+pstAmount + lf;
	msg = msg + "totalInvoice = "+totalInvoice + lf;
	
	alert(msg);	
	
 */	
	
	var strOut = "";
	
	strOut += '<table id="invoice_table" width="100%" class="item_table" cellpadding="5" cellspacing="0" border="0">';
	
	
	
	strOut += '<tr>';
		strOut += '<td  align="right" class="estimator_turcus_bold_11" >MONTHLY RENTAL RATE</td>';
		strOut += '<td align="right">$ ' + roundMoney(monthlyRate )+ '</td>';
		strOut += '<td align="left"> per month</td>';
		strOut += '<td></td>';
		strOut += '<td></td>';
	strOut += '</tr>';
	
	
	
	strOut += '<tr>';
		strOut += '<td valign="top" colspan="5" style="padding-left:0px;padding-right:0px;"><hr style="height:1px; border:0px; color:#A5CF6B; background-color:#A5CF6B;"></td>';
	strOut += '</tr>'
	
	
	
	strOut += '<tr>';
		strOut += '<td  align="right" class="estimator_turcus_bold_11">COST OF THE RENTAL</td>';
		strOut += '<td align="right">$ ' + roundMoney(aRental) + '</td>';
		if( noSavingsRental > aRental )
		{
			var ddd = noSavingsRental - aRental;
			strOut += '<td  align="right">Saved:</td>';
			strOut += '<td align="leftt">$ ' + roundMoney(ddd) + '</td>';
		}
		else
		{
			strOut += '<td></td>';
			strOut += '<td align="right"></td>';
		}
		strOut += '<td align="right"></td>';
	strOut += '</tr>';
	
	
	
	strOut += '<tr>';
		strOut += '<td valign="top" colspan="5" style="padding-left:0px;padding-right:0px;"><hr style="height:1px; border:0px; color:#A5CF6B; background-color:#A5CF6B;"></td>';
	strOut += '</tr>';
	


	strOut += '<tr>';	
		strOut += '<td  align="right" class="estimator_turcus_bold_11">DELIVERY/PICK-UP FEE</td>';
		strOut += '<td align="right">$ ' + roundMoney(aDelivery) + '</td>';
		strOut += '<td></td>';
		strOut += '<td align="right"></td>';
		strOut += '<td align="right"></td>';	
	strOut += '</tr>';
	
	

	if( document.getElementById('step1_outside_move').checked ) 
	{

		strOut += '<tr>';	
		
		var qty_containers = "container";
		if( NumberOfContainers >= 2)
		{
			var qty_containers = "containers";
		}
		//strOut += '<td  align="right" class="estimator_turcus_bold_11">MILAGE FEE<br>'+qtyMiles+' miles * $2 per mile * '+NumberOfContainers+ ' ' + qty_containers + '</td>';
		
		var to_and_back_miles = 2 * qtyMiles;
		strOut += '<td  align="right" class="estimator_turcus_bold_11">MILAGE FEE <br>'+to_and_back_miles+' miles * $2 per mile * up to 5 containers</td>';
		
		// and we will multiply curMilage by 2 to count forth and back traveling
		strOut += '<td align="right" valign="bottom">$ ' + roundMoney(curMilage *2) + '</td>';
		strOut += '<td></td>';
		strOut += '<td align="right"></td>';
		strOut += '<td align="right"></td>';	
		strOut += '</tr>'
		
	}
	
	
	
	
	
	strOut += '<tr>';
		strOut += '<td valign="top" colspan="5" style="padding-left:0px;padding-right:0px;"><hr style="height:1px; border:0px; color:#A5CF6B; background-color:#A5CF6B;"></td>';
	strOut += '</tr>';
	
	
	strOut += '<tr>';
		strOut += '<td  align="right" class="estimator_turcus_bold_11">SUBTOTAL</td>';
		strOut += '<td align="right">$ '+ roundMoney(subtotal) +'</td>';
		strOut += '<td></td>';
		strOut += '<td align="right"></td>';
		strOut += '<td align="right"></td>';
	strOut += '</tr>';


	strOut += '<tr>';
		strOut += '<td valign="top" colspan="5" style="padding-left:0px;padding-right:0px;"><hr style="height:1px; border:0px; color:#A5CF6B; background-color:#A5CF6B;"></td>';
	strOut += '</tr>';
	
	
	
	var showGST = parseInt(gstTax * 100);
	strOut += '<tr>';
		strOut += '<td  align="right" class="estimator_turcus_bold_11">SALES TAX GST ' + showGST + ' %</td>';
		strOut += '<td align="right">$ ' + roundMoney(gstAmount) + '</td>';
		strOut += '<td></td>';
		strOut += '<td></td>';
		strOut += '<td align="right"></td>';
	strOut += '</tr>';
	
	
	
	strOut += '<tr>';
		strOut += '<td valign="top" colspan="5" style="padding-left:0px;padding-right:0px;"><hr style="height:1px; border:0px; color:#A5CF6B; background-color:#A5CF6B;"></td>';
	strOut += '</tr>';
	


	strOut += '<tr>';
		strOut += '<td  align="right" class="estimator_bold_13">TOTAL: </td>';		
		strOut += '<td align="right" class="estimator_bold_13">$ ' + roundMoney(totalInvoice) + '</td>';
		strOut += '<td></td>';
		strOut += '<td></td>';
		strOut += '<td></td>';
	strOut += '</tr>';
	
	strOut += '</table><br><br>';	
	
	return strOut;
	

}

