// preload images for address switch
var imgaddressgu = new Image();
var imgaddressje = new Image();
var imgaddressald = new Image();
var addrs = new Array('addressgu', 'addressje', 'addressald');

imgaddressgu.src = "graphics/gue/lancaster.jpg";
imgaddressje.src = "graphics/jer/kingsgate.jpg";
imgaddressald.src = "graphics/ald/officeald.jpg";

function showMenu(source) {
	if (source != 'nomenu') {
		// show the menu
		document.getElementById(source).style.display='block';
	}
	var menus = new Array('wmenu', 'pimenu', 'bmenu', 'cmenu', 'fsmenu');
	for (i = 0; i < menus.length; i++) {
		// make sure all the other menus are closed
		if (menus[i] != source) {
			document.getElementById(menus[i]).style.display='none';
		}
	}
}


function showAddress(sourceA) {
	// show the address
	document.getElementById('s'+sourceA).style.display='inline';
	document.getElementById('l'+sourceA).style.color='red';
	// hide initial text
	//document.getElementById('selectaddress').style.display='none';
	// change photo
	document.getElementById('photobox').src= eval('img' + sourceA + '.src');
	document.getElementById('photobox').alt= 'Islands\' Insurance';
	document.getElementById('photobox').title= 'Islands\' Insurance';
	for (i = 0; i < addrs.length; i++) {
		// make sure all the other menus are closed
		if (addrs[i] != sourceA) {
			document.getElementById('s'+addrs[i]).style.display='none';
			document.getElementById('l'+addrs[i]).style.color='#666666';
		}
	}
}

function hideAddress() {
	for (i = 0; i < addrs.length; i++) {
		document.getElementById('s'+addrs[i]).style.display='none';
		document.getElementById('l'+addrs[i]).style.color='#666666';
	}
	// show initial text
	document.getElementById('selectaddress').style.display='block';
}

function openWin(pageURL) {
	window.open(pageURL, 'Map', 'width=610, height=400, toolbar=no');
}