addLoadEvent(adjustHIFrameSize);

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function loadFrame(urlSRC) {
	if (document.getElementById) { 
		var myIframe = document.getElementById('hiframe');
		myIframe.src = urlSRC;
	}
	adjustHIFrameSize();
}

function adjustHIFrameSize() {
	if (document.getElementById) {
		var myIframe = document.getElementById('hiframe');
		if (myIframe) {
			if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
				// W3C DOM (and Mozilla) syntax
				myIframe.height = myIframe.contentDocument.body.offsetHeight + 50;
			}
			else if (myIframe.Document && myIframe.Document.body.scrollHeight) {
				// IE DOM syntax
				myIframe.height = myIframe.Document.body.scrollHeight;
			}
			else { myIframe.height = '2000'; }

			// bind onload events to iframe
			if (myIframe.addEventListener) { myIframe.addEventListener("load", resizeIframe, false); }
			else                           { myIframe.attachEvent("onload", resizeIframe); }
		}
	}
}

function resizeIframe(evt) { 
	window.scroll(0,0);
	adjustHIFrameSize('hiframe'); 
}

function outputIframe() {
	var isIE    = (navigator.appName == 'Microsoft Internet Explorer')
	var isMacIE = ((navigator.userAgent.indexOf('Mac') != -1) && (isIE));
	var scroll  = 'yes';
	if ((isIE) && (!(isMacIE))) { scroll = 'no'; }
	document.write('<iframe src="" width="544" height="2000" scrolling="' + scroll + '" frameborder="0" marginwidth="0" marginheight="0" name="hinfo" id="hiframe" style="margin-bottom: 20px; overflow: visible;"></iframe>');
	return true;
}


