document.write('<script language=JavaScript src="bank_folder/common.js"></script>');
document.write('<script language=JavaScript src="global.js"></script>');
var localProperties = "";

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 = globalProperties.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 = commonProperties.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;	
}

function writeProperty(sProperty, sDefault) {
var sRC = '';

	sRC = getProperty(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;
}

