document.write('<script language=JavaScript src="bank_folder/app_settings.js"></script>');
document.write('<script language=JavaScript src="bank_folder/localized_data.js"></script>');
document.write('<script language=JavaScript src="app_settings.js"></script>');
document.write('<script language=JavaScript src="localized_data.js"></script>');
var localProperties = "";

function getAppProperty(sProperty, sDefault)
{
var sTemp = '';
var iTemp1 = -1;
var iTemp2 = -1;
var sRC = '';

	//set the return value to the default
	sRC = sDefault;

	// Check if it is in the bank specific properties
	
	iTemp1=-1
	iTemp2=-1
	iTemp1 = BankAppProperties.indexOf("|" + sProperty + "=");
	if (iTemp1 > -1) 
	{
		sTemp = BankAppProperties.substring(iTemp1+1);
		iTemp1 = sTemp.indexOf("=");
		iTemp2 = sTemp.indexOf("|");
		sRC = sTemp.substring(iTemp1+1,iTemp2);
	}
	else
	{
		// Check if it is in the global properties
		iTemp1=-1
		iTemp2=-1
		iTemp1 = GlobalAppProperties.indexOf("|" + sProperty + "=");
		if (iTemp1 > -1) 
		{
			sTemp = GlobalAppProperties.substring(iTemp1+1);
			iTemp1 = sTemp.indexOf("=");
			iTemp2 = sTemp.indexOf("|");
			sRC = sTemp.substring(iTemp1+1,iTemp2);
		}
	}
	
	//replace ^^ with "
	sRC = stringReplace(sRC, '^^','"');
	
	//replace ^ with '
	sRC = stringReplace(sRC, "^","'");

	//return the result
	return sRC;	
}

function getLocalizedProperty(sProperty, sDefault)
{
var sTemp = '';
var iTemp1 = -1;
var iTemp2 = -1;
var sRC = '';

	//set the return value to the default
	sRC = sDefault;

	// Check if it is in the bank specific properties
	
	iTemp1=-1
	iTemp2=-1
	iTemp1 = BankLocalizedProperties.indexOf("|" + sProperty + "=");
	if (iTemp1 > -1)
	{
		sTemp = BankLocalizedProperties.substring(iTemp1+1);
		iTemp1 = sTemp.indexOf("=");
		iTemp2 = sTemp.indexOf("|");
		sRC = sTemp.substring(iTemp1+1,iTemp2);
	}
	else
	{
		// Check if it is in the global properties
		iTemp1=-1
		iTemp2=-1
		iTemp1 = GlobalLocalizedProperties.indexOf("|" + sProperty + "=");
		if (iTemp1 > -1)
		{
			sTemp = GlobalLocalizedProperties.substring(iTemp1+1);
			iTemp1 = sTemp.indexOf("=");
			iTemp2 = sTemp.indexOf("|");
			sRC = sTemp.substring(iTemp1+1,iTemp2);
		}
	}
	
	//replace ^^ with "
	sRC = stringReplace(sRC, '^^','"');
	
	//replace ^ with '
	sRC = stringReplace(sRC, "^","'");

	//return the result
	return sRC;	
}

function writeProperty(sProperty, sDefault) {
var sRC = '';

	sRC = getLocalizedProperty(sProperty, sDefault);
	document.write(sRC);
	return;	
}

function stringReplace(str, v1, v2) {
var sRC = '';

	var arr = str.split(v1);
   for (var i=0; i < arr.length; i++) {
		sRC = sRC + arr[i] + v2
	}
	//remove the last v2
	sRC = sRC.substring(0, sRC.length-v2.length);
	return sRC;
}

function output(str)
{
	document.write(str);
}


function getProperty(sProperty, sDefault) {
var sTemp = '';
var iTemp1 = -1;
var iTemp2 = -1;
var sRC = '';

	//set the return value to the default
	sRC = sDefault;

	//if it's in the global.js, replace the value
	iTemp1=-1
	iTemp2=-1
	iTemp1 = BankAppProperties.indexOf("|" + sProperty + "=");
	if (iTemp1 > -1) {
		sTemp = globalProperties.substring(iTemp1+1);
		iTemp1 = sTemp.indexOf("=");
		iTemp2 = sTemp.indexOf("|");
		sRC = sTemp.substring(iTemp1+1,iTemp2);
	}
	
	//if it's in the common.js, replace the value
	iTemp1=-1
	iTemp2=-1
	iTemp1 = BankAppProperties.indexOf("|" + sProperty + "=");
	if (iTemp1 > -1) {
		sTemp = commonProperties.substring(iTemp1+1);
		iTemp1 = sTemp.indexOf("=");
		iTemp2 = sTemp.indexOf("|");
		sRC = sTemp.substring(iTemp1+1,iTemp2);
	}

	//if it's in the page-specific properties file, replace the value
	iTemp1=-1
	iTemp2=-1
	iTemp1 = localProperties.indexOf("|" + sProperty + "=");
	if (iTemp1 > -1) {
		sTemp = localProperties.substring(iTemp1+1);
		iTemp1 = sTemp.indexOf("=");
		iTemp2 = sTemp.indexOf("|");
		sRC = sTemp.substring(iTemp1+1,iTemp2);
	}

	//replace ^^ with "
	sRC = stringReplace(sRC, '^^','"');
	
	//replace ^ with '
	sRC = stringReplace(sRC, "^","'");

	//return the result
	return sRC;	
}