/*****************************************************************************
*  
*  Filename: 	Display_Currency.js
*  Country ver:	UK
*  Lang ver:	ENG
*
*  Description: Processes javascript validation on the Display Currency screen
*  Historic: 	Paulo Sousa (created) 20 Oct 2001
*
*****************************************************************************/

var ValidationStatus=false;

/*****************************************************************************
*  Function name: 	cancel_currency()
*  Expects: 		nothing	
*  Returns: 		nothing
*  Description: 	validates values to be submitted and follwing posting
*			
*  Historic: 		Paulo Sousa (created) 20 Oct 2001
*
*****************************************************************************/
function cancel_currency() 
{
	
	ValidationStatus = true;
	
	
	if(ValidationStatus==true)
	{
		/** set the value to currency id to nothing **/
		document.frmCurrency.hidCurrencyID.value='';
		
		/** set the value to currency code to nothing **/
		document.frmCurrency.hidCurrencyCode.value='';
		
		/** set the value to country name to nothing **/
//		document.frmCurrency.hidCountryName.value='';
		
		/** set the value to ISO name to nothing **/
		document.frmCurrency.hidISOName.value='';
		
		/** submit form **/
		document.frmCurrency.submit();
	}

}
/*****************************************************************************/


/*****************************************************************************
*  Function name: 	set_currency()
*  Expects: 		currencyID	
*  Returns: 		nothing
*  Description: 	validates values to be submitted and follwing posting
*			
*  Historic: 		Paulo Sousa (created) 20 Oct 2001
*
*****************************************************************************/
function set_currency(currencyID, currencyCode, CountryName, ISOName) 
{
	
	ValidationStatus = true;
	if (currencyCode == "USD") {
	    alert("Please note: selecting US Dollars will redirect you to our US site");
	}
	else {
	    if (currencyCode != "GDP") {
	        alert("Please note: Approximate currency conversion is shown for comparison only, \nand any transaction will still be completed in GBP");	    
	    }
	}
	if(ValidationStatus==true)
	{
		/** set the value to currency id **/
		document.frmCurrency.hidCurrencyID.value=currencyID;

		
		/** set the value to currency code  **/
		document.frmCurrency.hidCurrencyCode.value=currencyCode;
		
		/** set the value to country name **/
//		document.frmCurrency.hidCountryName.value=CountryName;
		
		/** set the value to flag name **/
		document.frmCurrency.hidISOName.value=ISOName;


		
		/** submit form **/
		document.frmCurrency.submit();
	}

}
/*****************************************************************************/


