// *********************** SHOW/HIDE ELEMENTS **********************************

// toggle show/hide element
function show_hide(id, show) {
	if (el = document.getElementById(id)) {
		if (null==show) show = el.style.display=='none';
		el.style.display = (show ? '' : 'none');
	}
}

// below, buttons to show/hide elements must have the same id as the element extended by "_show" or "_hide",
// or by "_alt" for an alternative element that must be shown only if the element itself is hidden.

// show element + xtra element, show link to hide elements, hide link to show elements
function show(id) {
	show0(id);
	show0(id+'_hide');
	hide0(id+'_show');
	show0(id+'_xtra');
}
// hide element + xtra element, hide link(s) to hide elements, show link(s) to show elements
function hide(id) {
	hide0(id);
	hide0(id+'_hide');
	show0(id+'_show');
	hide0(id+'_xtra');
}
// hide element
function hide0(id) {
	if (el = document.getElementById(id)) el.style.display = 'none';
}
// show element
function show0(id) {
	if (el = document.getElementById(id)) el.style.display = '';
}
// hide link depending on window name for city files
function citytoplink(citywindowname) {
	if ( window.name == 'gmap' ) document.getElementsByTagName('link')[0].setAttribute('href','../style/gmap.css');
	else if ( window.name.substring(0,5) == 'blub_' ) hide0 ('homelink');
	else hide0 ('closewindowlink');
}

function pp(fileName) {
	popup = window.open('cities/'+fileName+'.html','blub_'+fileName,'width=600,height=500,top=50,left=50,resizable=yes');
}