﻿// JavaScript Document

// Author: Sebastian Friedrich (i. A. RUSKA, MARTIN, ASSOCIATES)
// Mail: friedrich@ruskamartin.de
// Web: http://ruskamartin.de

$(function(){
	// barrierefreie Popups für externe Links
	//$("a[href^='http://']").attr("onclick","window.open(this.href); return false;");
	$("a[href^='http://']").click(
		function(e) {
			e.preventDefault();
			window.open(this.href);
		});
	
	// sanftes scrollen zum Ankerpunkt statt Anspringen, ohne JS normale Funktion
	var SCROLLTIME = 500;
	
	$("a[href*=#]").click(
		function(e) {
			var targetID = $(this).attr("href");
			e.preventDefault();
			$('html,body').animate({
				scrollTop:  $(targetID).offset().top
			}, SCROLLTIME, function (){ location.hash = targetID; });
		});
});
