
var m_weight, m_method, m_handling, m_insurance;
var m_insuranceOptional;
var m_Message;
var m_zoneChart = new Array(7);
var m_intraBMCZip = new Array();
/*
 These variables below control the shipping cost
 These Variables need to be set up
 for each item the calculator is used for.
 Whole pounds only. Note a 5 pound 1 ounce package is charged the 6 pound
 rate
*/

/* This calculator only supports packages up to 35 pounds.
each line below must end with a ; or you will get an error. */
/& m_weight = 1;  */
m_handling = 0.00;
m_insurance = 1.30;
m_insuranceOptional = true;

/*
 The m_message variable below controls the output the buyer will see. You
 can change this message to anything you want and can use the following
 tags to insert relevant shipping information. You can also manualy insert
 shipping information for services that are not zone based (i.e. express
 mail, media mail ect.)
 \\h inserts the handling charge
 \\i inserts the insurance charge
 \n inserts a new line
 \\pr inserts the priority mail rate
 \\pp inserts the parcel post rate
 \\tpr inserts the total priority rate including handling and insurance
 \\tpp inserts the total parcel post rate including handling and insurance
 \\w   insert the weight of the package
 \\z   insert the zone where the zip code is located
 Also note that each statement must must be eonclosed by quotation marks.
 You can use the plus sign to combine multiple statements.
*/

m_message = "USPS shipping for a \\w pound package from zipcode 28643 is:\n"
			+ "\\tpr for Priority Mail (2-3 days) or "
			+ "\\tpp for Parcel Post (5-10 days) \n\n"
			+ "Optional insurance is \\i ... "
                  + "there is no handling fee.";
/* removed from above:
			+ "The package weight is \\w pounds\n\n"
			+ "All prices include a \\h handling charge. \n\n"
			+ "You are located in zone \\z \n\n"
*/

/*
 Visit http://personal.lg-internet.com/ChartMaker.html and follow the
 instructions. You only need to set up the zone chart once.
*/
/******************************************************************************
*	Start Zone Chart
******************************************************************************/
/* start of original chart from author
m_zoneChart[0] = new Array("900..908","910..918","922..928");
m_zoneChart[1] = new Array("919..921","930..935");
m_zoneChart[2] = new Array("863..864","889..891","936..939");
m_zoneChart[3] = new Array("850","852..853","855..857","859..860","865","870..875","878..879","893","894..895","897..898","940..966","976","813..815","833","840..847");
m_zoneChart[4] = new Array("677..679","690","693","877","880..885","739","577","769","590..591","790..794","970..975","594","797..812","977..986","596..599","988..994","816","820..832","834..838");
m_zoneChart[5] = new Array("654..658","660..676","500..503","680..681","505","683..689","508..516","691..692","525","710..711","560..562","717..719","565","726..731","733..738","567","570..576","740..741","743..768","580..588","770..789","592..593","795..796","595","640..642","644..649");
m_zoneChart[6] = new Array("498..499","504","307","506..507","325","520..524","700..701","526..528","703..708","530..532","350..352","534..535","712..714","354..362","537..559","716","364..375","563..564","720..725","380..397","566","400..402","420..424","427","460..469","471..479","600..620","622..639","999","490..491","493..495","650..653");
m_zoneChart[7] = new Array("005..098","496..497","100..212","214..268","270..306","308..324","326..342","344","346..347","349","363","376..379","398..399","403..418","425..426","967..969","430..459","470","995..998","480..489","492");
m_intraBMCZip = new Array("889..891","893","900..908","910..918","919..921","922..928","930..935");
end of original chart from author */
m_zoneChart[0] = new Array("376","280..282","286","297");
m_zoneChart[1] = new Array("377..379","240..243","245..249","415..418","258..259","270..277","283..284","287..293","295..296");
m_zoneChart[2] = new Array("318..319","150..154","362","200..205","370..374","215","220..239","385","244","399..414","250..257","260..268","421..422","278..279","425..427","430..433","285","437..439","450..457","294","459","298..315","470..471");
m_zoneChart[3] = new Array("005","320..329","060..119","335..338","124..127","342","344","130..135","346..347","137..149","350..352","354..361","155..199","363..369","600..611","206..212","214","375","613..620","622..639","216..219","380..384","386..398","420","423..424","434..436","723..725","440..449","458","460..469","316..317","472..495");
m_zoneChart[4] = new Array("496..516","520..528","010..059","330..334","530..532","534..535","120..123","339..341","537..564","128..129","570..571","136","349","612","640..642","644..658","660..676","680..681","683..689","700..701","703..708","710..714","716..722","726..731","734..738","740..741","743..767","770..778");
m_zoneChart[5] = new Array("779..797","800..812","820","565..567","822","572..577","580..587","826..827","677..679","690..693","877","881..884","733","739","768..769");
m_zoneChart[6] = new Array("006..009","798..799","813..816","821","823..825","588","828..832","590..597","834","840..847","850","852..853","855..857","859..860","863","865","870..875","878..880","885");
m_zoneChart[7] = new Array("833","598..599","835..838","864","889..891","893..895","897..898","900..908","910..928","930..986","988..999");

