jQuery.noConflict();

jQuery(document).ready(function() {
	if( jQuery('#ntibody-58').length > 0 ) {
		jQuery("#content .contenttable tr td, #content .htmlarea-showtableborders tr td").css("border-bottom", "solid 1px #ccc");
	} else {
		jQuery("#content .contenttable tr:even, #content .htmlarea-showtableborders tr:even").css("background-color", "#EFEBEF");
	}
	
	jQuery("#content a[href$='.pdf']").addClass("filelink_pdf");
	
	jQuery("#content .newsbilder img:eq(0)").css('border-width', '0px');
	
	jQuery('table.startseite').each(function() {
		var anz_spalten = jQuery( this ).find('td.startseite_td').length;
		var breite_spalten = 0;
		if( anz_spalten == 1 )
			breite_spalten = 100;
		else if( anz_spalten == 2 )
			breite_spalten = 49;
		else if( anz_spalten == 3 )
			breite_spalten = 32;
		else if( anz_spalten == 4 )
			breite_spalten = 24;
		
		if( anz_spalten == 1 )
			jQuery( this ).find('td:eq(1)').remove();
		
		jQuery( this ).find('td.startseite_td').css('width', breite_spalten+'%');
	});
	
	jQuery('table.startseite td.startseite_td:last').css('border-width', '0px');
	
	jQuery('div.csc-menu-4 div.csc-frame-frame1:nth-child(4)').after('<br style="clear:both;" />');
	jQuery('div.csc-menu-4 div.csc-frame-frame1:nth-child(4)').css('margin-right', '0px');
	
	if( jQuery('#content .csc-menu-4 .csc-frame-frame1').length > 0 ) {
		jQuery('#content .csc-menu-4 .csc-frame-frame1 > a').equalHeights();
		//jQuery('#content .csc-menu-4 .csc-frame-frame1 > a').css('font-size', '0.9em');
	}
	
	var centerheight = jQuery('#contentarea').height();
	var leftheight = jQuery('#sidebar').height();
	var leftpaddingtop = jQuery('#sidebar').css('margin-top');
	//if (jQuery.browser.msie) {
		var addpadding = 50;
	//} else {
	//	var addpadding = 100;
	//}
	if( leftheight < centerheight ) {
		//jQuery('#left').height( parseInt( centerheight )+parseInt( addpadding ) );
	}
	if( jQuery('#contentarea').height() < 380 ) {
		jQuery('#sidebar').height( 680 );
	} else {
		jQuery('#sidebar').height( parseInt( jQuery('#contentarea').height() + 200 ) );
	}
	
	/*jQuery('.sprache img:last').css('cursor', 'pointer');*/
	jQuery('.sprache span:last a').css('cursor', 'default');
	jQuery('.sprache span:last a').live('click', function() {
		//window.open('http://www.google.de/');
		//alert('Hallo, ich bin ein Link und werde später extern verlinkt, hooray!');
		return false;
	});
});
