jQuery.fn.fadeToggle = function(speed, easing, callback) { 
   return this.animate({opacity: 'toggle'}, speed, easing, callback); 
}; 

jQuery.fn.toggleText = function(a, b) {
	return this.each(function() {
		jQuery(this).text(jQuery(this).text() == a ? b : a);
	});
};

$(document).ready(function() {



 /*slideshow caption hover*/

$('#largeImageCaption').hide();
  $('#imagecontainer').hover(function() {
 	//$('#largeImageCaption').slideDown('fast');
	$('#largeImageCaption').fadeIn('fast');
  }, function() {
 
  //$('#largeImageCaption').slideUp('fast');
  $('#largeImageCaption').fadeOut('fast');
  
});


$('#newsbutton').toggle(

               function(){ // you can add as much here as you'd like

                    $("#newscontent").fadeToggle();

                    $('#newsimage').attr('src','fileadmin/images/button_hide.png');

               }, function() { // same here

                    $("#newscontent").fadeToggle();

                    $('#newsimage').attr('src','fileadmin/images/button_news.png');

               });
               
        
$("#newsheader").click(function () { 

                 $('#newscontent').slideToggle('fast');
                 $('#newsbackground').fadeToggle('fast');
                 $("#openclose").toggleText('+','-');
                
        }); 
        
        
 //       alert(document.images[3].height);
$('#newscontent').height(document.images[3].height+5);
        

 	
});
