$(document).ready(function() {
   	init();
});

function set_image_size() {
	image_width = $(".postimage img").attr("width");
	image_height = $(".postimage img").attr("height");
	
	if (image_width > 180 || image_width == "") {
	    $(".postimage img").removeAttr("width");
	    $(".postimage img").removeAttr("height");
	    $(".postimage img").css("width", "180px");
	} else {
		$(".partnerprofile .postimage").css("width", image_width);
	}
}

function run_image_func() {
	var t = setTimeout("set_image_size()",100)
}

function init() {
	
	/* Set size of partner image
	___________________________________________________*/
	
	if ($(".postimage img")) {
		run_image_func();
	}
		
	
	/* Set image size in pusher
	___________________________________________________*/
	
	if ($(".dynColLayout-2 img")) {
	
		$(".dynColLayout-2 img").addClass("bild");
		
		image_width = $(".dynColLayout-2 img").attr("width");
		image_height = $(".dynColLayout-2 img").attr("height");
		
		if (image_width >= 238) {
			$(".dynColLayout-2 img").attr({ 
          		width: 238
          	});          	
        } 
        
        $(".dynColLayout-2 img").removeAttr("height");
	}
	
	if ($(".dynColLayout-3 img")) {	
		$(".dynColLayout-3 img").addClass("bild");
		
		image_width = $(".dynColLayout-3 img").attr("width");
		image_height = $(".dynColLayout-3 img").attr("height");
		
		if (image_width >= 238) {
			$(".dynColLayout-3 img").attr({ 
          		width: 238
          	});          	
        } 
        
        $(".dynColLayout-3 img").removeAttr("height");
	}
	
	
	/* Set videosize
	___________________________________________________*/
	
	$("#start-video object").attr({ 
    	width: 221,
    	height: 133
   	});
   	
	$("#start-video embed").attr({ 
        width: 221,
        height: 133
   	});

	
}