$(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.
				iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';
			}
		}

		// Check if browser is Safari or Opera.
		if ($.browser.safari || $.browser.opera || $.browser.msie)
		{
			// Start timer when loaded.
			$('iframe').load(function()
				{
					$(this).css({'display' : 'block'});
					$(this).css({'visibility' : 'visible'});
					
					setTimeout(iResize, 0);
					$('#thumb_loader').css({'display' : 'none'});

				}
			);

			// 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.
					$(this).css({'display' : 'block'});
					$(this).css({'visibility' : 'visible'});
					
					this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
					
					
					$('#thumb_loader').css({'display' : 'none'});
				}
			);
		}
	}
);