//Interne Anker
(function($){
	jQuery(document).ready(
		function hpoint(){
			jQuery('h2[id], h3[id]').each(function jumplink(){
				jQuery(this).addClass('haslink');
				jQuery(this).append(
					'&#160;<a class="hpoint noprint" href="#'+jQuery(this).attr("id")+'" title="Direkter Link auf diese Position">#</a>');
});});})(jQuery);
//Tooltips
(function($){
	this.xOffset=-10;this.yOffset=10;
	jQuery("span[title], #content [title]").unbind().hover(function(e){
		this.t=this.title;this.title='';this.top=(e.pageY + yOffset);
		this.left=(e.pageX + xOffset);
		jQuery('body').append('<div id="tooltip">' + this.t + '</div>');
		jQuery('#tooltip').css("top", this.top+"px").css("left", this.left+"px").fadeIn('fast');
	},
	function(){
		this.title=this.t;jQuery("#tooltip").fadeOut('fast').remove();
	}).mousemove(function(e){
		this.top=(e.pageY + yOffset);this.left=(e.pageX + xOffset);
		jQuery("#tooltip").css("top", this.top+"px").css("left", this.left+"px");
});})(jQuery);
// Replybuttons
(function($){jQuery('.commentlist li[id]').each(function(){
	jQuery('.clear', this).before(
		'<button class="reply" onclick="replyToComment(\''
		+ jQuery(this).attr("id") + '\', \''
		+ jQuery('cite', this).text() + '\')">Antworten</button>'
);});})(jQuery);
// Mitwachsende Textarea
(function(a){a.fn.elastic=function(){var b=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-indent","text-transform","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-bottom-width",];
return this.each(function(){var i=a(this);switch(this.nodeName){
case"textarea":case"TEXTAREA":var j=parseInt(i.css("max-height"),10),f=parseInt(i.css("border-left-width"),10)+parseInt(i.css("border-right-width"),10),d={minHeight:i.height(),maxHeight:j>0?j:a(window).height(),width:a.browser.msie?i.width():i.width()-f},g="white-space:pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;_white-space:pre;display:none",e=function(){c.text(i.val()+"\n ");if(i.height()!=c.height()){if(c.height()==d.maxHeight){i.css({height:c.height(),overflow:"auto"})}else{i.css({height:c.height(),overflow:"hidden"})}}};i.css({resize:"none",overflow:"hidden"});break;case"input":case"INPUT":var h=i.attr("type");if(h!="text"&&h!="password"&&h!="undefined"){return true}
var k=parseInt(i.css("max-width"),10),d={minWidth:i.width(),maxWidth:k>0?k:(i.parent().width()-i.position().left-i.outerWidth()+i.innerWidth())},g="display:none",e=function(){c.text(i.val()+"W ");
if(i.width()!=c.width()){i.width(c.width())}};
break;default:return true}
var c=a('<pre style="'+g+'" />').appendTo("body");a.each(b,function(){c.css(this.toString(),i.css(this.toString()))});a.each(d,function(l,m){c.css(l,m)});i.bind("keypress keyup input",function(){e()});e()})}})(jQuery);
jQuery('#comment,#msg').elastic();
