function initForm() {
	setSelectionValue(getCountryField(),"C"+gInitParms[0]);
	setSelectionValue(getCurrencyField(),gInitParms[1]);
	gLoaded=true;
}

function advicePage(url) {
	parent.gFromCcyTA = getSelectionValue(getCurrencyField());
	parent.gToCcyTA=null;
	parent.gAmountTA = 100;
	url = url + "?country=" + getSelectionValue(getCountryField()).substr(1);
	location=url;
	return false;
}


function getCurrencyField() {
	return document.forms[0].currency;
}

function getCountryField() {
	return document.forms[0].country;
}

function SubmitForm(submitter,receiver) {
	if (gLoaded) {
		if (checkCountry() && checkCurrency()){
        		with (receiver){ 
         			var obj=getCountryField();
				if (obj)
					country.value=getSelectionValue(getCountryField()).substr(1);
				currency.value=getSelectionValue(getCurrencyField());
        			gLoaded=false;
        			return true;
        		}
        	}
	}
	return false;
}


function checkCountry(){
	var obj=getCountryField();
	if (!obj)
		return true;
	var value=getSelectionValue(obj);
	if (value=='' || value.substring(0,1)=='S') {
		alert(gMsg1);
		getCountryField().focus();
		return false;
	}
	return true;
}

function checkCurrency() {
	if (getSelectionValue(getCurrencyField())=='') {
		alert(gMsg2);
		getCurrencyField().focus();
		return false;
	}
	return true;
}
