new Request.JSON({
	 url : window.location.protocol + "//" + window.location.hostname + "/_files/js/ic_storeData.asp?cp=" + intCompPlan + "&sample=" + intSampleLimit + "&sort=desc&" + Math.random()
	,onRequest : function () {
		var objPLoading = new Element("p", {"id":"pSampleLoading","class":"status","html":"Loading...please wait"});
		if (objInjectAfter != null) objPLoading.inject(objInjectAfter, "after");
		else objPLoading.inject(objBody);
		}
	,onSuccess : function (rJSON, rText) {
		var storeSample = eval("[" + rText + "]");
		//if (typeof(intSampleLimit) == "undefined") var intSampleLimit = storeSample.length;
		//if (typeof(blnFR) == "undefined") var blnFR = false;
		var str = '<tr><th>Store</th><th>Member Cash Back</th>';
		if (refLevel == 2) str += '<th>Referer Cash Back</th>';
		else {
			if (blnFR == true) str += '<th>Fundraiser Cash Back</th><td>Direct referral purchases</td><td>Other referral purchases</td>';
			else {
				str += '<th>Licensee Cash Back</th><td>Direct referral purchases</td><td>Other referral purchases</td>';
				if (refLevel != 4) str += '<td>Referred licensee purchases</b></td>';
				}
			}
		str += '</tr>';
		var objH = new Element(strHTag, {"html" : "A Sampling of " + intSampleLimit.numberFormat(0, "", ",") + " stores and payouts on GreenBackStreet.com"});
		if (objInjectAfter != null) objH.inject(objInjectAfter, "after");
		else objH.inject(objBody);
		$("pSampleLoading").destroy();
		var objTblStoreListSample = new Element("table", {"id":"tblStoreListSample","html":str}).inject(objH, "after");
		var arrRows = [];
		for (s = 1; s < intSampleLimit; s++) {
			store = storeSample[s];
			if (store.commissions.level1 > 0) {
				var objTR = new Element("tr");
				new Element("td", {"html":store.name}).inject(objTR);
				if (store.cash) {
					new Element("td", {"html":(store.commissions.level1).formatCurrency()}).inject(objTR);
					if (refLevel == 2) new Element("td", {"html":(store.commissions.level2).formatCurrency()}).inject(objTR);
					else {
						if (blnFR && intCompPlan == 174) {
							new Element("td", {"html":(store.commissions.level1 + store.commissions.level2 + store.commissions.level3 + store.commissions.level4).formatCurrency()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level2 + store.commissions.level3 + store.commissions.level4).formatCurrency()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level3 + store.commissions.level4).formatCurrency()}).inject(objTR);
							}
						else {
							new Element("td", {"html":(store.commissions.level1 + store.commissions.level2 + store.commissions.level3).formatCurrency()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level2 + store.commissions.level3).formatCurrency()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level3).formatCurrency()}).inject(objTR);
							if (refLevel != 4) new Element("td", {"html":(store.commissions.level4).formatCurrency()}).inject(objTR);
							}
						}
					}
				else {
					new Element("td", {"html":(store.commissions.level1).formatPercent()}).inject(objTR);
					if (refLevel == 2) new Element("td", {"html":(store.commissions.level2).formatPercent()}).inject(objTR);
					else {
						if (blnFR && intCompPlan == 174) {
							new Element("td", {"html":(store.commissions.level1 + store.commissions.level2 + store.commissions.level3 + store.commissions.level4).formatPercent()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level2 + store.commissions.level3 + store.commissions.level4).formatPercent()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level3 + store.commissions.level4).formatPercent()}).inject(objTR);
							}
						else {
							new Element("td", {"html":(store.commissions.level1 + store.commissions.level2 + store.commissions.level3).formatPercent()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level2 + store.commissions.level3).formatPercent()}).inject(objTR);
							new Element("td", {"html":(store.commissions.level3).formatPercent()}).inject(objTR);
							if (refLevel != 4) new Element("td", {"html":(store.commissions.level4).formatPercent()}).inject(objTR);
							}
						}
					}
				//objTR.inject(objTblStoreListSample, "bottom");
				arrRows[arrRows.length] = '<tr>' + objTR.get('html') + '</tr>';
				}
			}
		objTblStoreListSample.set('html', objTblStoreListSample.get('html') + arrRows.join(''));
		}
	}).get();
