	var EUR = "EUR";
	var GBP = "GBP";
	var SEK = "SEK";
	var DKK = "DKK";
	var NOK = "NOK";
	var USD = "USD";
	var CAD = "CAD";
	var MXN = "MXN";
	var BRL = "BRL";
	var ARS = "ARS";

	var BGN = "BGN";
	var CHF = "CHF";
	var CNY = "CNY";
	var CZK = "CZK";
	var HKD = "HKD";
	var ISK = "ISK";
	var PLN = "PLN";
	var RON = "RON";
	var TRY = "TRY";
	var ZAR = "ZAR";
          
	var EEK = "EEK";
	var LVL = "LVL";
	var LTL = "LTL";
	var PYG = "PYG";
	var SKK = "SKK";
	var UAH = "UAH";

	function updateCurrency(countryCodeId, currencyCodeId) {
		var e = document.getElementById(countryCodeId);
		if (e == null) {
			alert(countryCodeId + " field was not found!");
			return false;
		}
		var currency = document.getElementById(currencyCodeId);
		if (currency == null) {
			alert(currencyCodeId + " field was not found!");
			return false;
		}

		if (e.value.toUpperCase() == 'ES') 		{ currency.value = EUR; }
		else if (e.value.toUpperCase() == 'FR') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'DE') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'GB') { currency.value = GBP; }
		else if (e.value.toUpperCase() == 'SE') { currency.value = SEK; }
		else if (e.value.toUpperCase() == 'IT') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'PT') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'GR') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'DK') { currency.value = DKK; }
		else if (e.value.toUpperCase() == 'NO') { currency.value = NOK; }
		else if (e.value.toUpperCase() == 'FI') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'US') { currency.value = USD; }
		else if (e.value.toUpperCase() == 'CA') { currency.value = CAD; }
		else if (e.value.toUpperCase() == 'MX') { currency.value = MXN; }

		else if (e.value.toUpperCase() == 'BE') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'BG') { currency.value = BGN; }
		else if (e.value.toUpperCase() == 'CN') { currency.value = CNY; }
		else if (e.value.toUpperCase() == 'CY') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'CZ') { currency.value = CZK; }
		else if (e.value.toUpperCase() == 'HK') { currency.value = HKD; }
		else if (e.value.toUpperCase() == 'IE') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'IS') { currency.value = ISK; }
		else if (e.value.toUpperCase() == 'LU') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'MO') { currency.value = HKD; }
		else if (e.value.toUpperCase() == 'NL') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'PL') { currency.value = PLN; }
		else if (e.value.toUpperCase() == 'RO') { currency.value = RON; }
		
		else if (e.value.toUpperCase() == 'SI') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'ZA') { currency.value = ZAR; }
		else if (e.value.toUpperCase() == 'CH') { currency.value = CHF; }
		else if (e.value.toUpperCase() == 'TR') { currency.value = TRY; }
		else if (e.value.toUpperCase() == 'AT') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'BR') { currency.value = BRL; }
		else if (e.value.toUpperCase() == 'AR') { currency.value = ARS; }

		else if (e.value.toUpperCase() == 'EE') { currency.value = EUR; }
		else if (e.value.toUpperCase() == 'LV') { currency.value = LVL; }
		else if (e.value.toUpperCase() == 'LT') { currency.value = LTL; }
		else if (e.value.toUpperCase() == 'PY') { currency.value = PYG; }
		else if (e.value.toUpperCase() == 'SK') { currency.value = SKK; }
		else if (e.value.toUpperCase() == 'UA') { currency.value = UAH; }

	}

	function chkNumeric(objName,minval,maxval)
	{
		// only allow 0-9 be entered, plus any values passed
		// (can be in any order, and don't have to be comma, period, or hyphen)
		// if all numbers allow commas, periods, hyphens or whatever,
		// just hard code it here and take out the passed parameters
		var checkOK = "0123456789";
		var checkStr = objName;
		var allValid = true;
		var decPoints = 0;
		var allNum = "";

		for (i = 0;  i < checkStr.value.length;  i++)
		{
			ch = checkStr.value.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
				break;
				if (j == checkOK.length) {
					allValid = false;
					break;
				}
				if (ch != ",")
					allNum += ch;
		}
		if (!allValid) {	
			alertsay = "Please enter only these values \""
			alertsay = alertsay + checkOK + "\" in the \"" + checkStr.name + "\" field."
			alert(alertsay);
			return (false);
		}

		// set the minimum and maximum
		var chkVal = allNum;
		var prsVal = parseInt(allNum);
		if (chkVal != "" && !(prsVal >= minval && prsVal <= maxval)) {
			alertsay = "Please enter a value greater than or "
			alertsay = alertsay + "equal to \"" + minval + "\" and less than or "
			alertsay = alertsay + "equal to \"" + maxval + "\" in the \"" + checkStr.name + "\" field."
			alert(alertsay);
			return (false);
		}
		return true;
	}

function isChecked(checkId) {
		var e = document.getElementById(checkId);
		if (e == null)  {
			alert("Check Element w/ id: " + checkId + " is null");
			return false;
		}
		if (e.checked) {
			document.getElementById(checkId)
		}
		return e.checked;
	}

	function isEmpty(elementId) {
		var e = document.getElementById(elementId);
		if (e == null)  {
			alert("Element w/ id: " + elementId + " is null");
			return false;
		}
		return (Trim(e.value)).length == 0
	}

	function Trim(TRIM_VALUE){
		if(TRIM_VALUE.length < 1){
			return"";
		}
		TRIM_VALUE = RTrim(TRIM_VALUE);
		TRIM_VALUE = LTrim(TRIM_VALUE);
		if(TRIM_VALUE==""){
			return "";
		}
		else{
			return TRIM_VALUE;
		}
	} //End Function

	function RTrim(VALUE){
		var w_space = String.fromCharCode(32);
		var v_length = VALUE.length;
		var strTemp = "";
		if(v_length < 0){
			return"";
		}
		var iTemp = v_length -1;

		while(iTemp > -1){
			if(VALUE.charAt(iTemp) == w_space){
			}
			else{
				strTemp = VALUE.substring(0,iTemp +1);
				break;
			}
			iTemp = iTemp-1;

		} //End While
		return strTemp;

	} //End Function

	function LTrim(VALUE){
		var w_space = String.fromCharCode(32);
		if(v_length < 1){
			return"";
		}
		var v_length = VALUE.length;
		var strTemp = "";

		var iTemp = 0;

		while(iTemp < v_length){
			if(VALUE.charAt(iTemp) == w_space){
			}
			else{
				strTemp = VALUE.substring(iTemp,v_length);
				break;
			}
			iTemp = iTemp + 1;
		} //End While
		return strTemp;
	} //End Function

	function validateSize(textElement, maxSize)  {
		if (textElement) {
			if (Trim(textElement.value).length <= maxSize) {
				return true;
			}
		}
		return false;
	}

function replace(argvalue, x, y) {

  if ((x == y) || (parseInt(y.indexOf(x)) > -1)) {
    errmessage = "replace function error: \n";
    errmessage += "Second argument and third argument could be the same ";
    errmessage += "or third argument contains second argument.\n";
    errmessage += "This will create an infinite loop as it's replaced globally.";
    alert(errmessage);
    return false;
  }
    
  while (argvalue.indexOf(x) != -1) {
    var leading = argvalue.substring(0, argvalue.indexOf(x));
    var trailing = argvalue.substring(argvalue.indexOf(x) + x.length, 
	argvalue.length);
    argvalue = leading + y + trailing;
  }

  return argvalue;

}
