

function setSpos() 
{ 

	thename=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	thename=thename.substring(0,thename.lastIndexOf("."));
	thex=parseInt(thename.substring(4,7),10);
	they=parseInt(thename.substring(0,3),10);
	newx=0;
	newy=0;
	if ((thename.lastIndexOf("_")!=-1) &&((thex!=0) && (they!=0)))
		{
		newx=xpos-((thex-1)*slice_w);
		newy=ypos-((they-1)*slice_h);
		}
	else
	{	newx=0;
		newy=0;
	}
	var v=true;
	if (newx>=2*slice_w)
 		v=false
	if (newy>=2*slice_h) 
		v=false;
	if (newx<=0)
		v=false;
	if (newy<=0)
		v=false
	if (v==false)
	{	newx=100;
		newy=100;
		}
	if (IsIE()) 
	{  if (parent.main.document.all.fadenkreuz)
		{	parent.main.document.all.fadenkreuz.style.posLeft = newx; 
			parent.main.document.all.fadenkreuz.style.posTop = newy; 
			if ((thefadenkreuz) && (v))
				parent.main.document.all.fadenkreuz.style.visibility='visible';
			else
				parent.main.document.all.fadenkreuz.style.visibility='hidden';
				
		}
	}
	else 
	{	if (parent.main.document.fadenkreuz) 
		{	parent.main.document.fadenkreuz.left = newx; 
			parent.main.document.fadenkreuz.top = newy; 
			if (thefadenkreuz)
				parent.main.document.fadenkreuz.visibility = v;
			else
				parent.main.document.fadenkreuz.visibility = thefadenkreuz
		}
	} 
}

function setzefadenkreuz (the_x,the_y) {
	var bAgent = window.navigator.userAgent; 
	var bAppName = window.navigator.appName;
	thefadenkreuz=true;
	xpos=the_x;
	ypos=the_y;
	if (the_version>3)
		setSpos();
}

function hidefadenkreuz()
{
	thefadenkreuz=false;
	if (the_version>3)
		setSpos();
}

function showfadenkreuz()
{
	thefadenkreuz=true;
	if (the_version>3)
		setSpos();
}
function leadingzeros(thenum)
{
	beg="00";
	if (thenum>=10)  beg="0";
	if (thenum>=100)  beg="";
	return(beg+thenum);
}

function scrolle(deltax,deltay)
{	
	thisref=self.location.href.substring(0,self.location.href.lastIndexOf("/")+1);
	thename=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	if (thename.indexOf("overview")==-1)
		{	thename=thename.substring(0,thename.lastIndexOf("."));
			thex=parseInt(thename.substring(4,7),10);
			they=parseInt(thename.substring(0,3),10);
			if ((thex!=0) && (they!=0))
			{
				if (((thex+deltax)>=1) && ((thex+deltax)<=maximum_x) && ((they+deltay)>=1) && ((they+deltay)<=maximum_y))
				{
					newx=thex+deltax;
					newy=they+deltay;
					thename=thisref+"pages/"+leadingzeros(newy)+"_"+leadingzeros(newx)+".html";
					parent.main.location.href=thename;
				}
			}
		}

}

function showkarte(thename)
	
{	myname=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	if (myname!=thename)
		{
		thisref=self.location.href.substring(0,self.location.href.lastIndexOf("/")+1);
		parent.main.location.href=thisref+'pages/'+thename;
		}
}

function showurl(thename,thex,they)
{  
	showkarte(thename);
	setzefadenkreuz(thex,they);
}
function movefk(dx,dy)
{
	xpos=xpos+dx;
	ypos=ypos+dy;
	setSpos();
}

function showfkkoords()
{
	alert('Fadenkreuz bei x: '+xpos+' und y: '+ypos);
}

function showkoords()

{	
	thisref=self.location.href.substring(0,self.location.href.lastIndexOf("/")+1);
	thename=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	alert(thename);

}


function setzeposvonform()
{
	xpos=parseInt(document.xy.xx.value);
	ypos=parseInt(document.xy.yy.value);
	setSpos();
}

function zoom()
{
thisref=self.location.href.substring(0,self.location.href.lastIndexOf("/")+1);
	thename=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	if (thename.indexOf("_")!=-1)
		{	thename=thename.substring(0,thename.lastIndexOf("."));
			thex=parseInt(thename.substring(4,7),10);
			they=parseInt(thename.substring(0,3),10);
			if ((thex!=0) && (they!=0))
			{	
				if (thex>maximum_x-1) 
					{thex=maximum_x-1;}
				if (they>maximum_y-1)
					{they=maximum_y-1;}
				if (thex>1)
					{thex=thex-1;}
				if (they>1)		
					{they=they-1;}
		

					thename=thisref+"zoom/"+leadingzeros(they)+"_"+leadingzeros(thex)+".html";
					window.open(thename,"zoomwindow","height=500,width=630,toolbar=no,location=yes,menubar=yes,resizable=yes,scrollbars=yes, status=yes,titlebar=no")
				
			}
		}

}

function loadoverviewcheck()
{
	clearTimeout(loadoverviewtimer);
	thename=parent.main.location.href.substring(parent.main.location.href.lastIndexOf("/")+1);
	if (thename.indexOf("overview.html")!=-1)
		{parent.main.set_overview_pos();}
	else
		{loadoverviewtimer=setTimeout("loadoverviewcheck();",300);}

}
function loadoverview()
{	if (IsIE())
	{	loadoverviewtimer=setTimeout("loadoverviewcheck();",300);}
}
