// 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 Saver'));
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('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('01-08-mumbai-marathon-champion','January, 2008'));
words.push(Array('01-08-pre-mumbai-marathon-champion','January 18, 2008'));
words.push(Array('01-08-post-mumbai-marathon-champion','January 21, 2008'));

words.push(Array('02-08-pre-hongkong-marathon-champion','February 14, 2008'));
words.push(Array('02-08-post-hongkong-marathon-champion','February 18th, 2008'));

words.push(Array('03-08-completes-acquisition-of-american-express-bank','March 03, 2008'));
words.push(Array('03-08-poised-to-expand-rapidly-in-vietnam','March 05, 2008'));
words.push(Array('03-08-looks-forward-to-the-development-of-vietnam-capital-market','March 26, 2008'));

words.push(Array('04-08-top-commended-agent-bank-in-vietnam','April 01, 2008'));
words.push(Array('04-08-vietnam-men-team-us40000-prize-award-for-greatest-race-on-earth','April 03, 2008'));

words.push(Array('05-08-acquire-a-further-stake-in-acb','May 05, 2008'));

words.push(Array('06-08-expand-consumer-banking-business','June 18, 2008'));

words.push(Array('07-08-expands-consumer-banking-business','July 01, 2008'));
words.push(Array('02-11-standard-chartered-joins-smartlink-network','February 14, 2011'));
words.push(Array('11-10-louis-taylor-appointed-the-general-director-of-standard-chartered-bank-vn-limited','November 01, 2010'));
words.push(Array('11-12-12.02','December 12, 2012'));
words.push(Array('11-12-12','December 12, 2012'));

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 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('esaver','E$aver'));
words.push(Array('gold-credit-card','Gold Credit Card'));
words.push(Array('product-features','Product Features'));
words.push(Array('cards','Cards'));
words.push(Array('advantage-deposit','Advantage Deposit'));
words.push(Array('certificate-deposit','Certificate Deposit'));
words.push(Array('debit-card','Debit Card'));
words.push(Array('debit-card-tariff','Debit Card Tariff'));
words.push(Array('business-account','Business Account'));
words.push(Array('tariff','Tariff'));
words.push(Array('business-saver-account-tariff','Business $aver Account Tariff'));
words.push(Array('business-account-tariff','Business Account Tariff'));
words.push(Array('acb-atms',' ACB ATM Locations'));
words.push(Array('scb-atms-and-branches','Standard Chartered Branches and ATMs'));
words.push(Array('map-hn','ACB ATM Location Map_HaNoi'));
words.push(Array('map-vn','ACB ATM Location Map_VN'));
words.push(Array('map-hcm','ACB ATM Location Map_HCM'));
words.push(Array('sms-banking','SMS Banking'));
words.push(Array('code-list','Code List for Pull Service'));
words.push(Array('alert-types','Available date for Alerts'));
words.push(Array('use','Use via Online Banking'));
words.push(Array('register','Register via Online Banking'));
words.push(Array('take-a-tour','Take a Tour'));
words.push(Array('fund-transfer-limit','Fund Transfer Limit'));
words.push(Array('forgot-password-by-card','"Forgot Password" By Card'));
words.push(Array('register-by-card','Register By Card'));
words.push(Array('transfer-limit','Transfer Limit'));
words.push(Array('standard-chartered-atm-card','Standard Chartered ATM card'));
words.push(Array('mortgage','Mortgage'));
words.push(Array('insurance','Insurance'));
words.push(Array('non-life-insurance','Non-Life Insurance'));
words.push(Array('personal-accident-insurance','Personal Accident Insurance'));
words.push(Array('travel-insurance','Travel Insurance'));
words.push(Array('house-insurance','House Insurance'));
words.push(Array('sme-insurance','SME Insurance'));
words.push(Array('property-insurance','Property Insurance'));
words.push(Array('cargo-insurance','Cargo Insurance'));
words.push(Array('life-insurance','Life Insurance'));
words.push(Array('pru-cash','Pru Cash Double'));
words.push(Array('pru-triple','Pru Triple EduCare'));
words.push(Array('pru-retire','Pru Retire Easy'));
words.push(Array('choosing-the-right-policy','Choosing The Right Policy'));
words.push(Array('trade-and-working-capital','Trade and Working Capital'));
words.push(Array('interest-upfront-term-deposit','Interest Upfront Term Deposit'));
words.push(Array('card-promotions','Card Promotions'));
words.push(Array('fees','Fees'));
words.push(Array('bill-payment-mobile-top-up','Bill Payment &amp; Mobile Top Up'));
words.push(Array('bill-payment','Bill payment'));
words.push(Array('mobile-top-up','Mobile top up'));
words.push(Array('insurance-payments','Insurance payments'));
words.push(Array('scb-visa-platinum-card','Standard Chartered Platinum Debit Card'));
words.push(Array('sme-product-offerings','SME Product Offerings'));
words.push(Array('capital-account','Capital Account'));
words.push(Array('trade-working-capital','Trade and Working Capital'));
words.push(Array('term-loan','Term Loan'));
words.push(Array('supply-chain-financing','Supply Chain Financing'));
words.push(Array('sme-service-offerings','SME Service Offerings'));
words.push(Array('smartlink','Smart Link'));
words.push(Array('straight2bank','Straight2Bank'));
words.push(Array('forex','Forex'));
words.push(Array('payroll-account','Payroll Account'));
words.push(Array('doorstep-banking','Doorstep Banking'));
words.push(Array('escrow-service','Escrow Service'));
words.push(Array('sme-form-templates','SME Form Templates'));
words.push(Array('sme-bank-tariffs','SME Bank Tariffs'));
words.push(Array('11-10-01','October 01, 2011'));
words.push(Array('12-01-16','January 16, 2012'));
words.push(Array('visa-debit-card','Standard Chartered Debit Card'));
words.push(Array('how-to-apply','How to apply?'));
words.push(Array('',''));
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 == 'SME Product Offerings') {
		sa.push(Array(tmppath,"/vn/sme-banking/sme-product-offerings/business-account/"));
		continue;
	}
	if (tmppath == 'SME Service Offerings') {
		sa.push(Array(tmppath,"/vn/sme-banking/sme-service-offerings/smartlink/"));
		continue;
	}
	if (tmppath == 'Tariff') {
		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 Vietnam";
document.title = pageTitle;
//document.write('<p>The <strong>Home</strong> will be replaced by the domain name.</p>');
