// '$' replaced with 'jQuery' - conflict / rating plugin anders@linkfactory.dk

//$(document).ready(function(){
		
		// remove empty authorfield
if ( jQuery('.writersb').text().length){
  jQuery('.news-single-item .news-single-author').show();
}else{
  jQuery('.news-single-item .news-single-author').hide();
}


		// Write indholdsfortegnelse
				
		if(jQuery(".tx-lfcontentindex-pi1")){

			// Attach an anchor to all headers in content-inner
			jQuery("#content-inner h2").each(function(i){
				
				var header = jQuery("#content-inner h2:eq("+i+")").text();
				
				if(header != 'Kolofon' && header != 'Yderligere informationer'){
					
			
				
				// Trim header string	
				header = header.replace(/^\s+|\s+$/g,"");
				header = header.replace(/ /g, "-");
				header = header.replace(/\//g, "");
				header = header.replace(/\?/g, "");
				header = header.replace(/,/g, "");
				
				jQuery("#content-inner h2:eq("+i+")").before('<a name="' + header + '"></a>');
				jQuery(".tx-lfcontentindex-pi1").append('<li><a href="'+location.pathname+'#' + header + '">' + jQuery("#content-inner h2:eq("+i+")").text().replace(/^\s+|\s+$/g,"") + '</a></li>');
				}
			});
			
			jQuery(".tx-lfcontentindex-pi1").wrapInner("<ul></ul>");
			jQuery(".tx-lfcontentindex-pi1").prepend("INDHOLD<br /><br />");
		}

