// Content from www.Poertschach.net

var ns4up = (document.layers) ? 1 : 0;
var ns6up = (document.getElementById && !document.all && !window.opera) ? 1 : 0;
var ie4up = (document.all && !window.opera) ? 1 : 0;
var op5up = (document.getElementById && window.opera) ? 1 : 0;
//

// Rechtsklick gesperrt wegen Sonderfunktionen
function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
document.oncontextmenu=new Function("return false")
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
	  

// ORTSPLAN SCROLL UND MOVE SCRIPT
// Absolutes Copyright by www.Poertschach.net
<!--
function init(){
        var rahmen = 0;
		var klein = 0;
        if(document.getElementById){
		rahmen = document.getElementById("rahmen");
		klein = document.getElementById("klein");
		stern = document.getElementById("pin");
        obj = document.getElementById("plan");
        obj.style.left = "-830px";
        obj.style.top = "-286px";
        pinx=0; piny=0; sty=0; xstart = 0; ystart = 0; x=0; y=0; a=0; b=0; xziel=0; yziel=0; zeit=20; schritt=6;
		laufs=0; laufz=0; lauf=0; ls=0;	
		timer=null;
        var PreNr = 0;
		link="<img id='stern' src=\'./stinfo/pin1b.gif\' >";
        document.getElementById('rahmen').style.visibility="hidden";
        document.getElementById('klein').style.visibility="hidden";
        document.getElementById('pin').style.visibility="hidden";
        document.getElementById('laden').style.visibility="hidden";
		var dragapproved=false
        swx=0; swy=0;
        }
}

// Aufruf durch Klick auf Location
// Plateil - Location Position zeigen , Infobild und Text anzeigen , st.php Counter aufrufen
function posi(planteil,a,b,bildname,bildtext) {

y_name=bildname;
picnam = bildname;

// START
// Javascript AJAX HTTP REQUEST Counter in st.php aufrufen	
var http = null;
if (window.XMLHttpRequest) {
   http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
   http = new ActiveXObject("Microsoft.XMLHTTP");
}
if (http != null) {
   http.open("POST", "st.php?id="+bildname , true);
   http.send(null);
}
// ENDE

// START
// Infobild und Text anzeigen

check(bildname); // Check in array ob Info-Bild vorhanden

if(noinfo==1) // Info-Bild und Zusatzinfo nicht vorhanden - Hinweisbild für 4sec ausgeben
	{
bildname = "stinfo/000.gif";
l='<img name="picpic" src="'+bildname+'" border=0 onload="zeige_pic();" style="filter:Alpha(opacity=100, finishopacity=100, style=0)">'
	setTimeout("hide_pic()", 4000);
	}
	else
	{
// Info-Bild und Zusatzinfo ausgeben
bildname = "stinfo/" +bildname+".jpg";
l='<center><table width=405 height=235 style="border:2px solid #000;background-color:#e0e0e0;"><tr><td style="background-color:#f0f0f0;"><center><img name="picpic" vspace="2" src="'+bildname+'" border=1 onload="zeige_pic()" onmousedown="hide_pic()" style="filter:Alpha(opacity=100, finishopacity=100, style=0)"><br><b>'+bildtext+'</b><br><br></td></tr></table></center>'
	}

 if (ie4up) {
  if (document.all.bild.style.visibility=="visible") {hide_pic_schnell();}
  bild.innerHTML=l;
 }
 if (ns6up) {
  if (document.getElementById("bild").style.visibility=="visible") {hide_pic_schnell();}
  document.getElementById("bild").innerHTML=l;
 }
 if (op5up) {
  if (document.getElementById("bild").style.visibility=="visible") {hide_pic_schnell();}
  document.getElementById("bild").innerHTML=l;
 }
 // ENDE

		planzu();

// START
// Plan bewegen und Pin anzeigen

		if (planteil==0) // Mitte Center (default-start)
		{ x= -830; y= -286; }
		if (planteil==1) // Mitte oben
		{ x= -827; y= -101; }
		if (planteil==2) // Mitte unten
		{ x= -834; y= -401; }
		if (planteil==3) // Mitte sued
		{ x= -840; y= -601; }
		if (planteil==4) // West unten
		{ x= -502; y= -361; }
		if (planteil==5) // West oben
		{ x= -503; y= -201; }
		if (planteil==6) // Ost unten
		{ x= -1392; y= -421; }
		if (planteil==7) // Ost mitte
		{ x= -1394; y= -201; }
		if (planteil==8) // Ost oben
		{ x= -1402; y= -11; }
		if (planteil==9) // Sallach oben
		{ x= -2052; y= -86; }
		if (planteil==10) // Sallach Hstr
		{ x= -2056; y= -486; }
		if (planteil==11) // Sallach Hstr oben
		{ x= -1555; y= -215; }
		if (planteil==12) // Sallach unten
		{ x= -2054; y= -700; }
		if (planteil==13) // Toeschling 1
		{ x= -10; y= -580; }
		if (planteil==14) // Töeschling 2
		{ x= -80; y= -490; }
		if (planteil==15) // Kapuziner Insel
		{ x= -832; y= -795; }
		if (planteil==16) // Wallerwirt
		{ x= -5; y= -650; }
		if (planteil==17) // Buddhatempel Sonderposition
		{ x= -2058; y= -4; }
		if (planteil==18) // Mitte StMartin
		{ x= -200; y= -4; }
		if (planteil==19) // Toeschling 3
		{ x= -10; y= -460; }
		if (planteil==20) // Adler Sonderposition
		{ x= -600; y= -10; }

        if (document.getElementById) {
        document.getElementById('null').style.left = x; xziel=x;
        document.getElementById('null').style.top = y; yziel=y;
		document.getElementById('null').style.left = a; pinx=a;
        document.getElementById('null').style.top = b; piny=b;
		xstart = parseInt(document.getElementById('plan').style.left);
        ystart = parseInt(document.getElementById('plan').style.top);
		xschalter=0; yschalter=0; a=0; b=0;
ls=xstart; laufs=Math.abs(ls);
ls=xziel; laufz=Math.abs(ls);
ls=0; lauf = ( laufz - laufs );

if(xstart < xziel) {xschalter=1;  lauf = ( laufs - laufz );}
if(ystart < yziel) {yschalter=1; }
bewegung();
}
}
// ENDE

