// JavaScript Document
/* Domain */
var defhost = document.URL;
var defhost = defhost.substr(defhost.lastIndexOf('//')+2,defhost.length);
var defhost = defhost.substr(0,defhost.indexOf('/'));
//document.write(defhost);

/* Language */
var lang = 'en';

/* Words */
var words = new Array();

words.push(Array('personal-banking','Personal Banking'));
words.push(Array('deposits','Deposits'));
words.push(Array('power-saver','Power $aver'));
words.push(Array('executive-banking','Executive Banking'));
words.push(Array('excel-banking','Excel Banking'));
words.push(Array('interest-rate','Interest Rate'));
words.push(Array('flexi-deposit','Flexi Deposit'));
words.push(Array('tariffs','Tariffs'));
words.push(Array('forms','Forms'));
words.push(Array('terms-and-conditions','Terms & Conditions'));

words.push(Array('loans','Loans'));
words.push(Array('product-feature','Product Features'));
words.push(Array('interest-rate-and-charges','Interest rate & charges'));
words.push(Array('online-application-forms','Online application Forms'));
words.push(Array('customer-survey','Customer\'s survey'));
words.push(Array('FAQs','F.A.Qs'));

words.push(Array('services','Services'));
words.push(Array('branch-banking-hours','Branch Banking Hours'));
words.push(Array('cheque-services','Cheque Services'));
words.push(Array('automated-banking-lobby','Automated Banking Lobby'));
words.push(Array('call-center','Call Centre'));
words.push(Array('i-banking','iBanking'));
words.push(Array('e-statement','e-Statement'));
words.push(Array('contact-the-bank','Contact the Bank'));
words.push(Array('exclusive-banking','Exclusive Banking'));

words.push(Array('sme-banking','SME Banking'));
words.push(Array('business-guarantee','Business Guarantee'));
words.push(Array('deposits-investments','Deposits & Investments'));
words.push(Array('flexi-deposit','Flexi Deposit'));
words.push(Array('business-saver','Business $aver'));
words.push(Array('straight2bank-e-banking','Straight2Bank'));
words.push(Array('trade-facilities','Trade Facilities'));

words.push(Array('contact-us','Contact Us'));
words.push(Array('terms-conditions','Terms & Conditions'));
words.push(Array('investor-relations','Investor Relations'));
words.push(Array('data-protection-privacy-policy','Data Protection & Privacy Policy'));
words.push(Array('about-us','About Us'));

words.push(Array('client-charter','Client Charter'));

words.push(Array('sitemap','Site Map'));

words.push(Array('usefullink','Useful Links'));

words.push(Array('deposit-interest-rates','Deposit Interest Rates '));
words.push(Array('whats-new','What‘s new '));
words.push(Array('atms-and-branchs','ATMs and Branches'));

words.push(Array('press-releases','Latest News'));
words.push(Array('latest-news','Latest News'));

words.push(Array('12-08-yoola-omudidi-draw','Dec 09, 2008'));
words.push(Array('12-08-sme-expo-hk','Dec 05, 2008'));
words.push(Array('11-08-m-banking','Nov 25, 2008'));
words.push(Array('09-08-africa-sme-month','Sep 02, 2008'));
words.push(Array('07-08-service-guarantee','Jul 28, 2008'));
words.push(Array('07-08-e-statement','Jul 14, 2008'));
words.push(Array('06-08-kikuubo-branch-opening','June 06, 2008'));

words.push(Array('demo-online-banking','Online Banking'));
words.push(Array('account','Account'));
words.push(Array('authorize-transaction','Authorize transaction'));
words.push(Array('existing-customer-account','Existing customer account'));
words.push(Array('forgot-password','Forgot password'));
words.push(Array('fund-transfer','Fund transfer'));
words.push(Array('instant-registration','Instant registration'));
words.push(Array('mail-box','Mail box'));
words.push(Array('market-watch','Market watch'));
words.push(Array('personal-home','Personal home'));
words.push(Array('personal-update','Personal update'));
words.push(Array('standing-order','Standing order'));

words.push(Array('search','Search result'));
words.push(Array('application-forms','Application Forms'));
words.push(Array('personal-loan','Personal Unsecured Loan'));
words.push(Array('phone-banking-services','Phone Banking Services'));
words.push(Array('sme-banking-centers','SME Banking Centre'));

