var tabHolder, tabLinks;
function initTabs() {
	tabHolder = document.getElementById('tabs');
	if (tabHolder) {
		tabLinks = tabHolder.getElementsByTagName('a');
		for (i=0;i<tabLinks.length;i++) {
			if (tabLinks[i].className == 'hi') {
				document.getElementById(tabLinks[i].getAttribute('value')).style.display = 'block';
			}
			tabLinks[i].onclick = function() {
				closeAllTabs();
				document.getElementById(this.getAttribute('value')).style.display = 'block';
				this.className = 'hi';
				this.parentNode.style.borderBottomColor = '#ffffff';
				
				if (this.getAttribute('value') == 'location') loadMapLarge();
				if (this.getAttribute('value') == 'overzicht') loadMapSmall();
				if (this.getAttribute('value') == 'photo') initGalleryScript();
				return false;
			}
		}
	}
}

function openTab(val) {
	closeAllTabs();
	for (i=0;i<tabLinks.length;i++) {
		if (tabLinks[i].getAttribute('value') == val) {
			tabLinks[i].className = 'hi';
			tabLinks[i].parentNode.style.borderBottomColor = '#ffffff';
		}
	}
	document.getElementById(val).style.display = 'block';
	return false;
}

function closeAllTabs() {
	for (j=0;j<tabLinks.length;j++) {
		document.getElementById(tabLinks[j].getAttribute('value')).style.display = 'none';
		tabLinks[j].className = '';
		tabLinks[j].parentNode.style.borderBottomColor = '#eeeeee';
	}
}
