﻿// 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 = 'bhs';

/* Words */
var words = new Array();

words.push(Array('contacts','Media Contacts'));
words.push(Array('media','Media'));
words.push(Array('personal-banking','Personal Banking'));
words.push(Array('deposits','Deposits'));
words.push(Array('savings-account','Savings Account'));
words.push(Array('my-dream-account','My Dream Account'));
words.push(Array('moneyhome-card','MoneyHome Card'));

words.push(Array('branch-atm-locator','Kantor Cabang & ATM'));
words.push(Array('credit-cards','Kartu Kredit'));
words.push(Array('business-cards','Busniness Cards'));
words.push(Array('black-platinum-card','Visa Black Platinum'));
words.push(Array('platinum-cards','MasterCard Platinum'));
words.push(Array('titanium','Titanium'));
words.push(Array('gold-cards','Kartu Emas'));
words.push(Array('classic-cards','Kartu Klasik'));
words.push(Array('help-choose-card','Memilih Kartu Kredit'));
words.push(Array('card-benefits','Kartu Benefit'));
words.push(Array('travel-hotline','Travel Hotline'));
words.push(Array('balance-transfer','Balance Transfer'));
words.push(Array('ez-bill','EZ-Bill'));
words.push(Array('voucher-reload','Isi Ulang Pulsa'));
words.push(Array('sms-access','SMS Akses'));
words.push(Array('airport-lounge','Airport Lounge'));
words.push(Array('payment-convenience','Kemudahan Pembayaran'));
words.push(Array('insurance-protection','Perlindungan Asuransi'));
words.push(Array('low-exchange-rate','Nilai Tukar Rendah'));
words.push(Array('steadypay','SteadyPay'));
words.push(Array('great-rewards','Great Rewards'));
words.push(Array('great-privileges','Great Privileges'));
words.push(Array('great-promotion','Great Promotion'));
words.push(Array('great-news','Great Promotion'));
words.push(Array('supplementary-card','Kartu Tambahan'));
words.push(Array('report-lost-card','Menjaga Keamanan Kartu Kredit'));
words.push(Array('report-lost-card','Menjaga Keamanan Kartu Kredit'));
words.push(Array('steadypay-by-phone','Steadypay By Phone'));
words.push(Array('steadypay-cataloque','Steadypay Cataloque'));
words.push(Array('steadypay-in-store','Steadypay In Store'));
words.push(Array('justone','JustOne'));
words.push(Array('register-online-rewards','Register Online Rewards'));


words.push(Array('personal-loan','Kredit Tanpa Agunan'));
words.push(Array('fixed-installment','Cicilan Tetap'));
words.push(Array('standbycash','Standby Cash'));
words.push(Array('help-me-choose-pl','Memilih KTA'));
words.push(Array('loan-promotion','Promotion'));
words.push(Array('pl-payment-guide','Petunjuk Pembayaran'));
words.push(Array('pl-term-and-condition','Syarat dan Ketentuan'));
words.push(Array('top-up-facility','Fasilitas Top Up'));
words.push(Array('keep-your-standbycash-atm-card-secure','Menjaga Keamanan Kartu ATM Standby Cash'));
words.push(Array('report-lost-standby-cash-atm-card','Menjaga Keamanan Kartu ATM Standby Cash'));

words.push(Array('services','Services'));
words.push(Array('kta-sms','KTA SMS'));

words.push(Array('atm-services','ATM Services'));
words.push(Array('contact-us','Contact Us'));
words.push(Array('other-services','Other Services'));
words.push(Array('phone-banking','Phone Banking'));
words.push(Array('online-banking','Online Banking'));
words.push(Array('sms-banking','SMS Banking'));
words.push(Array('house','HOUSe'));
words.push(Array('meps-ibg','MEPS IBG'));
words.push(Array('ekiosk','eKiosk'));
words.push(Array('e-statement','e-Statement'));
words.push(Array('contact-the-bank','Contact the Bank'));
words.push(Array('online-banking','Online Banking'));

