function resize(_frame)
{  
var frame = document.getElementById(_frame);  
//var htmlheight = document.body.parentNode.scrollHeight;  
var windowheight = window.innerHeight;  

if ( document.body.parentNode.scrollHeight < window.innerHeight )
	{
		document.body.style.height = window.innerHeight;// + "px";
		frame.style.height = window.innerHeight;// + "px"; 
	}  
else 
	{
	document.body.style.height = document.body.parentNode.scrollHeight;// + "px";
	frame.style.height = document.body.parentNode.scrollHeight;// + "px";
	}
} 

/*function resize(_frame)
{  
var frame = document.getElementById(_frame);  
var htmlheight = document.body.parentNode.scrollHeight;  
var windowheight = window.innerHeight;  

if ( htmlheight < windowheight )
	{
		document.body.style.height = windowheight + "px";
		frame.style.height = windowheight + "px"; 
	}  
else 
	{
	document.body.style.height = htmlheight + "px";
	frame.style.height = htmlheight + "px";
	}  
} */


/*<script type="text/javascript">
		var timeout;
		function clickAction()
		{
		    frameFitting();
		    var fr = parent.document.getElementById('myframe').contentWindow.document.body.getElementsByTagName('a');
		    for (var i=0; i<fr.length; i++)
		    {
 		        fr[i].onclick = function()
		        {
		            clearInterval(timeout);
		            timeout = setInterval("frameFitting()",100);
		        }
		    }
		}

		function frameFitting()
		{
		    parent.document.getElementById('myframe').width = '99%';
		    parent.document.getElementById('myframe').height = parent.document.getElementById('myframe').contentWindow.document.body.scrollHeight+4+'px';

		}


        clickAction();

        // если страница загружает картинки, которые приведут к увелечению высоты, то обновляем высоту 2 раз через 5 сек.
         setTimeout("clickAction()", 5000);
	</script>
*/