

     jQuery(document).ready(function(){
	 
	   		//jQuery("img.caption").wrap('<div class="imagewithcaption" />');
	   
			 jQuery('img.caption').each(function(i) {
		
			//grab the alt attribute from the current image.
			var caption = jQuery(this).attr('alt'); 
			
			//Grab the width of the image. I subtract 12 here because my caption style has 5px padding + 1px border on each side.
			var img_width = jQuery(this).width()-12;
			
			var div_width = jQuery(this).width();
			
			var img_float = jQuery(this).css('float');
			
			//Pop a p tag with class caption after the current img tag
			if(caption) {
				jQuery(this).wrap('<div class="imagewithcaption" style="width:'+div_width+'px;float:'+img_float+'" />');
			  jQuery(this).after("<div class='bu'>"+caption+"</div>"); 
			}
		 });

		jQuery(function() {
		  jQuery('.haus-klein .bild img').aeImageResize({ width: 160 });
		});
		
		jQuery(function() {
		  jQuery('.bildhdb img').aeImageResize({ width: 530 });
		});
		
		jQuery(function() {
		  jQuery('.slider a img').aeImageResize({ width: 100 });
		});
		
jQuery(function() {
  jQuery('.slider a img.ofen').aeImageResize({ width: 150 });
});

		jQuery(function() {
		  jQuery('.haus .bild img').aeImageResize({ width: 200 });
		});
		
		// ----- Carousel
			jQuery('#billy_scroller').billy({
				slidePause: 5000,
				// We need custom next/prev buttons for this example. If we used the defaults (#billy_next/#billy_prev), every carousel instance on the page would scroll when they're clicked...
				nextLink: jQuery('#carousel_billy_next'),
				prevLink: jQuery('#carousel_billy_prev')
			});
			
// ----- Carousel Top10
			jQuery('#top10_scroller').billy({
				slidePause: 5000,
				// We need custom next/prev buttons for this example. If we used the defaults (#billy_next/#billy_prev), every carousel instance on the page would scroll when they're clicked...
				nextLink: jQuery('#carousel_billy_next'),
				prevLink: jQuery('#carousel_billy_prev')
			});
			
			// Colorbox
			jQuery("a[rel='grundriss']").colorbox();
			jQuery("a[class='gross']").colorbox();
			jQuery("a[rel='gross']").colorbox({current:"Bild {current} von {total}"});
			jQuery("a[rel='gross2']").colorbox({width:"800px", height:"600px", iframe:true, current:"{current} von {total}"});
			jQuery("a[rel='info']").colorbox({width:"650px", height:"500px", iframe:true});
			jQuery("a[rel='info2']").colorbox({width:"650px", height:"500px", iframe:true});
			jQuery("a[rel='infohaus']").colorbox({width:"750px", height:"530px", iframe:true, current:"{current} von {total}"});
			jQuery("a[rel='video']").colorbox({width:"650px", height:"500px", iframe:true});
			jQuery("a[rel='video2']").colorbox({width:"650px", height:"500px", iframe:true});
			jQuery("a[rel='video-kl']").colorbox({width:"340px", height:"300px", iframe:true});
			jQuery("a[rel='dreid']").colorbox({width:"800px", height:"600px", iframe:true});
			jQuery("a[rel='newsletter']").colorbox({width:"650px", height:"630px", iframe:true});
			jQuery("a[rel='newsletter2']").colorbox({width:"650px", height:"630px", iframe:true});
			jQuery("a[rel='newsletter3']").colorbox({width:"650px", height:"630px", iframe:true});
			jQuery("a[rel='fullscreen']").colorbox({width:"95%", height:"95%", iframe:true});


			
		});

  
			
