// JavaScript Document
	var conFullPriceChar	= "X";
	var conCommaPriceChar	= "Y";
	
	function setFullPriceChar(aChar){
		conFullPriceChar	= aChar;
	}
	
	function setCommaPriceChar(aChar){
		conCommaPriceChar	= aChar;
	}
	
	
	function formatCurrency(aNumber, aFormat){
		var pFormattedPrice		= ""
		var pNumber 			= "" + aNumber;
		var pCurrChar			= "";
		var pFullPrice 			= "";
		var pCommaPrice 		= "";
		var pCommaIndex 		= 0;
		var pSetFullPrice		= false;
		var isCommaPart			= true;
		
		// Get the Full Part and the Comma Part of the Price
		for (var intIndex = pNumber.length; intIndex >= 0; intIndex--){
			pCurrChar = pNumber.charAt(intIndex);
			if (pCurrChar - 0 != pCurrChar){
				isCommaPart = false
			}
			else{
				if (isCommaPart){
					pCommaPrice = pCurrChar + pCommaPrice;
				}
				else{
					pFullPrice = pCurrChar + pFullPrice;
				}
			}
		}
		
		// If it is a whole number (like 1) then that 1 is the full amount, not the comma amount
		if (isCommaPart){
			pFullPrice = pCommaPrice;
			pCommaPrice = 0;
		}
		
		// Loop Through the Format
		for (var intIndex = 0; intIndex < aFormat.length; intIndex++){
			pCurrChar = aFormat.charAt(intIndex);
			
			// If this is a Price Character, add the Price
			if (pCurrChar == conFullPriceChar){
				if (!pSetFullPrice){
					pFormattedPrice += pFullPrice;
					pSetFullPrice = true;
				}
			}
			else if (pCurrChar == conCommaPriceChar){
				if (pCommaIndex < pCommaPrice.length){
					pFormattedPrice += pCommaPrice.charAt(pCommaIndex);
					pCommaIndex ++;
				}
				else{
					pFormattedPrice += 0;
				}
			}
			// Else keep the Format String
			else{
				pFormattedPrice += pCurrChar;
			}
		}
		
		return pFormattedPrice;
	}
