$(document).ready(function()
	{

		// Set specific variable to represent all iframe tags.
		var iFrames = document.getElementsByTagName('iframe');

		// Resize heights.
		function iResize()
		{

			// Iterate through all iframes in the page.
			for (var i = 0, j = iFrames.length; i < j; i++)
			{
				// Set inline style to equal the body height of the iframed content.
				if (iFrames[i].contentWindow.document.body.scrollHeight)
				{ 
iFrames[i].style.height =0;
iFrames[i].style.height = iFrames[i].contentWindow.document.body.scrollHeight + 180 + 'px'; }
				else if (iFrames[i].contentWindow.document.body.offsetHeight && !iFrames[i].contentWindow.document.body.scrollHeight)
				{ 
iFrames[i].style.height =0;
iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 180 + 'px'; }
				else 
 				{
            iFrames[i].style.height='1600px';
            iFrames[i].style.overflow='auto';
            iFrames[i].style.overflowX='hidden';
				}
			}
		}

			// Start timer when loaded.
			$('iframe').load(function()
				{
					setTimeout(iResize, 0);
				}
			);
		// Check if browser is Safari or Opera.
		if ($.browser.safari || $.browser.opera)
		{

			// Safari and Opera need a kick-start.
			for (var i = 0, j = iFrames.length; i < j; i++)
			{
				var iSource = iFrames[i].src;
				iFrames[i].src = '';
				iFrames[i].src = iSource;
			}
		}
		else
		{
			// For other good browsers.
			$('iframe').load(function()
				{
					// Set inline style to equal the body height of the iframed content.
	if (this.contentWindow.document.body.scrollHeight)
		{this.style.height = this.contentWindow.document.body.scrollHeight + 180 + 'px';}
	else if (this.contentWindow.document.body.offsetHeight && !this.contentWindow.document.body.scrollHeight)
		{this.style.height = this.contentWindow.document.body.offsetHeight + 180 + 'px';}
	else
 		{
            this.style.height='1600px';
            this.style.overflow='auto';
            this.style.overflowX='hidden';
		}
				}
			);
		}
	}
);