m_intraBMCZip = new Array("376","240..243","245..249","270..277","278..279","280..282","283..284","285","286","287..293","294","295..296","297");

/******************************************************************************
*	End Zone Chart
******************************************************************************/

/**************************************************************************
*End modifications here
*
*You should not need to change any of the code below
**************************************************************************/
/* Constants */
var PRIORITY = 0;
var PARCEL = 1;
/* Chart of priority mail rates Zones 1-3 have the same rate */
var m_priorityChart = new Array(34);
/* Chart of machinable parcel post rates 1-35 pounds. Zones 1-2 have the
same rate */
var m_parcelPostChart = new Array(34);
/* Chart of intra-BMC machinable parcel post rates. Only parcel post packages
1-35 pounds and for certain zip codes will qualify for these rates.
The zip codes that qualify are marked with asterisks on your zone chart. */
var m_parcelIntraBMC = new Array(34);

/* USPS priority mail rate chart effective 06/30/2002
Zones 1-3 for priority mail have the same rate. */

m_priorityChart[0] = new Array(3.85, 3.85, 3.85, 3.85, 3.85, 3.85, 3.85, 3.85);
m_priorityChart[1] = new Array(3.95, 3.95, 3.95, 4.55, 4.90, 5.05, 5.40, 5.75);
m_priorityChart[2] = new Array(4.75, 4.75, 4.75, 6.05, 6.85, 7.15, 7.85, 8.55);
m_priorityChart[3] = new Array(5.30, 5.30, 5.30, 7.05, 8.05, 8.50, 9.45, 10.35);
m_priorityChart[4] = new Array(5.85, 5.85, 5.85, 8.00, 9.30, 9.85, 11.00, 12.15);
m_priorityChart[5] = new Array(6.30, 6.30, 6.30, 8.85, 9.90, 10.05, 11.30, 12.30);
m_priorityChart[6] = new Array(6.80, 6.80, 6.80, 9.80, 10.65, 11.00, 12.55, 14.05);
m_priorityChart[7] = new Array(7.35, 7.35, 7.35, 10.75, 11.45, 11.95, 13.80, 15.75);
m_priorityChart[8] = new Array(7.90, 7.90, 7.90, 11.70, 12.20, 12.90, 15.05, 17.50);
m_priorityChart[9] = new Array(8.40, 8.40, 8.40, 12.60, 13.00, 14.00, 16.30, 19.20);
m_priorityChart[10] = new Array(8.95, 8.95, 8.95, 13.35, 13.75, 15.15, 17.55, 20.90);
m_priorityChart[11] = new Array(9.50, 9.50, 9.50, 14.05, 14.50, 16.30, 18.80, 22.65);
m_priorityChart[12] = new Array(10.00, 10.00, 10.00, 14.75, 15.30, 17.50, 20.05, 24.35);
m_priorityChart[13] = new Array(10.55, 10.55, 10.55, 15.45, 16.05, 18.60, 21.25, 26.05);
m_priorityChart[14] = new Array(11.05, 11.05, 11.05, 16.20, 16.85, 19.75, 22.50, 27.80);
m_priorityChart[15] = new Array(11.60, 11.60, 11.60, 16.90, 17.60, 20.85, 23.75, 29.50);
m_priorityChart[16] = new Array(12.15, 12.15, 12.15, 17.60, 18.35, 22.05, 25.00, 31.20);
m_priorityChart[17] = new Array(12.65, 12.65, 12.65, 18.30, 19.30, 23.15, 26.25, 32.95);
m_priorityChart[18] = new Array(13.20, 13.20, 13.20, 19.00, 20.20, 24.30, 27.50, 34.65);
m_priorityChart[19] = new Array(13.75, 13.75, 13.75, 19.75, 21.15, 25.35, 28.75, 36.40);
m_priorityChart[20] = new Array(14.25, 14.25, 14.25, 20.45, 22.05, 26.55, 30.00, 38.10);
m_priorityChart[21] = new Array(14.80, 14.80, 14.80, 21.15, 22.95, 27.65, 31.20, 39.80);
m_priorityChart[22] = new Array(15.30, 15.30, 15.30, 21.85, 23.90, 28.80, 32.45, 41.55);
m_priorityChart[23] = new Array(15.85, 15.85, 15.85, 22.55, 24.85, 29.90, 33.70, 43.25);
m_priorityChart[24] = new Array(16.40, 16.40, 16.40, 23.30, 25.75, 31.10, 34.95, 44.95);
m_priorityChart[25] = new Array(16.90, 16.90, 16.90, 24.00, 26.60, 32.25, 36.20, 46.70);
m_priorityChart[26] = new Array(17.45, 17.45, 17.45, 24.70, 27.55, 33.35, 37.45, 48.40);
m_priorityChart[27] = new Array(18.00, 18.00, 18.00, 25.40, 28.50, 34.50, 38.70, 50.15);
m_priorityChart[28] = new Array(18.50, 18.50, 18.50, 26.15, 29.45, 35.60, 39.95, 51.85);
m_priorityChart[29] = new Array(19.05, 19.05, 19.05, 26.85, 30.35, 36.80, 41.20, 53.55);
m_priorityChart[30] = new Array(19.55, 19.55, 19.55, 27.55, 31.20, 37.85, 42.40, 55.30);
m_priorityChart[31] = new Array(20.10, 20.10, 20.10, 28.25, 32.15, 39.00, 43.65, 57.00);
m_priorityChart[32] = new Array(20.65, 20.65, 20.65, 28.95, 33.10, 40.10, 44.90, 58.70);
m_priorityChart[33] = new Array(21.15, 21.15, 21.15, 29.70, 34.00, 41.25, 46.15, 60.45);
m_priorityChart[34] = new Array(21.70, 21.70, 21.70, 30.40, 34.95, 42.40, 47.40, 62.15);

