jQuery(function($) {
 setTimeout("jQuery(window).bind('scroll', function(){return fix_height()});", 600);
})

jQuery('#chat').click(function() {
jQuery('#form-box').hide();
jQuery('#pfc_container').toggle('slow', function() {
  setTimeout(fix_height, 250);
});
}); 


function fix_height() {
	content_height = jQuery("#content").height();
	sidebar_height = jQuery("#sidebar-inner").height();
	var max = content_height;
	if ( max < sidebar_height ){var max = sidebar_height+20}
	//alert (content_height);
	//jQuery("#sidebar").css("height", (jQuery("#content").height() /*+ jQuery("#content").offset().top + 0)*/ + "px");
	jQuery('#sidebar, #content, #shadow').css('min-height', max);
	sidebar_width = jQuery("#sidebar").width();
	jQuery('#shadow').css({'left': sidebar_width-23 + 'px'});
	//jQuery('#content').width(jQuery(window).width()-(sidebar_width-23);
	//alert(sidebar_width-23);
	jQuery(".ngg-gallery-thumbnail img").each(function() {
	content_width = jQuery('#content').width();	
	img_width = Math.round((content_width)/4.56);
	img_height =  Math.round((img_width)*0.75);
	single_large_height = 500;												   
	jQuery('.ngg-gallery-thumbnail img').css({'width': img_width + 'px','height' : img_height + 'px'});
    cb_height = jQuery("#sidebar").height();
	jQuery('.right_home').height(cb_height-100);
 							
});
}







jQuery(function() { 
jQuery('#mail-us1').replaceWith('<a title="Sie haben Fragen zum Thema MPU? Schreiben Sie uns!" class="mail-us" href="/kontakt">kontakt@proMPU.de</a>');
});