// START
function verzögern(){
		if(lauf > 1000) { schritt=20;}
		if(lauf < 800) { schritt=18;}
		if(lauf < 700) { schritt=16;}
		if(lauf < 600) { schritt=10;}
		if(lauf < 400) { schritt=8;}
		if(lauf < 200) { schritt=6;}
		if(ls < 40) { schritt=14;}
		if(ls < 30) { schritt=10;}
		if(ls < 20) { schritt=8;}
		if(ls < 10) { schritt=6;}
}

function bewegung(){
document.getElementById('pin').style.visibility="hidden";
document.getElementById('lineh').style.visibility="hidden";
document.getElementById('linev').style.visibility="hidden";

if(xschalter == 1)
{if(xstart < xziel)
{
obj.style.left = xstart; xstart=xstart+schritt; lauf=lauf-schritt; ls=ls+1;
}
else { a=1; obj.style.left=xziel;
}
}

if(xschalter == 0)
{if(xziel < xstart)
{
obj.style.left = xstart; xstart=xstart-schritt; lauf=lauf-schritt; ls=ls+1;
}
else { a=1; obj.style.left=xziel;
}
}

if(yschalter == 1)
{if(ystart < yziel)
{obj.style.top = ystart; ystart=ystart+schritt;
}
else { b=1; obj.style.top=yziel;
}
}

if(yschalter == 0)
{if(yziel < ystart)
{obj.style.top = ystart; ystart=ystart-schritt;
}
else { b=1; obj.style.top=yziel;
}
}
verzögern();
timer=setTimeout("bewegung()",zeit);

if(a+b == 2) {
        document.getElementById('pin').style.visibility="visible";
        document.getElementById('lineh').style.visibility="visible";
        document.getElementById('linev').style.visibility="visible";
        document.getElementById('lineh').style.left = pinx-1000; document.getElementById('lineh').style.top = piny-98;
        document.getElementById('linev').style.left = pinx; document.getElementById('linev').style.top = piny-500;
		a=0; b=0; stern.style.left = pinx-3; stern.style.top = piny-2;

        if(timer != null) { clearTimeout(timer); timer=null; }
		schritt=6;
return;
		}
}


function hidebox(){
if (document.all)
plan.style.visibility="hidden"
else if (document.layers)
document.plan.visibility="hide"
}



// Übersichts Plan mit Positions Rahmen anzeigen
function planauf(){
        document.getElementById('klein').style.visibility="visible";
klein.style.left=7;
klein.style.top=104;
ramx=0; ramy=0;
planx = plan.style.pixelLeft;
 if (planx == -830) {ramx=300; ramy=170;}
 else if (planx == -330) {ramx=300; ramy=255;}
else if (planx == -827) {ramx=300; ramy=104;}
else if (planx == -834) {ramx=300; ramy=210;}
else if (planx == -840) {ramx=300; ramy=255;}
else if (planx == -832) {ramx=300; ramy=289;}
else if (planx == -503) {ramx=230; ramy=104;}
else if (planx == -502) {ramx=230; ramy=190;}
else if (planx == -1402) {ramx=460; ramy=104;}
else if (planx == -1394) {ramx=460; ramy=110;}
else if (planx == -1392) {ramx=460; ramy=210;}
else if (planx == -2052) {ramx=613; ramy=120;}
else if (planx == -1555) {ramx=625; ramy=170;}
else if (planx == -2056) {ramx=613; ramy=220;}
else if (planx == -1557) {ramx=625; ramy=255;}
else if (planx == -10) {ramx=124; ramy=245;}
else if (planx == -5) {ramx=124; ramy=260;}
else if (planx == -80) {ramx=140; ramy=210;}
if (ramx == 0) {ramx= -500}
document.getElementById('rahmen').style.visibility="visible";
rahmen.style.left = ramx;
rahmen.style.top = ramy;
}

