// 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();

/* Personal Banking */
words.push(Array('personal-banking','Personal Banking'));

words.push(Array('deposits','Deposits'));
words.push(Array('savings-account','Savings Account'));
words.push(Array('visa-electron','VISA Electron'));
words.push(Array('interest-calculator','Interest Calculator'));
words.push(Array('power-saver-savings-account','Power Saver Savings Account'));
words.push(Array('power-saver-plus-savings-account','Power Saver Plus Savings Account'));
words.push(Array('time-deposit','Time Deposit'));
words.push(Array('time-deposit-account','Time Deposit Account'));
words.push(Array('my-dream-account','My Dream Account'));
words.push(Array('max-saver-account','Max Saver Account'));
words.push(Array('fixed-deposit','Fixed Deposit'));
words.push(Array('current-account','Current Account'));
words.push(Array('moneyhome-card','MoneyHome Card'));
words.push(Array('foreign-currency-deposit','Foreign Currency Deposit'));
words.push(Array('australian-dollar-saving-account','Australian Dollar Saving Account'));
words.push(Array('australian-dollar-time-deposit','Australian Dollar Time Deposit'));


words.push(Array('cards','Cards'));
words.push(Array('credit-cards','Credit Cards'));
words.push(Array('standard-chartered-platinum-card','Standard Chartered Platinum Card'));
words.push(Array('standard-chartered-business-card','Standard Chartered Business Card'));
words.push(Array('standard-chartered-gold-card','Standard Chartered Gold Card'));
words.push(Array('standard-chartered-classic-card','Standard Chartered Classic Card'));
words.push(Array('promotions','Promotions'));
words.push(Array('travel-insurance','Travel Insurance'));
words.push(Array('amway-mastercard','Amway MasterCard'));
words.push(Array('character-mastercard','Character MasterCard'));
words.push(Array('goal-mastercard','Goal! MasterCard'));
words.push(Array('business-visa','Business Visa'));
words.push(Array('m-card-visa','M-Card Visa'));
words.push(Array('motorist-club-card','Motorist Club Visa Card'));
words.push(Array('nissan-visa','Nissan Visa'));
words.push(Array('smartone-smart-credit','TM Visa'));
words.push(Array('classic-visa-mastercard','Classic Visa & MasterCard'));
words.push(Array('gold-visa-mastercard','Gold Visa & MasterCard'));
words.push(Array('visa-infinite','Visa Infinite'));
words.push(Array('platinum-visa-mastercard','Platinum Visa & MasterCard'));
words.push(Array('latest-promotions','Latest Promotions'));
words.push(Array('e-statement','e-statements'));
words.push(Array('purchase-protect','Purchase Protect'));
words.push(Array('choice-rewards','Choice Rewards'));
words.push(Array('travel-insurance','Travel Insurance'));
words.push(Array('24-hour-emergency-assistance','24-Hour Emergency Assistance'));
words.push(Array('supplementary-visa-master-card','Supplementary Visa & MasterCard'));
words.push(Array('credit-card-advantages','Credit Card Advantages'));
words.push(Array('balance-transfer','Balance Transfer'));
words.push(Array('terms-and-conditions-apply','Terms and Conditions Apply'));
words.push(Array('bnm-tiered-rates','BNM Tiered Rates'));
words.push(Array('contact-us','Contact Us'));
words.push(Array('apply-now','Apply Now'));
words.push(Array('benefits','Benefits'));

words.push(Array('loans','Loans'));
words.push(Array('home-loans','Home Loans (Islamic financing)'));
words.push(Array('overdraft-facility','Overdraft Facility'));
words.push(Array('personal-installment-loan','Personal Installment Loan'));
words.push(Array('standby-cash','Standby Cash'));
words.push(Array('personal-line-of-credit',' Personal Line of Credit'));
words.push(Array('smart-cash','Smart Cash'));