words.push(Array('credit-card','Credit Card'));
words.push(Array('mortgage-loan','Mortgage Loan'));
words.push(Array('key-people','Key People'));
words.push(Array('online-banking','Online Banking'));
words.push(Array('demo','Demo'));
words.push(Array('savings-accounts','Savings Accounts'));
words.push(Array('instant-access','Instant Access'));
words.push(Array('current-accounts','Current Accounts'));
words.push(Array('all-in-one','All In One'));
words.push(Array('fixed-deposit','Fix Deposit'));
words.push(Array('debit-card','Debit Card'));
words.push(Array('foreign-currency-debit-card','Foreign Currency Debit Card'));
words.push(Array('excel-and-priority-banking','Excel and Priority Banking'));
words.push(Array('excel-banking-centres','Excel Banking Centres'));
words.push(Array('priority-banking','Priority Banking'));
words.push(Array('international-banking','International Banking'));
words.push(Array('commercial-banking','Commercial Banking'));
words.push(Array('business-banking-solutions','Business Banking Solutions'));
words.push(Array('overview','Overview'));
words.push(Array('feature','Feature'));
words.push(Array('contact-details','Contact Details'));
words.push(Array('banking-hours','Banking Hours'));
words.push(Array('unsecured','Unsecured'));
words.push(Array('auto-loans','Auto-Loans'));
words.push(Array('accounts-services','Accounts-Services'));
words.push(Array('sme-current-account','SME-Current-Account'));
words.push(Array('investment-management','Investment-Management'));
words.push(Array('savings-plus','Saving Plus'));
words.push(Array('my-dream-account','My Dream Account'));
words.push(Array('premium-savings','Premium Savings'));
words.push(Array('money-builder','Money Builder'));
words.push(Array('higher-education-fund','Higher Education Fund'));
words.push(Array('diva-club','Diva Club'));
words.push(Array('young-executive-club','Young Executive Club'));
words.push(Array('fixed-deposit-accounts','Fixed Deposit Accounts'));
words.push(Array('foreign-exchange-accounts','Foreign Exchange Accounts'));
words.push(Array('investment-services','Investment Services'));
words.push(Array('branches','Branches'));
words.push(Array('atms','ATMs'));
words.push(Array('phone-banking','Phone Banking'));
words.push(Array('mobile-banking','Mobile Banking'));
words.push(Array('internet-banking','Internet Banking'));
words.push(Array('call-centre','Call Centre'));

words.push(Array('product-information','Product Information'));
words.push(Array('savings-account','Savings Account'));
words.push(Array('current-account','Current Account'));
words.push(Array('credit-facilities','Credit Facilities'));
words.push(Array('fixed-deposit-account','Fixed Deposits Account'));
words.push(Array('personal-banking-plan','Personal Banking Plan'));
words.push(Array('atm-money-link','ATM MoneyLink'));
words.push(Array('24-hour-access-to-your-money','24 Hour Access to your Money'));
words.push(Array('visa-electron-debit-card ','Visa Electron Debit Card'));
words.push(Array('atm-visa-facility','ATM Visa Facility'));
words.push(Array('kyosiga-deposit-account','Kyosiga Deposit Account'));
words.push(Array('deposit-plus','Deposit Plus'));
words.push(Array('installment-loan-secured','Installment Loans - Secured'));
words.push(Array('installment-loan-unsecured','Installment Loans - Unsecured'));
words.push(Array('corporate-guaranteed-loan','Corporate Guaranteed Loan'));
words.push(Array('cards','Cards'));
words.push(Array('flat-fee-account','Flat Fee Account'));
words.push(Array('safari-savings-account','Safari Savings Account'));
words.push(Array('diva-club-account','Diva Club Account'));
words.push(Array('my-home-loan','My Home Loan'));
words.push(Array('smart-credit','Smart Credit'));
words.push(Array('working-capital','Working Capital'));
words.push(Array('business-credit','Business Credit'));
words.push(Array('commercial-and-residential','Commercial And Residential Mortgage Financing'));
words.push(Array('trade-finance','Trade Finance'));
words.push(Array('working-capital-facilities','Working Capital Facilities'));
words.push(Array('cash-management','Cash Management'));
words.push(Array('international-trade-account','International Trade Account'));
words.push(Array('straight-2-bank','Straight 2 Bank'));
words.push(Array('sme-banking-centres','SME Banking Centres'));
words.push(Array('visa-electron-debit','Visa Electron Debit Card'));
words.push(Array('visa-platinum','Visa Platinum Card'));
words.push(Array('advantage-card','Advantage Card'));
words.push(Array('branch-banking-hours-and-services','Branch Banking Hours and Services'));
words.push(Array('m-banking','Mobile Banking'));
words.push(Array('e-statement','E - Statement'));
words.push(Array('branch-locations','Our Branch Locations and Contacts'));
words.push(Array('atm-locations','Our ATM Locations'));

words.push(Array('business-current','Business Current Account'));
words.push(Array('international-trade','International Trade Account'));
words.push(Array('npo','NPO Account'));
words.push(Array('business-savings','Business Savings Account'));
words.push(Array('cash-management-products','Cash Management Products'));
words.push(Array('seven-day-banking','Seven Day Banking'));
words.push(Array('mortgage-financing','Commercial and Residential Mortgage Financing'));
words.push(Array('yoola-omudidi','Yoola Omudidi'));
words.push(Array('atms-and-branches','ATMs and Branches'));
words.push(Array('sustainability','Sustainability'));
words.push(Array('24-hour-service-guarantee','24 Hours Service Guarantee'));
words.push(Array('',''));
///////////////////////////////////////////////////////////////////////////////////////////

