
var	Docref	=	window.location.href.toLowerCase();
var	Fref	=	1+Docref.indexOf("file:");
var	IE	=	(document.all	&&	!window.opera)	?	true	:	false;
var	IE7	=	(IE	&&	document.compatMode	&&	window.XMLHttpRequest)	?	true	:	false;
var	Farbe;

function	SetTitle()
{
	var	cnt,	ref,	res;

	try
	{	throw	(parent.document	==	document);	}
	catch(res)
	{
		if(res	==	true)
		{
			top.location.href	=	((Fref)
									?	'../../laudenklos/'
									:	'http://www.laudenklos.de/'
									)+document.getElementsByTagName('a')[0].href.replace(/^(.*?)bilder/, 'galerie').replace(/_\d{4}\.html/, '\.html');
			return;
		}
	}
	
	try
	{	throw	(parent.document	!=	document	&&	parent.GAL	>	0);	}
	catch(res)
	{
		if(res	==	true)
		{
			top.document.title	=	(document.getElementById('home'))
									?	document.title
									:	'Galerie '+parent.GAL+' Rundgang:  '+document.title;
		}
	}

	if(document.getElementById('year')	&&	(!IE	||	IE7))	document.getElementById('year').style.position	=	'fixed';
	
	if(document.getElementById('home'))
	{
		if(IE)
		{
			var	pics	=	new	Array();
			var	Farbe	=	(document.getElementsByTagName('body')[0].className	==	'black')	?	'#500080'	:	'#9999cc';

			pics		=	document.getElementsByTagName('img');

			for(cnt	=	0; cnt	<	pics.length;	cnt	++)
			{
				pics[cnt].style.borderColor	=	Farbe;
				pics[cnt].onmouseover		=	function()	{this.style.borderColor='#ff0000'};
				pics[cnt].onmouseout		=	function()	{this.style.borderColor=Farbe};
			}

			if(IE7)	document.getElementById('home').style.position	=	'fixed';
		}
		else
		{
			document.getElementById('home').style.position	=	'fixed';
		}
	}
	else
	{
		if(!Fref)
		{
			ref		=	(document.images && document.referrer && (document.referrer.length > 0))	?	escape(document.referrer)	:	'';
			cnt		=	new Image(1,1);
			cnt.src	=	'http://www.purpurhain.de/cgi-bin/counter.cgi?id=102&rl=0&ref='+ref+'&sh='+screen.height+'&sw='+screen.width+'&user='+document.title;
		}
	}

	if(document.getElementById('detail'))	document.getElementById('detail').style.display	=	'block';
	if(document.getElementById('info'))		document.getElementById('info').style.display	=	'block';

	SetFocus('a','div');	//,'img');
}

function	SetFocus()
{
	var	cnt,	ix;

	for(ix	=	0;	ix	<	SetFocus.arguments.length;	ix++)
	{
		var	lyrs	=	new	Array();

		lyrs	=	document.getElementsByTagName(SetFocus.arguments[ix]);
		for(cnt	=	0; cnt	<	lyrs.length;	cnt	++)
		{
			if(lyrs[cnt].onmouseover	!=	''	&&	lyrs[cnt].onmouseover	!=	null)	lyrs[cnt].onfocus	=	lyrs[cnt].onmouseover;
			if(lyrs[cnt].onmouseout		!=	''	&&	lyrs[cnt].onmouseout	!=	null)	lyrs[cnt].onblur	=	lyrs[cnt].onmouseout;
		}
	}
}

var Tt	=	null;

function	ShowText(n)
{
	var	Lyr	=	document.getElementById('infotext');

	if(n)
	{
		Lyr.style.display	=	'none';
		clearTimeout(Tt);

//		Lyr.style.left	=	parseInt(((IE)	?	document.body.offsetWidth-Lyr.scrollWidth	:	window.innerWidth-Lyr.offsetWidth)/2);
//		Lyr.style.bottom	=	20	+	((IE)	?	document.body.scrollTop	:	window.scrollY);
		Lyr.style.display	=	'block';
	}
	else if(ShowText.arguments.length	==	2)
	{
		Tt	=	setTimeout("ShowText("+n+")",ShowText.arguments[1]);
	}
	else
	{
		Lyr.style.display	=	'none';
	}
}

function	KeepText()
{
	clearTimeout(Tt);
}

function	GoHome()
{
	top.location.href	=	(Fref)	?	'../../laudenklos/index.html'	:	'http://www.laudenklos.de/';
	return	false;
}

function	GoTo(gal,seite)
{
	top.location.href	=	((Fref)	?	'../../laudenklos/galerie'	:	'http://www.laudenklos.de/galerie')+gal+'.html#'+seite;
}

window.onload	=	SetTitle;