/******************************************************************************************************************
 * Arquivo criado em:		2011-07-04
 * Arquivo atualizado em:	2011-07-04 
 * Autor:					Francisco L. de Matos
 * Descricao:				Comandos iniciais responsaveis pelos iframes
 ******************************************************************************************************************/

/* Recursos pós-abertura */

	$a(document).ready(function(){
		// 1. Redimensionamento de iFrame
		// 1.1. vamos criar uma variavel para representar todos os iFrames (tags) da pagina
		var iFrames = document.getElementsByTagName('iframe');
		// 3.2. funcao para redimensionar iFrame
		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 ($a.browser.safari || $a.browser.opera){
			// Start timer when loaded.
			$a('iframe').load(function(){
					setTimeout(iResize, 0);
				}
			);
			// 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.
			$a('iframe').load(function(){
				// Set inline style to equal the body height of the iframed content.
				this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
			});
		}
	});