function planzu(){
        document.getElementById('klein').style.visibility="hidden";
        document.getElementById('rahmen').style.visibility="hidden";
		ramx=0; ramy=0;
}
// ENDE

// START 
// Folgende Unterfunktionen gehoeren zu Infobild und Text anzeigen
function zeige_pic() {
 if (ie4up || ns6up || op5up) {
  breite=document.picpic.width;
  hoehe=document.picpic.height;
 }


 posx=(document.body.clientWidth / 2) +80;

 posy=430;

// Sonderposition Infobild bei Überlänge
 if (y_name == "015") { posy=240; }
 if (y_name == "006") { posy=240; }
 if (y_name == "059") { posy=240; }

 if (posx<0) {posx=0;}
 if (posy<0) {posy=0;}
 if (ie4up) {
  document.getElementById("bild").style.pixelTop = posy+document.body.scrollTop;
  document.getElementById("bild").style.pixelLeft = posx+document.body.scrollLeft;
  document.getElementById("bild").filters.blendTrans.Apply();
  document.getElementById("bild").style.visibility = "visible";
  document.getElementById("bild").filters.blendTrans.Play();
 }
 if (ns6up) {
  document.getElementById("bild").style.top = posy;
  document.getElementById("bild").style.left = posx;
  document.getElementById("bild").style.width = 404;
  document.getElementById("bild").style.visibility = "visible";
 }
 if (op5up) {
  document.getElementById("bild").style.pixelTop = posy;
  document.getElementById("bild").style.pixelLeft = posx;
  document.getElementById("bild").style.visibility = "visible";
  document.getElementById("bild").style.width = 408;
 }
}

function hide_pic() {
 if (ie4up) {
  document.getElementById("bild").filters.blendTrans.Apply();
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").filters.blendTrans.Play();
 }
 if (ns6up) {
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").style.top = 0;
  document.getElementById("bild").style.left = 0;
 }
 if (op5up) {
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").style.pixelTop = posy;
  document.getElementById("bild").style.pixelLeft = posx;
 }
}

function hide_pic_schnell() {
 if (ie4up) {
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").style.pixelTop = 0;
  document.getElementById("bild").style.pixelLeft = 0;
 }
 if (ns6up) {
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").style.top = 0;
  document.getElementById("bild").style.left = 0;
 }
 if (op5up) {
  document.getElementById("bild").style.visibility = "hidden";
  document.getElementById("bild").style.pixelTop = posy;
  document.getElementById("bild").style.pixelLeft = posx;
 }
}

function closepic()
{
hide_pic();
}


// Prüfen ob Bildname im Array vorkommt
function check(bildname)
{
bn = new Array('007','017','018','019','027','037','039','041','048','049','053','063','067','068','073','090','091','093','095','100','103','104','108','127','136','217','230','251','284','288','296'); 
noinfo=0;
 
wort=bildname; 
for (var i=0;i<bn.length;i++)
{ 
if(wort==bn[i])
{ 
noinfo=1; 
break; 
} 
}
}

// Drag & Drop PLAN

var ie=document.all;
var nn6=document.getElementById&&!document.all;

var isdrag=false;
var x,y;
var dobj;

function movemouse(e)
{
  if (isdrag)
  {
    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
	if(dobj.offsetLeft >= -10) { dobj.style.left= -25; }
	if(dobj.offsetLeft <= -2055) { dobj.style.left= -2040; }
    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
	if(dobj.offsetTop >= -10) { dobj.style.top= -25; }
if(dobj.offsetTop <= -790) { dobj.style.top= -775; }
    return false;
  }
}

function selectmouse(e) 
{
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";

  while (fobj.tagName != topelement && fobj.className != "dragme")
  {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="dragme")
  {
document.getElementById('pin').style.visibility="hidden";
document.getElementById('lineh').style.visibility="hidden";
document.getElementById('linev').style.visibility="hidden";
    isdrag = true;
    dobj = fobj;
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

document.onmousedown=selectmouse;
document.onmouseup=new Function("isdrag=false");

// ENDE
//-->
