    var cross_center_offset = 3;
    var photo_offset_x = 50;
    var photo_offset_y = 120;

    actpoint = 0;
    acttimeout = null;
    
    var status_legend = false;
    var status_marker = false;
    var status_all    = false;

    function showCoordLayer(nr, xpos, ypos) {
      if (!status_all) {
        document.getElementById("coordlayer"+nr).style.visibility = 'visible';
      }

      document.getElementById("coordlayerdot").style.left = (parseInt(document.getElementById("coordlayer"+nr).style.left) - 1);
      document.getElementById("coordlayerdot").style.top  = (parseInt(document.getElementById("coordlayer"+nr).style.top) + 50 - 1);
      document.getElementById("coordlayerdot").style.visibility = 'visible';

    }
    
    function hideCoordLayer(nr) {
      document.getElementById("coordlayer"+nr).style.visibility = 'hidden';
      document.getElementById("coordlayerdot").style.visibility = 'hidden';
    }


    function hideAll() {
      document.getElementById("coordlayerdot").style.visibility = 'hidden';

      nr = 0;
      while (document.getElementById("coordlayer"+nr)) {
        document.getElementById("coordlayer"+nr).style.visibility = 'hidden';
        nr++;
      }
    }


    function toggleWindrose() {
      if ($('#windrose').css('display') == 'block') {
        $('#windrose').hide();
        $('#windrose_on').hide();
        $('#windrose_off').show();
      } else {
        $('#windrose').show();
        $('#windrose_on').show();
        $('#windrose_off').hide();
      }

    }


    function toggleMarker() {
      hideAll();

      if (!status_all) {
        if (!status_marker) {
          status_marker = true;
          //document.getElementById("img_marker").src = "img/bt_marker_ein.gif";
          document.getElementById("marker_on").style.display = 'block';
          document.getElementById("marker_off").style.display = 'none';
          document.getElementById("marker").style.visibility = 'visible';
          if (status_legend) {
            document.getElementById("numbers").style.visibility = 'visible';
          }
        } else {
          status_marker = false;
          //document.getElementById("img_marker").src = "img/bt_marker.gif";
          document.getElementById("marker_on").style.display = 'none';
          document.getElementById("marker_off").style.display = 'block';
          document.getElementById("marker").style.visibility = 'hidden';
          document.getElementById("numbers").style.visibility = 'hidden';
        }
      }
    }


    function toggleLatest() {
    
      if (document.getElementById("neueste").style.display == 'block') {
        document.getElementById("neueste").style.display = 'none';
        document.getElementById("beliebteste").style.display = 'block';
        document.getElementById("all").style.display = 'none';
        document.getElementById("allrating").style.display = 'block';
      } else {
        document.getElementById("neueste").style.display = 'block';
        document.getElementById("beliebteste").style.display = 'none';
        document.getElementById("all").style.display = 'block';
        document.getElementById("allrating").style.display = 'none';
      }
    }


    function toggleLatest2() {
    
      if ($('#neueste').css('display') == 'block') {
        $('#neueste').hide();
        $('#beliebteste').show();
        $('#linknew').show();
        $('#spannew').hide();
        $('#linktop').hide();
        $('#spantop').show();
      } else {
        $('#neueste').show();
        $('#beliebteste').hide();
        $('#linknew').hide();
        $('#spannew').show();
        $('#linktop').show();
        $('#spantop').hide();
      }
    }


    function toggleSat() {
    
      if (document.getElementById("schnellstart").style.display == 'block') {
        document.getElementById("schnellstart").style.display = 'none';
        document.getElementById("satkarte").style.display = 'block';
      } else {
        document.getElementById("schnellstart").style.display = 'block';
        document.getElementById("satkarte").style.display = 'none';
      }
    }


    function toggleComments(i) {
    
      if (document.getElementById("comments_" + i).style.display == 'block') {
        document.getElementById("comments_" + i).style.display = 'none';
      } else {
        document.getElementById("comments_" + i).style.display = 'block';
      }
    }


    function toggleRatings() {
    
      if (document.getElementById("ratings").style.display == 'block') {
        document.getElementById("ratings").style.display = 'none';
      } else {
        document.getElementById("ratings").style.display = 'block';
      }
    }


    function doSubmitWatchlist() {
      if (document.getElementById("watchlist").style.display == 'block') {
        document.form1.wl.value = 1;
      }
      document.form1.submit();
    }

    function doSubmitWatchlist2() {
      if (document.getElementById("watchlist") && (document.getElementById("watchlist").style.display == 'block')) {
        document.form1.wl.value = 3;
      }
      if (document.getElementById("newcomments") && (document.getElementById("newcomments").style.display == 'block')) {
        document.form1.wl.value = 1;
      }
      if (document.getElementById("allcomments").style.display == 'block') {
        document.form1.wl.value = 2;
      }
      document.form1.submit();
    }

    function toggleWatchlist() {
    
      if (document.getElementById("newcomments").style.display == 'block') {
        document.getElementById("newcomments").style.display = 'none';
        document.getElementById("watchlist").style.display = 'block';
      } else {
        document.getElementById("newcomments").style.display = 'block';
        document.getElementById("watchlist").style.display = 'none';
      }
    }


    function toggleWatchlist2(type) {
    
      if (type == 'my') {
        document.getElementById("newcomments").style.display = 'block';
        document.getElementById("allcomments").style.display = 'none';
        document.getElementById("watchlist").style.display   = 'none';

      } else if (type == 'all') {
        document.getElementById("newcomments").style.display = 'none';
        document.getElementById("allcomments").style.display = 'block';
        document.getElementById("watchlist").style.display   = 'none';

      } else {
        document.getElementById("newcomments").style.display = 'none';
        document.getElementById("allcomments").style.display = 'none';
        document.getElementById("watchlist").style.display   = 'block';
      
      }

    }


    var commentstate = 'none';
    
    function toggleAllComments(max) {
    
      if (commentstate == 'none') {
        commentstate = 'block';
      } else {
        commentstate = 'none';
      }
      
      for (i=0; i<max; i++) {
        if (document.getElementById("comments_" + i) != undefined) {
          document.getElementById("comments_" + i).style.display = commentstate;
        }
      }
    }


    function showCoordInput() {
    
      var actcoordtype = document.calculator.coordtype[document.calculator.coordtype.selectedIndex].value;
    
      document.getElementById("geo").style.display = 'none';
      document.getElementById("aus").style.display = 'none';    
      document.getElementById("slk").style.display = 'none';    
      document.getElementById("utm").style.display = 'none';    
      
      document.getElementById(actcoordtype).style.display = 'block';
      
    }

    function transferCoord() {
    
      opener.document.panorama.laenge.value = document.calculator.outxgeo.value;
      opener.document.panorama.breite.value = document.calculator.outygeo.value;
      self.close();

    }


    function toggleSummits() {
      hideAll();

      if (!status_legend) {
        status_legend = true;
        //document.getElementById("img_details").src = "img/bt_detailslegende_leg.gif";
        document.getElementById("caption_on").style.display = 'block';
        document.getElementById("caption_off").style.display = 'none';
        document.getElementById("coords").style.visibility = 'visible';
        document.getElementById("description2").style.visibility = 'hidden';
        document.getElementById("rightcolumn").style.visibility = 'hidden';
        if (status_marker && !status_all) {
          document.getElementById("numbers").style.visibility = 'visible';
        }
      } else {
        status_legend = false;
        //document.getElementById("img_details").src = "img/bt_detailslegende.gif";
        document.getElementById("caption_on").style.display = 'none';
        document.getElementById("caption_off").style.display = 'block';
        document.getElementById("coords").style.visibility = 'hidden';
        document.getElementById("description2").style.visibility = 'visible';
        document.getElementById("rightcolumn").style.visibility = 'visible';
        document.getElementById("numbers").style.visibility = 'hidden';
      }
    }


    function toggleAll() {
      hideAll();

      if (!status_all) {
        status_all = true;
        //document.getElementById("img_all").src = "img/bt_uebersicht_ein.gif";
        document.getElementById("overview_on").style.display = 'block';
        document.getElementById("overview_off").style.display = 'none';
        //document.getElementById("img_marker").src = "img/bt_marker.gif";
        document.getElementById("marker_on").style.display = 'block';
        document.getElementById("marker_off").style.display = 'none';

        document.getElementById("markerall").style.visibility = 'visible';
        document.getElementById("numbers").style.visibility = 'hidden';
        document.getElementById("marker").style.visibility = 'hidden';
      } else {
        status_all = false;
        //document.getElementById("img_all").src = "img/bt_uebersicht.gif";
        document.getElementById("overview_on").style.display = 'none';
        document.getElementById("overview_off").style.display = 'block';
        document.getElementById("markerall").style.visibility = 'hidden';
        if (status_marker) {
          document.getElementById("marker").style.visibility = 'visible';
          //document.getElementById("img_marker").src = "img/bt_marker_ein.gif";
          document.getElementById("marker_on").style.display = 'none';
          document.getElementById("marker_off").style.display = 'block';
          if (status_legend) {
            document.getElementById("numbers").style.visibility = 'visible';
          }
        }
      }
    }







    function doSubmitGebiet() {
      if (document.panorama.gebiet.value != -1) {
      	document.panorama.gid.value = document.panorama.gebiet.value;
      	document.panorama.submit();
      }
    }
  
  
    function doSubmitPerson() {
      if (document.panorama.person.value != -1) {
        document.panorama.ak_pid.value = document.panorama.person.value;
        document.panorama.submit();
      }
    }
  
    function confirmDeleteComment(text, link) {
      if (confirm(text)) {
        document.location.href=link;
      }
    }  

  
    function startShow() {
      waitandshow();

      document.getElementById("ct_play").style.visibility = 'hidden';
      document.getElementById("ct_pause").style.visibility = 'visible';
    }
    
    function pauseShow() {
      actpoint--;
      window.clearTimeout(acttimeout);
      
      document.getElementById("ct_play").style.visibility = 'visible';
      document.getElementById("ct_pause").style.visibility = 'hidden';
    }
    
    function stopShow() {
      window.clearTimeout(acttimeout);
      hideAll();
      actpoint = 0;

      document.getElementById("ct_play").style.visibility = 'visible';
      document.getElementById("ct_pause").style.visibility = 'hidden';
    }
    
    
    function next() {
    
      hideAll();

      actpoint++;
      if (!document.getElementById("coordlayer"+actpoint)) {
        actpoint--;
      }
      scrollWindow(actpoint);
      showCoordLayer(actpoint, 0, 0);

    }
    
    function prev() {
    
      hideAll();

      actpoint--;
      if (!document.getElementById("coordlayer"+actpoint)) {
        actpoint=0;
      }
      scrollWindow(actpoint);
      showCoordLayer(actpoint, 0, 0);

    }
    
    function first() {
    
      hideAll();
      actpoint = 0;   
      scrollWindow(actpoint);
      showCoordLayer(actpoint, 0, 0);

    }
    
    function last() {

      hideAll();

      actpoint = 0;
      while (document.getElementById("coordlayer"+actpoint)) {
      	actpoint++;
      }
      actpoint--;
      scrollWindow(actpoint);
      showCoordLayer(actpoint, 0, 0);

    }
    
    function waitandshow() {
    
      hideAll();
      scrollWindow(actpoint);
      showCoordLayer(actpoint, 0, 0);

      actpoint++;
      if (!document.getElementById("coordlayer"+actpoint)) {
        actpoint = 0;
      }

      funcname = "waitandshow(" + actpoint + ")";
      acttimeout = window.setTimeout(funcname, 2000);
    }
    
    
    function scrollWindow(actpoint) {
    
      if (window.innerWidth) {
        // Mozilla
	windowwidth = window.innerWidth;     

        if (actpoint == 0) {
          window.scrollTo(0,0);

        } else if (parseInt(document.getElementById("coordlayer"+actpoint).style.left) > (parseInt(windowwidth) + parseInt(window.pageXOffset)-20)) {
          while (parseInt(document.getElementById("coordlayer"+actpoint).style.left) > (parseInt(windowwidth) + parseInt(window.pageXOffset)-20)) {
            window.scrollBy(parseInt(windowwidth) - 100, 0);
          }

        } else if (parseInt(document.getElementById("coordlayer"+actpoint).style.left) < (parseInt(window.pageXOffset))) {
          while (parseInt(document.getElementById("coordlayer"+actpoint).style.left) < (parseInt(window.pageXOffset))) {
            window.scrollBy(-1*(parseInt(windowwidth) - 100), 0);
          }

        }

      } else {
        // IE
        windowwidth = document.body.offsetWidth;
      
        if (actpoint == 0) {
          document.body.scrollLeft = 0;

        } else if (parseInt(document.getElementById("coordlayer"+actpoint).style.left) > (parseInt(windowwidth) + parseInt(document.body.scrollLeft))) {
          while (parseInt(document.getElementById("coordlayer"+actpoint).style.left) > (parseInt(windowwidth) + parseInt(document.body.scrollLeft))) {
            document.body.scrollLeft += (parseInt(windowwidth) - 100);
          }

        } else if (parseInt(document.getElementById("coordlayer"+actpoint).style.left) < (parseInt(document.body.scrollLeft))) {
          while (parseInt(document.getElementById("coordlayer"+actpoint).style.left) < (parseInt(document.body.scrollLeft))) {
            document.body.scrollLeft -= (parseInt(windowwidth) - 100);
          }

        }
      }
    
    }
    
    function mailtome() {
      location.href = "mailto:info@alpen-panoramen.de";
    }
    
    function deleteProfileImage() {
      document.profile.di.value = 'yes';
      document.profile.submit();
    }    