﻿function resizeIframe(frameid){

	/*var currentfr=parent.document.getElementById(frameid)
	
	//alert(parent.document.body.offsetHeight);

	if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
		alert(currentfr.contentDocument.body.scrollHeight);
		//currentfr.height = hg + "px"; 
		//window.sizeToContent();
	}
	else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
		currentfr.height = currentfr.Document.body.scrollHeight + 5;
    }*/
    
    //find the height of the internal page
    var the_height=parent.document.getElementById(frameid).contentWindow.document.body.scrollHeight;
    
    //change the height of the iframe
    parent.document.getElementById(frameid).height=the_height;

	//setar o scroll da janela para 0
	parent.scrollTo(0,0);
	//document.scrollTo(0,0);

}