words.push(Array('insurance','Insurance'));
words.push(Array('your-health','Your Health'));
words.push(Array('your-wealth','Your Wealth'));
words.push(Array('your-business','Your Business'));
words.push(Array('your-education','Your Education'));
words.push(Array('your-education-pro','Pro Siswa'));
words.push(Array('your-bill','Your Bill'));
words.push(Array('your-bill-cg','Credit Guard'));
words.push(Array('your-retirement','Your Retirement'));
words.push(Array('your-retirement-gp','Golden Protector'));
words.push(Array('your-legacy','Your Legacy'));
words.push(Array('your-legacy-fep','Family Estate Protection'));
words.push(Array('your-health-mc','Maxi Care'));
words.push(Array('your-health-fhe','Family Hospital Extra'));
words.push(Array('your-wealth-sip','Select Invest Protector'));
words.push(Array('your-wealth-pip','Protect Invest Plus'));
words.push(Array('your-wealth-vs','Value Shield'));
words.push(Array('your-wealth-fs','Family Shield'));
words.push(Array('your-wealth-ps','Premium Shield'));
words.push(Array('your-business-fep','FEP Key-Man Protection'));
words.push(Array('your-business-group','Group Life and Health'));


words.push(Array('general-insurance','General Insurance'));
words.push(Array('types-of-general-insurance','Types of General Insurance'));
words.push(Array('the-main-types-of-insurance-plans','The Main Types of Insurance Plans'));
words.push(Array('life-insurance','Life Insurance'));
words.push(Array('travel-insurance','Travel Insurance'));

words.push(Array('investments','Investments'));
words.push(Array('unit-trust','Unit Trust'));
words.push(Array('foreign-currency-account','Foreign Currency Account'));
words.push(Array('Premium Currency Investment','premium-currency-investment'));
words.push(Array('money-manager','Money Manager'));
words.push(Array('investment','Investment'));
words.push(Array('gov-bonds','Surat Utang'));
words.push(Array('mutual-funds','Reksa Dana'));
words.push(Array('investplan','InvestPlan'));
words.push(Array('overdraft','Overdraft'));
words.push(Array('currency','Premium Currency Investment'));
words.push(Array('market-update','Market Update'));
words.push(Array('structuredinvestment','Structured Investment'));
words.push(Array('foreigncurrency','Foreign Currency'));


words.push(Array('features-and-benefits','Features and Benefits'));
words.push(Array('faqs','FAQs'));
words.push(Array('Features and Benefits','Features and Benefits'));
words.push(Array('how-does-it-work','How does it work'));
words.push(Array('liberalisation-on-the-foreign-exchange-administration-policies','Liberalisation on the Foreign Exchange Administration Policies'));
words.push(Array('plan-build-and-protect','Plan Build & Protect'));

words.push(Array('sme-banking','SME Banking'));
words.push(Array('cash-management','Manajemen Keuangan'));
words.push(Array('bil','KTA Bisnis'));
words.push(Array('current-account','Current Account'));
words.push(Array('investment','Investment'));
words.push(Array('straight2bank','Straight2Bank'));
words.push(Array('foreign-exchange','Penukaran Mata Uang Asing'));
words.push(Array('pci','Premium Currency Investment'));
words.push(Array('working-capital-loan','Kredit Modal Kerja'));
words.push(Array('treasury','Treasury'));
words.push(Array('topup-facility','Fasilitas Top Up'));
words.push(Array('trade-finance-services','Trade Finance Services'));

