<!--

function click (e) {
  if (!e)
    e = window.event;
  if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) {
    if (window.opera)
      window.alert("Sorry: Diese Funktion ist deaktiviert.");
    return false;
  }
}
if (document.layers)
  document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = click;
document.oncontextmenu = click;

function popup (url,width,height) {
 popup = window.open(url, 'WolfPopup', 'width=' + width + ',height=' + height + ',left=100,top=100,scrollbars=yes');
 popup.focus();
 return false;
}

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover(
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};

function getAnchorByURL() {
	var file = document.location.toString();
	if (!file.match('#')) return false;
	var anchor = file.split('#')[1];
	if(anchor == "") return false;
	return anchor;
}

function getAnchorFromURL() {
	var file = document.location.toString();
	if (!file.match('#')) return false;
	var theanchor = file.split('#')[1];
	if(theanchor == "") return false;
	return '#' + theanchor;
}

function selectNavElement(theanchor) {

	var activelink = $('a[href="' + theanchor + '"]');
	var showclass = theanchor.split('#')[1];

	$("#nav_filialen a:first").html(activelink.html());
	$("#nav_filialen a:first").attr('href', activelink.attr('href'));

	if (showclass != '') {
		$(".filiale").hide();
	    $("."+showclass).show();
	} else {
		$(".filiale").show();
	}
}

$(document).ready(function() {

	// init scrollable
	$("#browsable").scrollable().navigator().autoscroll({
		interval: 10000
	});
	
	// nav filialen - init hover
	$('#nav_filialen ul li').hoverClass('hover');
	$("#nav_filialen ul li ul li:last").addClass('last');

	// nav filialen - click handler
	$('#nav_filialen ul li ul li a').click(function(){
		selectNavElement($(this).attr('href'));
		$("#nav_filialen ul li").removeClass('hover');
	});

	// nav filialen - url anchor handler
	if (getAnchorFromURL()) selectNavElement(getAnchorFromURL());

});

-->