words.push(Array('mortgages','Mortgages'));
words.push(Array('mortgageone','MortgageOne'));
words.push(Array('mortgage-link','Mortgage Link'));
words.push(Array('my-mortgage-and-money-mortgage','My Mortgage and Money Mortgage'));
words.push(Array('progressive-home-loan','Progressive Home Loan'));
words.push(Array('mortgage-tools','Mortgage Tools'));
words.push(Array('mortgage-calculator','Mortgage Calculator'));
words.push(Array('mortgage-suitability','Mortgage Suitability'));
words.push(Array('document-check-list','Document Check List'));
words.push(Array('interest-fee','Interest Fee'));
words.push(Array('fees','Fees'));
words.push(Array('faq','FAQ'));
words.push(Array('mortgageone-optimizer','MortgageOne Optimizer???'));
words.push(Array('mortgageone-low-start','MortgageOne??? Low Start'));
words.push(Array('mortgageone-bonus','MortgageOne??? Bonus'));
words.push(Array('justhome-i','JustHome-i'));
words.push(Array('conventional-housing-loan','Conventional Housing Loan'));
words.push(Array('faq','FAQs'));
words.push(Array('personal-loans','Personal Loans'));
words.push(Array('quick-cash-eDGE???','Quick Cash EDGE???'));
words.push(Array('quick-cash-eDGE??? Classic','Quick Cash EDGE??? Classic'));
words.push(Array('personal-financing-i','Personal Financing-i'));
words.push(Array('flexiOverdraft','FlexiOverdraft'));
words.push(Array('quick-cash-edge','Quick Cash EDGE???'));
words.push(Array('loans-repayment-schedule','Loans Repayment Schedule'));
words.push(Array('loans-repayment-schedule-ii','Loans Repayment Schedule'));
words.push(Array('balance-refinancing','Balance Refinancing'));
words.push(Array('quick-cash-edge-classic','Quick Cash EDGE??? Classic'));
words.push(Array('over-draft','Overdraft'));
words.push(Array('optioverdraft','OptiOverdraft'));
words.push(Array('flexioverdraft','FlexiOverdraft'));
words.push(Array('loans','Loans'));
words.push(Array('loans','Loans'));

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('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('domestic-money-transfer','Domestic Money Transfer'));
words.push(Array('bank-guarantee','Bank Guarantee'));
words.push(Array('certified-bank-statement','Certified Bank Statement'));
words.push(Array('cashier-cheque','Cashier Cheque'));
words.push(Array('safe-deposit-box','Safe Deposit Box'));
words.push(Array('payment-services','Payment Services'));
words.push(Array('insurance-premium-payment','Insurance Premium Payment'));
words.push(Array('utility-payment','Utility Payment'));
words.push(Array('tax-payment','Tax Payment'));
words.push(Array('credit-card-direct-debit','Credit Card Direct Debit'));

words.push(Array('insurance','Insurance'));
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('non-life-insurance','Non-Life Insurance'));
words.push(Array('travel-insurance','Travel Insurance'));

