﻿function prepare(){
	if(!sIframe&&sIframe.length==0) return false;
	for(var i=0; i<sIframe.length; i++){
		auto(sIframe[i]);
	}
}
function auto(which){
	var oIframe = document.getElementById(which);
	oIframe.height = oIframe.contentWindow.document.body.clientHeight;
	oIframe.onreadystatechange = function(){
		if (this.readyState=="complete"){
			oIframe.height = oIframe.contentWindow.document.body.clientHeight;
		}
	}
}
function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
		window.onload = func;
	}else{
		window.onload = function(){
			oldonload();
			func();
		}
	}
}
addLoadEvent(prepare);