/* Machinable parcel post rates effective 06/30/2002
Zones 1-2 have the same rate. 1-35 pounds. */
m_parcelPostChart[0] = new Array(3.69, 3.69, 3.75, 3.75, 3.75, 3.75, 3.75, 3.75);
m_parcelPostChart[1] = new Array(3.85, 3.85, 3.85, 4.14, 4.14, 4.49, 4.49, 4.49);
m_parcelPostChart[2] = new Array(4.65, 4.65, 4.65, 5.55, 5.65, 5.71, 5.77, 6.32);
m_parcelPostChart[3] = new Array(4.86, 4.86, 5.20, 6.29, 6.93, 7.14, 7.20, 7.87);
m_parcelPostChart[4] = new Array(5.03, 5.03, 5.71, 6.94, 7.75, 8.58, 8.64, 9.43);
m_parcelPostChart[5] = new Array(5.63, 5.63, 6.01, 7.44, 8.50, 9.52, 9.90, 11.49);
m_parcelPostChart[6] = new Array(5.80, 5.80, 6.28, 7.91, 9.20, 10.35, 11.39, 12.83);
m_parcelPostChart[7] = new Array(5.98, 5.98, 6.53, 8.30, 9.84, 11.11, 12.54, 15.04);
m_parcelPostChart[8] = new Array(6.11, 6.11, 6.76, 8.74, 10.45, 11.83, 13.38, 17.04);
m_parcelPostChart[9] = new Array(6.28, 6.28, 7.57, 9.10, 11.01, 12.50, 14.17, 18.14);
m_parcelPostChart[10] = new Array(6.41, 6.41, 7.80, 9.47, 11.54, 13.13, 14.92, 19.15);
m_parcelPostChart[11] = new Array(6.54, 6.54, 8.01, 9.80, 12.04, 13.72, 15.62, 20.10);
m_parcelPostChart[12] = new Array(6.67, 6.67, 8.19, 10.12, 12.51, 14.28, 16.27, 20.99);
m_parcelPostChart[13] = new Array(6.80, 6.80, 8.42, 10.43, 12.95, 14.81, 16.90, 21.84);
m_parcelPostChart[14] = new Array(6.92, 6.92, 8.61, 10.73, 13.38, 15.31, 17.49, 22.64);
m_parcelPostChart[15] = new Array(7.02, 7.02, 8.79, 11.00, 13.78, 15.79, 18.05, 23.41);
m_parcelPostChart[16] = new Array(7.15, 7.15, 8.94, 11.28, 14.16, 16.24, 18.59, 24.13);
m_parcelPostChart[17] = new Array(7.25, 7.25, 9.11, 11.52, 14.52, 16.68, 19.09, 24.82);
m_parcelPostChart[18] = new Array(7.37, 7.37, 9.28, 11.77, 14.87, 17.09, 19.58, 25.48);
m_parcelPostChart[19] = new Array(7.46, 7.46, 9.43, 11.98, 15.20, 17.48, 20.05, 26.12);
m_parcelPostChart[20] = new Array(7.57, 7.57, 9.59, 12.20, 15.52, 17.86, 20.49, 26.72);
m_parcelPostChart[21] = new Array(7.66, 7.66, 9.72, 12.42, 15.82, 18.22, 20.92, 27.30);
m_parcelPostChart[22] = new Array(7.76, 7.76, 9.89, 12.65, 16.11, 18.57, 21.32, 27.85);
m_parcelPostChart[23] = new Array(7.83, 7.83, 10.01, 12.83, 16.39, 18.90, 21.72, 28.39);
m_parcelPostChart[24] = new Array(7.93, 7.93, 10.14, 13.03, 16.66, 19.22, 22.09, 28.90);
m_parcelPostChart[25] = new Array(8.01, 8.01, 10.27, 13.21, 16.92, 19.53, 22.46, 29.39);
m_parcelPostChart[26] = new Array(8.11, 8.11, 10.40, 13.38, 17.17, 19.83, 22.81, 29.87);
m_parcelPostChart[27] = new Array(8.18, 8.18, 10.52, 13.58, 17.41, 20.11, 23.14, 30.32);
m_parcelPostChart[28] = new Array(8.27, 8.27, 10.65, 13.75, 17.64, 20.39, 23.47, 30.76);
m_parcelPostChart[29] = new Array(8.35, 8.35, 10.76, 13.90, 17.87, 20.65, 23.78, 31.19);
m_parcelPostChart[30] = new Array(8.44, 8.44, 10.86, 14.06, 18.08, 20.91, 24.08, 31.60);
m_parcelPostChart[31] = new Array(8.50, 8.50, 10.99, 14.22, 18.29, 21.16, 24.37, 32.00);
m_parcelPostChart[32] = new Array(8.58, 8.58, 11.10, 14.38, 18.49, 21.40, 24.65, 32.38);
m_parcelPostChart[33] = new Array(8.66, 8.66, 11.18, 14.51, 18.69, 21.63, 24.93, 32.75);
m_parcelPostChart[34] = new Array(8.74, 8.74, 11.30, 14.66, 18.88, 21.85, 25.19, 33.11);

