//Preload:
 var hover0 = new Image(); hover0.src = './gfx/blind4.gif';
 var hover1 = new Image(); hover1.src = './gfx/hover_impressum.jpg';
 var hover2 = new Image(); hover2.src = './gfx/hover_sitemap.jpg';

//Sitemap:
 var shown = false;

 function shiftMap()
 {
	document.getElementById('sitemap').className = (shown) ? '' : 'show';
	shown = !shown;
	return false;
 }

//Menu:
 var mems = 5;
 var last = -1;

 function setMenu (n, anchor)
 {
	if (shown) shiftMap();

	if (n == '' || isNaN(n)) n = 1;
	if (n < 0 || n > mems) n = 0;

	anchor = (anchor) ? '#' + anchor : '';

	if (n == last)
	{
		self.location.hash = anchor;
		return false;
	}
	window.frames[0].location.href = './history.php?pg=' + n + anchor;

	return false;
 }

 function setHistory (n)
 {
	n = Number(n);
	if (!n && n != 0) return false;

	var init = (last < 0 || last > mems);

	if (!init) document.getElementById('content_' + last).className = "hide";
	document.getElementById('content_' + n).className = "show";

	if (last && !init) document.getElementById('m' + last).className = '';
	if (n) document.getElementById('m' + n).className = 'on';
	last = n;

	var anchor = self.frames[0].location.hash;
	if (anchor) self.location.hash = anchor;

	self.document.title = 'Ferienwohnung in Garding';
 }
 
//Guestbook:
 function setGuests (n)
 {
	document.getElementById('loadGuests').style.display = 'block';
	window.frames[0].location.href = './page.php?g=' + n;
	
	return false;
 }
