(function() {

	// An array of objects that have a text and link property. Should be self explanatory.
	var links = [
		{ 'text': 'Online shares explained', 'link': 'shares_explained.html' },
		{ 'text': 'Costs', 'link': 'costs.html' },
		{ 'text': 'Platforms', 'link': 'platforms.html' },
		{ 'text': 'FAQs', 'link': 'faq.html' },
		{ 'text': 'Apply for an account', 'link': 'apply_for_an_account.php' },
		{ 'text': 'Contact us', 'link': 'contact.html' },
		{ 'text': 'Login', 'link': 'https://www2.saxowebtrader.com/' }
	],
	i,
	html = '<ul>',
	current;

	// Iterate through the links list
	for(i in links) {
		current = location.pathname && location.pathname == '/' + links[i].link ? ' class="current"' : '';
		html += '<li><a href="'+links[i].link+'"'+current+'>'+links[i].text+'</a></li>';
	}

	// Close the list
	html += '</ul>';

	// Append the HTML to the DOM
	document.getElementById('leftcol').innerHTML = html;
})();

