$(document).ready(function() {
		
		//the Container for the content 
		var contentDiv = '#contentRadDoc';
		
		//max y-coordinate of containers
		var maxBottom = 0;
		
		//max x-coordinate of containers
		var maxRight = 0;
	
		//for all containers in radDoc
		$(contentDiv).children('.radDoc').children('.radDocConPos').each(function(i){	
			//height and width of the floating container
			var conHeight = $(this).children('.radDocConFloat').height();
			var conWidth = $(this).children('.radDocConFloat').width();
			
			//measured height and width of container contents
			var measureHeight = $(this).children('.radDocConFloat').children('.radDocConMeasure').height();
			var measureWidth = $(this).children('.radDocConFloat').children('.radDocConMeasure').width();
			
			//alert(measureHeight);
			
			//if content doesn't fit in container => fix height 
			if(measureHeight>conHeight){
				$(this).children('.radDocConFloat').css({ height: measureHeight });
				$(this).css({ height: measureHeight});
			}
			
			//if content doesn't fit in container => fix width
			if(measureWidth>conWidth){
				$(this).children('.radDocConFloat').css({ height: measureWidth });
				$(this).css({ height: measureWidth });
			}
			
			//right-bottom corner of the fixed container
			var right = Number($(this).css('left').replace('px',''))+$(this).width();
			var bottom = Number($(this).css('top').replace('px',''))+$(this).height();
			
			//set maximum 
			if(bottom>maxBottom){
				maxBottom = bottom;
			}
			if(right>maxRight){
				maxRight = right;
			}
			
		});
		
		
		//fix width and height of the radDoc div
		$(contentDiv).children('.radDoc').css({ width: maxRight, height: maxBottom });
		$(contentDiv).css({ height: maxBottom, width:maxRight });
		
		//only in sip site: fix height of leftNavi
		//$('#leftNavi').css({ height: maxBottom });
	}

)