/*
 Intra-BMC machinable parcel post rates effective 06/30/2002
 Zone 1-2 have the same rate. Only 1-35 pounds.
 The local zone rate is currently ignored.
*/
m_parcelIntraBMC[0] = new Array(2.81, 2.96, 2.96, 2.99, 3.05, 3.14);
m_parcelIntraBMC[1] = new Array(3.13, 3.53, 3.53, 3.56, 3.63, 3.74);
m_parcelIntraBMC[2] = new Array(3.44, 4.08, 4.08, 4.11, 4.20, 4.32);
m_parcelIntraBMC[3] = new Array(3.73, 4.28, 4.28, 4.62, 4.72, 4.86);
m_parcelIntraBMC[4] = new Array(3.99, 4.45, 4.45, 5.02, 5.15, 5.35);
m_parcelIntraBMC[5] = new Array(4.23, 4.61, 4.61, 5.38, 5.51, 5.80);
m_parcelIntraBMC[6] = new Array(4.36, 4.76, 4.76, 5.69, 5.84, 6.21);
m_parcelIntraBMC[7] = new Array(4.46, 5.33, 5.33, 5.98, 6.14, 6.60);
m_parcelIntraBMC[8] = new Array(4.56, 5.46, 5.46, 6.22, 6.45, 6.95);
m_parcelIntraBMC[9] = new Array(4.66, 5.63, 5.63, 6.53, 6.74, 7.28);
m_parcelIntraBMC[10] = new Array(4.74, 5.76, 5.76, 6.74, 7.00, 7.58);
m_parcelIntraBMC[11] = new Array(4.84, 5.91, 5.91, 6.94, 7.26, 7.87);
m_parcelIntraBMC[12] = new Array(4.92, 6.04, 6.04, 7.10, 7.50, 8.13);
m_parcelIntraBMC[13] = new Array(5.00, 6.16, 6.16, 7.22, 7.75, 8.38);
m_parcelIntraBMC[14] = new Array(5.08, 6.27, 6.27, 7.39, 7.96, 8.62);
m_parcelIntraBMC[15] = new Array(5.17, 6.38, 6.38, 7.56, 8.16, 8.84);
m_parcelIntraBMC[16] = new Array(5.23, 6.51, 6.51, 7.72, 8.38, 9.05);
m_parcelIntraBMC[17] = new Array(5.30, 6.60, 6.60, 7.87, 8.57, 9.24);
m_parcelIntraBMC[18] = new Array(5.36, 6.72, 6.72, 8.02, 8.75, 9.43);
m_parcelIntraBMC[19] = new Array(5.46, 6.82, 6.82, 8.16, 8.91, 9.60);
m_parcelIntraBMC[20] = new Array(5.51, 6.91, 6.91, 8.30, 9.06, 9.77);
m_parcelIntraBMC[21] = new Array(5.57, 7.02, 7.02, 8.42, 9.20, 9.92);
m_parcelIntraBMC[22] = new Array(5.64, 7.10, 7.10, 8.58, 9.34, 10.07);
m_parcelIntraBMC[23] = new Array(5.70, 7.19, 7.19, 8.70, 9.46, 10.22);
m_parcelIntraBMC[24] = new Array(5.77, 7.27, 7.27, 8.82, 9.58, 10.35);
m_parcelIntraBMC[25] = new Array(5.82, 7.37, 7.37, 8.93, 9.71, 10.48);
m_parcelIntraBMC[26] = new Array(5.88, 7.45, 7.45, 9.06, 9.82, 10.60);
m_parcelIntraBMC[27] = new Array(5.94, 7.52, 7.52, 9.18, 9.91, 10.72);
m_parcelIntraBMC[28] = new Array(6.01, 7.61, 7.61, 9.30, 10.02, 10.83);
m_parcelIntraBMC[29] = new Array(6.08, 7.69, 7.69, 9.40, 10.12, 10.93);
m_parcelIntraBMC[30] = new Array(6.13, 7.77, 7.77, 9.48, 10.21, 11.04);
m_parcelIntraBMC[31] = new Array(6.18, 7.86, 7.86, 9.60, 10.31, 11.13);
m_parcelIntraBMC[32] = new Array(6.25, 7.92, 7.92, 9.70, 10.39, 11.23);
m_parcelIntraBMC[33] = new Array(6.30, 8.00, 8.00, 9.78, 10.47, 11.31);
m_parcelIntraBMC[34] = new Array(6.35, 8.06, 8.06, 9.89, 10.55, 11.40);

