
<script type="text/javascript">
$(document).ready(function () {
	CCS_RS_RegisterResize();
});

function CCS_RS_RegisterResize()
{
	if($("#tabullist > li > a").length == 0)
	{
		setTimeout(CCS_RS_RegisterResize, 500);
	}
	else
	{
		$("#tabullist > li > a").on("click", function () {
						ResizeSPDialogWindow();
					}
			);
			$("#contentRow").css({'max-height': "340px"});
	}
}


function ResizeSPDialogWindow(){
	var dlgHieght = $("#contentRow #onetIDListForm").height() + $("#s4-ribbonrow").height() + 27 +65;
	var winMaxHeight = $(window.parent.document).height() - 40;
	
	var dlgWidth = $("#contentRow #onetIDListForm").width() + 47;
	var winMaxWidth = $(window.parent.document).width() - 40;
	dlgWidth = (dlgWidth < 600) ? 600 : dlgWidth;
	
	var dlgWin = $(".ms-dlgContent", window.parent.document);
	var dlgWinB = $(".ms-dlgBorder", window.parent.document);
	var dlgWinF = $(".ms-dlgFrameContainer", window.parent.document);
	var dlgWinFIframe = $(".ms-dlgFrameContainer > iframe", window.parent.document);
	
	dlgWin.css({ height: (dlgHieght) + "px", 'max-height': (winMaxHeight) + "px", width: (dlgWidth) + "px", 'max-width': (winMaxWidth) + "px", top: "20px", left: 0, right: 0, margin: "0 auto" });
	dlgWinB.css({ height: (dlgHieght -4) + "px", 'max-height': (winMaxHeight -4) + "px", width: (dlgWidth - 4) + "px", 'max-width': (winMaxWidth - 4) + "px" });
	dlgWinF.css({ height: (dlgHieght -52) + "px", 'max-height': (winMaxHeight -52) + "px", width: (dlgWidth - 4) + "px", 'max-width': (winMaxWidth - 4) + "px" });
	dlgWinFIframe.css({ overflow: 'hidden', height: (dlgHieght - 65) + "px", 'max-height': (winMaxHeight - 65) + "px", width: (dlgWidth - 42) + "px", 'max-width': (winMaxWidth - 42) + "px" });
	$("#s4-workspace").css({ height: (dlgHieght - $("#s4-ribbonrow").height() - 65) + "px", 'max-height': (winMaxHeight - $("#s4-ribbonrow").height() - 65) + "px", width: (dlgWidth - 42) + "px", 'max-width': (winMaxWidth - 42) + "px" });	
	
}

</script>