/*------------------------------------------------------------
 Author: Dirk van Nüss
-------------------------------------------------------------- */ 

$(function () {
		// hide #back-top first
	$("#back-top").hide(function(){
	});
	$(".news:first").addClass('first');
	$("ul.tabs").tabs("div.panes > div.pan");
	x = $('.container').css('height');
	$('#aside_left').css('height', x);
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
			} else {
				$('#back-top').fadeOut();
			}
		});
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 1200);
			return false;
		});
		$(".facebook").hover(
				  function () {
				    $(this).addClass('hovi');
				  }, 
				  function () {
					  $(this).removeClass('hovi');
				  }
				);	
		$("#r14rechts a").hover(
				  function () {
				    var off = 491 * $(this).attr('class').split('icon')[1];
				    $("#r14").css({backgroundPosition: '0 -'+off+'px'});
				    $("#r14rechts a").removeClass('akt');
				    $(this).addClass('akt'); 
				  }, 
				  function () {
					
				  }
				);
		$("a.frontend-edit[rel]").overlay({
			top: '2%',
			fixed: true,
			mask: {
				color: '#000',
				loadSpeed: 500,
				opacity: 0.4
			},
			onClose: function() {
				$('#tiframe').attr('src','');
				 window.location.reload(true);
		  	},
			onBeforeLoad: function() {
			thref=$('.frontend-edit').attr('href');
			$('#tiframe').attr('src',thref);
		  },
			closeOnClick: true
		});
});