/* Functions */
function IsNumbersOnly(val)
{
	var i = 0;
	for(i = 0; i < val.length; i++)
	{
		if(!(val.charCodeAt(i) >= 48 && val.charCodeAt(i) <= 57))
			return false;
	}
	return true;
}
function FormatCurrency (Val) {	Val=""+Val;
	DollarSign = true;

    	if (Val.indexOf (".", 0)!=-1)
    	{
    		Dollars = Val.substring(0, Val.indexOf (".", 0));
    		Cents = Val.substring(Val.indexOf (".", 0)+1, Val.indexOf (".", 0)+3);

    		if (Cents.length==0) Cents="00";
    		if (Cents.length==1) Cents=Cents+"0";
    	}
    	else
    	{
    		Dollars = Val;
    		Cents = "00";
    	}
    	OutString="";
    	len=Dollars.length;
    	if (len>=3)
    	{
    		while (len>0)
    		{
    			TempString=Dollars.substring(len-3, len)

    			if (TempString.length == 3)
    				{
    					OutString=","+TempString+OutString
    					len=len-3;
    				}
    			else
    			{
    			OutString= TempString + OutString;
    			len=0;
    			}
    		}
    		if (OutString.substring(0, 1)==",")
    			Dollars=OutString.substring (1, OutString.length)
    		else
    			Dollars=OutString
    	}
    		if (DollarSign)
    			return ("$" + Dollars+"." + Cents);
    		else
    			return (Dollars + "." + Cents);
}
/* Note any function named replace (with the r in lower case) is not
allowed by ebay.. otherwise the string objects replace function
could be used. */
function Rpl(expression, find, rep)
{
	var temp = expression;
	var a = 0;

	for (var i = 0; i < expression.length; i++)
	{
		a = temp.indexOf(find);
		if (a == -1)
			break
		else
			temp = temp.substring(0, a) + rep +
				temp.substring((a + find.length));
	}
	return temp;
}