words.push(Array('investments','Investments'));
words.push(Array('investment','Investment Services'));
words.push(Array('tools','Tools'));
words.push(Array('financial-health-check','Financial Health Check'));
words.push(Array('risk-profiler','Risk profiler'));
words.push(Array('tax-saving-calculator','Tax Saving Calculator'));
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('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('priority-banking','Priority Banking'));
words.push(Array('total-solution','Total Solution'));
words.push(Array('innovative-products','Innovative Products'));
words.push(Array('other-services','Other Services'));
words.push(Array('world-without-borders','A World Without Borders'));
words.push(Array('global-offerings','Global Offerings'));
words.push(Array('market-news','Market News'));
words.push(Array('priority-events','Priority Events '));
words.push(Array('be-our-priority-today','Be Our Priority Today '));


/* SME Banking */
words.push(Array('sme-banking','SME Banking'));
words.push(Array('promotions','New Promotions'));
words.push(Array('deposit-cash-management','Deposit & Cash Management'));
words.push(Array('current-account','Current Account'));
words.push(Array('savings-account','Savings Account'));
words.push(Array('time-deposit-account','Time Deposit Account'));
words.push(Array('cash-management','Cash Management'));
words.push(Array('business-lending','Business Lending'));
words.push(Array('business-installment-loan','Business Installment Loan'));
words.push(Array('property-mortgage','Property Mortgage'));
words.push(Array('trade-services','Trade Services'));
words.push(Array('trade-service-for-importers','Trade Service for Importers'));
words.push(Array('trade-service-for-exporters','Trade Service for Exporters'));
words.push(Array('bond-guarantee','Bond/Guarantee (B/G)'));
words.push(Array('fx-remittance-forward-fx-options','Fx- Remittance / Forward / FX Options'));
words.push(Array('receivables-service','Receivables Service (Domestic and Cross Border)'));
words.push(Array('other-value-services','Other Value Services'));
words.push(Array('local-international-network','Local and International Network'));
words.push(Array('professional-sme-relationship-manager','Professional SME Relationship Manager'));
words.push(Array('trade-service-advisory','Trade Service Advisory'));
words.push(Array('sme-banking-corner','SME Banking Corner'));
words.push(Array('business-management-tools','Tools'));
words.push(Array('interest-calculation-cash-management','Interest Calculation for Cash Management Product'));
words.push(Array('business-calculation','Business Calculation (BIL / BOD / PP / CM)'));
words.push(Array('business-matching','Business Matching (Business Partner Matching)'));
words.push(Array('news-economic-review','News & Economic Review'));
words.push(Array('news-update','News updated'));
words.push(Array('123456','Subscribing the news updated'));
words.push(Array('online-application','Online Application'));
words.push(Array('123456','Online Application for BIL / BOD / PP / CM'));
words.push(Array('123456','SME Referral Section'));
/* Tools & Utilities */
words.push(Array('tools-utilities','Tools &amp; Utilities'));
words.push(Array('form-centre','Download Forms'));
words.push(Array('complaints','Send Us Feedback and Complaints'));

/* Other */
words.push(Array('terms-conditions','Terms &amp; Conditions'));
words.push(Array('investor-relations','Investor Relations'));
words.push(Array('data-protection-privacy-policy','Data Protection &amp; Privacy Policy'));
words.push(Array('about-us','About Us'));
words.push(Array('client-charter','Client Charter'));
words.push(Array('usefullink','Useful Links'));
words.push(Array('deposit-interest-rates','Deposit Interest Rates'));
words.push(Array('whats-new','What&prime;s new'));
words.push(Array('loans','Loans'));

/* Latest News */
words.push(Array('latest-news','Latest News'));
words.push(Array('press-releases','Press Releases'));
words.push(Array('media-centre','Media Centre'));


/* About US */
words.push(Array('about-us','About Us'));
words.push(Array('in-thailand','In Thailand'));
words.push(Array('summary-statement-of-assets-and-liabilities','Summary Statement'));
words.push(Array('in-thailand','In Thailand'));
words.push(Array('scbt','Standard Chartered Bank (Thai) Public Company Limited'));
words.push(Array('scnb','Standard Chartered Bank Nakornthon'));
words.push(Array('scb','Standard Chartered Bank - Bangkok Branch'));

/* Quick Link */
words.push(Array('our-phone-banking-numbers','Our Phone Banking Numbers'));
words.push(Array('branch_atm_locator','Locate an ATMs / Branches'));
words.push(Array('branch-atm-locator','Locate an ATMs / Branches'));
words.push(Array('bank-announcement','Bank Announcement'));
words.push(Array('interest-fees','Interest Fees'));
words.push(Array('sitemap','Site Map'));

/* Legal Notices */
words.push(Array('_legal-notices','Legal Notices'));
words.push(Array('disclaimer','Terms &amp; Conditions'));
words.push(Array('datapp','Data Protection &amp; Privacy Policy'));

/* Priority banking*/
words.push(Array('for-you','For You'));
words.push(Array('for-your-family','For Your Family'));
words.push(Array('for-your-business','For Your Business'));



/* 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="/id/personal-banking/priority-banking/_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>');