words.push(Array('wealth-management','Wealth Management'));
words.push(Array('esaver','eSaver'));
words.push(Array('saving-plus','Saving Plus'));
words.push(Array('premium-saving','Premium Saving'));
words.push(Array('usd-account','Rekening US  Dollar'));
words.push(Array('fcy-saving-account','Foreign Currency Saving'));
words.push(Array('deposits','Deposits'));
words.push(Array('saving-account','Tabungan'));
words.push(Array('fixed-deposit','Deposito'));
words.push(Array('fx-plus','FX Plus Deposit'));
words.push(Array('twin-invest','Twin Invest'));
words.push(Array('twin-insured','Twin Insured'));
words.push(Array('premium-currency-deposit','Premium Currency Deposit'));
words.push(Array('principal-plus','Principal Plus'));
words.push(Array('investment-services','Investasi'));
words.push(Array('bancassurance','Bancassurance'));
words.push(Array('family-shield','Family Shield'));
words.push(Array('premium-shield','Premium Shield'));
words.push(Array('value-shield','Value Shield'));
words.push(Array('secured-overdraft','Dana Instan'));
words.push(Array('other-services','Layanan Lainnya'));
words.push(Array('remittances','Remittances'));
words.push(Array('other-services','Layanan Lainnya'));
words.push(Array('online-banking','Online Banking'));
words.push(Array('savings','Saving'));
words.push(Array('current-account','Giro'));
words.push(Array('keep-you-atm-card-secure','Menjaga Keamanan kartu ATM'));
words.push(Array('fx-transaction','Transaksi FX'));
words.push(Array('fx-transaction','Transaksi FX'));
words.push(Array('fx-transaction','Transaksi FX'));
words.push(Array('safe-deposit-box','Safe Deposit Box'));
words.push(Array('tariff-charges','Tarif dan Biaya'));
words.push(Array('insurance','Insurance'));


words.push(Array('smart-health','Smart Health'));
words.push(Array('future-saver','Future Saver'));
words.push(Array('tabunganku','TabunganKu'));


words.push(Array('home-suite','Home Suite'));
words.push(Array('housing-loan','Housing Loan'));

words.push(Array('other-related-services','Other Related Services'));
words.push(Array('mrta','MRTA'));
words.push(Array('mrtt','MRTT'));
words.push(Array('msig-home-contents-insurance','MSIG Home'));

words.push(Array('about-us','Tentang Kami'));
words.push(Array('investor-relations','Hubungan Investor'));
words.push(Array('data-protection-privacy-policy','Data Protection & Privacy Policy'));
words.push(Array('financial-information','Informasi Keuangan'));
words.push(Array('investor-relations-in-indonesia','Hubungan Investor Di Indonesia'));
words.push(Array('principle-and-values','Prinsip Dan Nilai-Nilai'));
words.push(Array('our-history-in-indonesia','Sejarah Kami Indonesia'));
words.push(Array('sustainability-in-indonesia','Keberlangsungan di Indonesia'));
words.push(Array('press-releases','Press Releases'));
words.push(Array('event-photos','Event Photos'));
words.push(Array('important-news','Penting Untuk Diketahui'));
words.push(Array('local-community-1','Perbaikan Sekolah Jogya'));
words.push(Array('living-with-hiv','Living With HIV'));
words.push(Array('seeing-is-believing','Seeing Is Believing'));
words.push(Array('local-community','Tsunami'));
words.push(Array('local-community-3','Komunitas Lokal'));
words.push(Array('staff-community','Komunitas Karyawan'));
words.push(Array('latest-news','Berita Terkini'));
words.push(Array('local-community-2','D & I'));
words.push(Array('press-releases','Berita Pers'));
words.push(Array('media-contacts','Media Kontak'));
words.push(Array('here-for-good','Here For Good'));
words.push(Array('brandbelief','Brand Belief'));


words.push(Array('wealth-session','Wealth Session'));
words.push(Array('wm-expo','WM Expo'));
words.push(Array('economic-seminar','Economic Seminar'));
words.push(Array('service-quality-award','Service Quality'));
words.push(Array('ceo-fire-talk','Ceo Fire Talk'));
words.push(Array('best-sub-custodian','Best Sub Custodian'));
words.push(Array('cashback','Cashback'));

words.push(Array('wholesale-banking','Wholesale Banking'));

words.push(Array('client-charter','Client Charter'));

words.push(Array('sitemap','Site Map'));

words.push(Array('search','Search result'));

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('loans','Loans'));
///////////////////////////////////////////////////////////////////////////////////////////

/* 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;
	}
	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="/vn/_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 Indonesia";
document.title = pageTitle;
//document.write('<p>The <strong>Home</strong> will be replaced by the domain name.</p>');