function MakeMessage(message, priorityRate, parcelRate, zone)
{
	message = Rpl(message, "\\h", FormatCurrency(m_handling));
	message = Rpl(message,"\\i", FormatCurrency(m_insurance));
	message = Rpl(message, "\\pr", FormatCurrency(priorityRate));
	message = Rpl(message, "\\pp", FormatCurrency(parcelRate));

	if(m_insuranceOptional)
		message = Rpl(message, "\\tpr",
			FormatCurrency(priorityRate + m_handling));
	else
		message = Rpl(message, "\\tpr",
			FormatCurrency(priorityRate + m_insurance + m_handling));

	if(m_insuranceOptional)
		message = Rpl(message, "\\tpp",
			FormatCurrency(parcelRate + m_handling));
	else
		message = Rpl(message, "\\tpp",
			FormatCurrency(parcelRate + m_insurance + m_handling));

	message = Rpl(message, "\\w", m_weight);
	return message;
 }

function FindZip(zipArray, zipPrefix)
{
	var zipRange, count;
	for(count = 0; count < zipArray.length; count++)
	{
		if(zipArray[count].length == 3 )
		{
			if(zipArray[count].slice(0, 3) == zipPrefix)
				return true;
		}
		else if(zipArray[count].length == 8)
		{
			zipRange = zipArray[count].split("..");

			if(zipPrefix >= zipRange[0].slice(0, 3) &&
			   zipPrefix <= zipRange[1].slice(0, 3))
				return true;
		}
	}
	return false;
}

function LookUpRate(weight, method, zipCode, zone)
{
	var rateArray, intraBMC;
	intraBMC = false;
	if(method == PRIORITY)
	{
		rateArray = m_priorityChart[weight - 1];
		return rateArray[zone - 1];
	}
	else if(method == PARCEL)
	{
			if(zone <= 5 && zone >= 1 && weight <= 35)
			{
				if(FindZip(m_intraBMCZip, zipCode.slice(0, 3)))
					/* Use intra-BMC rates */
					intraBMC = true;
			}
			if(weight <=35)
			{
				if(intraBMC)
				{
					rateArray = m_parcelIntraBMC[weight - 1];

					return rateArray[zone];
				}
				else
				{
					rateArray = m_parcelPostChart[weight - 1];

					return rateArray[zone - 1];
				}
			}
	}
}

function LookUpZone(zipPrefix)
{
	var count;

	for(count = 0; count < m_zoneChart.length; count++)
	{
		if(FindZip(m_zoneChart[count], zipPrefix))
			return count + 1;
	}
	return -1;
}

/* Event procedures */
function cmdCalc_OnClick()
{
	var zipCode, zone, priorityRate, parcelRate, message;
	var theForm = new Object(window.document.Calculator);
	var zipCode = new String(theForm.txtZip.value);

	if((zipCode.length < 5 || !IsNumbersOnly(zipCode)))
		 window.alert ("The zip code must be 5 characters " +
		 				"long and only contain numbers.");
	else
	{
		zone = LookUpZone(zipCode.slice(0, 3));
		if(zone >= 0)
		{
			priorityRate = LookUpRate(m_weight, PRIORITY, zipCode, zone);
			parcelRate = LookUpRate(m_weight, PARCEL, zipCode, zone);
			/* Save the message into a temp variable for processing so the
			original template is not changed */
			message = MakeMessage(m_message, priorityRate, parcelRate, zone);
			window.alert(message);
		}
		else
			window.alert("I am unable to verify your zip code.\n" +
                        "Please double check it and retry, or\n" +
				"eMail me with your zip code for shipping charges.\n\n\n" +
                        "You can eMail by clicking on 'Ask seller a question' (above).");
	}
}