/* URL domain */
var ud = new String();
ud = document.URL;
var ud = ud.substr(ud.lastIndexOf('http://')+7,ud.length);
//document.write('<p><strong>The URL is: </strong>'+ud+'</p>');
var ua = new Array();
ua = ud.split('/');
//document.write('<p><strong>The URL array is: </strong>'+ua+'</p>');
ua.splice(1,ua.length);
//document.write('<p><strong>The URL array modified as: </strong>'+ua+' and total <strong>'+ua.length+'</strong> array item inside.</p>');
//ua[0] = 'www.standardchartered.com.hk';

/* URL path */
var up = new String();
up = document.location.pathname;
//document.write('<p><strong>URL path = </strong>'+up+'</p>');

/* Array link */
var al = new Array();
al = up.split('/');
//al.splice(0,1);
al.splice(al.length-2,2);
al[0] = ua[0];
//document.write('<p><strong>Array of link = </strong>'+al+'<br /><strong>Total array(s): </strong>'+al.length+'</p>');

/* Array */
var ap = new Array();
ap = up.split('/');
//ap.splice(0,1);
ap.splice(ap.length-2,2);
ap[1] = 'Home';
//document.write('<p><strong>Array of path = </strong>'+ap+'<br /><strong>Total array(s): </strong>'+ap.length+'</p>');

var ta = new Number(ap.length);

/* Value converstion */
//document.write('<p><strong>Converted array(s) as below: </strong><br />');
for (i=1; i<ta; i++) {
	var tmpvalue = ap[i];
	for (j=0; j<words.length;j++) {
		if (tmpvalue == words[j][0]) {
			ap[i] = words[j][1];
			//document.write(tmpvalue+' &gt; '+ap[i]+'<br />');
		}
	}
}
//document.write('</p><p>');

/* Store array */
var defuse = 0;
var sa = new Array();
for (k=1; k<ta; k++) {
	var tmppath = ap[k];
	if (tmppath == 'products') {
		continue;
	}
	if (tmppath == 'Deposits' && pre == 'SME Banking') {
		sa.push(Array(tmppath,"#"));
		continue;
	}
	if (tmppath == 'Services' && pre == 'SME Banking') {
		sa.push(Array(tmppath,"#"));
		continue;
	}
	if (tmppath == 'Exclusive Banking' && pre == 'Personal Banking') {
		sa.push(Array(tmppath,"#"));
		continue;
	}
	if (tmppath == 'Loans' && pre == 'Personal Banking') {
		sa.push(Array(tmppath,"#"));
		continue;
	}
	if (tmppath == 'Services' && pre == 'Personal Banking') {
		sa.push(Array(tmppath,"#"));
		continue;
	}
	var pre = tmppath;
	var tmplink = 'http://';
	for (m=0; m<=k; m++) {
		if (al[m] == 'personal-banking') {
			if (defuse) {
				tmplink += al[m];
				tmplink += '/';
			} else {
				defuse = true;
			}
		} else {
			tmplink += al[m];
			tmplink += '/';
		}
	}
	//document.write('<strong>ID '+k+': </strong> '+tmppath+' : '+tmplink+'<br />');
	sa.push(Array(tmppath,tmplink));
}
//document.write('</p>');

var counted = false;

/* Special case(s) */
// Repeat the statement block for each case(s)
for (n=1; n<ta-1; n++) {
	var chkstr = sa[n-1][0];
	var chklink = sa[n-1][1];
	// Insert specific condition(s) here
	if (chkstr == 'Personal Loans' && chklink.indexOf('/personal-loans/personal-loans/')) {
		if (counted) {
			sa.splice(n-1,1);
		} else {
			counted = true;
		}
	}
}

/* Trace updated array */
/*document.write('<p>');
for (s=0; s<sa.length; s++) {
	document.write('<strong>'+sa[s][0]+'</strong> : '+sa[s][1]+'<br />');
}
document.write('</p>');
*/

document.write('<ul>');

/* Output */
var pageTitle = '';
for (r=0; r<sa.length; r++) {
	if (r != 0) {
		pageTitle += sa[r][0] + " - ";
	}
	
	if (r == sa.length-1) {
		document.write('<li><span>'+sa[r][0]+'</span></li>');
	} else {
		if (r==0) {
		document.write('<li id="firstlink"><a href="'+sa[r][1]+lang+'/"><img src="/ug/_images/stan_logo_breadcrumb.gif" alt="'+sa[r][0]+'" /></a></li>');	
		} else {
		document.write('<li><a href="'+sa[r][1]+lang+'/">'+sa[r][0]+'</a></li>');
		}
	}
}
document.write('</ul>');

pageTitle += "Standard Chartered Bank Uganda";
document.title = pageTitle;
//document.write('<p>The <strong>Home</strong> will be replaced by the domain name.</p>');