//document.domain = "et-house.com";

/*
 *******************************************************************************
 * ÇÃ·¹½Ã ¸Þ´º °ü·Ã ½ºÅ©¸³Æ®
 *******************************************************************************
 */
var menu_size_flag = 0;
var menu_tid;

function menu_size_small(){
	if (menu_size_flag == 1) {
		menu_size_flag = 0;
		menu_tid = setTimeout(menu_size_small,500);
	} else {
		document.all.menulayer.style.width = 200;
		clearTimeout(menu_tid);
	}
}

function menu_size_big() {
	clearTimeout(menu_tid);
	document.all.menulayer.style.width=700;
	menu_size_flag=1;
}
/*
 *******************************************************************************
 * ÇÃ·¹½Ã ¸Þ´º °ü·Ã ½ºÅ©¸³Æ®
 *******************************************************************************
 */

function LogAlert() {
	alert('·Î±×ÀÎ ÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù.');	
	fncCMAct('https://members.neungyule.com/pages/t_member/login.asp');
}

function downLoginChk() {
	alert('·Î±×ÀÎ ÈÄ ÀÌ¿ë°¡´ÉÇÕ´Ï´Ù.');	
	parent.fncCMAct('https://members.neungyule.com/pages/t_member/login.asp');
}

function chkObjStr(objname, objtext) {
	if (trim(objname.value) == "") {
		alert(objtext + '(¸¦)À» ÀÔ·ÂÇÏ¼¼¿ä.\n\nºóÄ­À» ÀÔ·ÂÇÏÁö ¸¶¼¼¿ä.');objname.focus()
		return false;
	} else {
		return true;
	}		
}

function trim(keyword) { 
	var str=keyword.replace(/(\s+$)/g,"");
	return str.replace(/(^\s*)/g,"");
}

/***************************************************************************************************/
var ASCII_WIDTH_TABLE = new Array(
	0,6,6,6,6,6,6,6,6,0,0,0,0,0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
	6,6,6,6,0,4,4,6,6,10,0,4,5,5,6,6,4,6,4,6,6,6,6,6,6,6,6,6,6,
	6,4,4,0,6,8,6,12,8,8,9,8,8,7,9,8,3,6,8,7,11,9,9,8,9,8,8,8,8,
	8,10,8,8,8,6,11,6,6,6,4,7,7,7,7,7,3,7,7,3,3,6,3,11,7,7,7,7,4,
	7,3,7,6,10,7,7,7,6,6,6,9,6,10,10,10,10,10,10,10,10,10,10,10,10,
	10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,4,5,
	6,6,7,6,3,6,6,9,5,6,7,0,9,6,4,10,4,4,4,7,7,3,3,4,5,6,6,6,6,7,9,9,
	9,9,9,9,11,8,7,7,7,7,4,4,4,4,9,9,9,9,9,9,9,10,9,9,9,9,9,8,7,6,5,5,
	5,5,5,5,8,5,5,5,5,5,3,3,3,3,6,6,6,6,6,6,6,10,6,6,6,6,6,7,7,7);
var KOREAN_WIDTH = 12;

function LEFT(str, len)	{
	len = isNaN(len) ? 1 : +len;
	return C_STR(str).substring(0, len);
}

function RIGHT(str, len) {
	len = isNaN(len) ? 1 : +len;
	return C_STR(str).substring(C_STR(str).length - len);
}

function MID(str, index, len) {
	index = isNaN(index) ? 0 : +index;
	if (!isNaN(len))
		return C_STR(str).substring(index, index + len);
	else
		return C_STR(str).substring(index);
}

function LTRIM(str)	{
	while (C_STR(str).charAt(0) == ' ')
	{
		str = MID(str, 1);
	}
	return str;
}

function RTRIM(str)	{
	while (C_STR(str).charAt(C_STR(str).length - 1) == ' ')
		str = LEFT(str, C_STR(str).length - 1);
	return str;
}

function TRIM(str) {
	str = LTRIM(str);
	str = RTRIM(str);
	return str;
}

function C_STR(str)	{
	return (typeof(str) == "undefined" ? "" : "" + str);
}

// ÀÌ¹ÌÁö ¹Ì¸® º¸±â
function showImgWin(imgSrc) {
	var	objImg	=	new Image();

	objImg.src	=	imgSrc;

	w		=	objImg.width;
	h		=	objImg.height;
	swidth	=	screen.width;
	sheight	=	screen.height;
	mwidth	=	iwidth	=	w;
	mheight	=	iheight	=	h;

	if(iwidth >= swidth)
		mwidth	=	swidth - 16;

	if(iheight >= sheight)
		mheight	=	sheight - 60;

	showImg		=	window.open('/pages/album/pop_img_view.asp?imgPath=' + objImg.src + '&mw=' + mwidth + '&mh=' + mheight, '', 'width=' + mwidth + ',height=' + mheight + ',scrollbars=0,status=0,resizable=0');
}

function CSTR(o){return (""+o);}
function CINT(o){return parseInt(o);}

function GetChrWidth(chr) {
	var n = CSTR(chr).charCodeAt(0);
	return ( (n >= 0 && n < 256) ? ASCII_WIDTH_TABLE[n] : KOREAN_WIDTH );
}

function GetStrWidth(str) {
	var w = 0;
	str = CSTR(str);
	for (var i = 0 ; i < str.length ; i++)
		w += GetChrWidth(str.charAt(i));
	return w;
}

// Á¦¸ñ ±ÛÀÚ¼ö Â©¶óÁÜ
function MakeStrEllipsis(str, width) {
	str = CSTR(str);
	width = CINT(width);
	var w = 0;
	var addedStr = "..";
	var addedWidth = GetStrWidth(addedStr);
	if (GetStrWidth(str) <= width) return str;
	for (var i = 0 ; i < str.length ; i++)
	{
		w += GetChrWidth(str.charAt(i));
		if (w + addedWidth > width) {--i;break;}
	}
	return LEFT(str, i+1)+addedStr;
}


//et-house °Ë»ö
function chk_blank_ethouse() {
	if (document.frm_ethouse_search.isUse.value == "0") {
		document.frm_ethouse_search.isUse.value = "1";
		document.frm_ethouse_search.Query.value = "";
	}
}

function searchAct_ethouse(pForm) {
	if (pForm.isUse.value == "0" || pForm.Query.value == "") {
		alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		pForm.Query.focus();
		return false;
	}
	return true;
}
/***************************************************************************************************/


/***************************************************************************************************/
/****** ½Å±Ô ÅëÇÕ »çÀÌÆ® °ü·Ã »ó´Ü ¸Þ´º ÇÃ·¡½Ã °ü·Ã ½ºÅ©¸³Æ® By Á¤½Â¿í *****************************/
/***************************************************************************************************/
function goUrl(){
	var tmpVal = document.all.comboName[document.all.comboName.selectedIndex].value;

	if (tmpVal != '') {
		var newwin = window.open(tmpVal);
	}
}

function link(n) { if(n==0) location.href="/" }
function ethouse() { location.href="http://www.et-house.com/"; }
function ethouse1() { location.href="http://www.et-house.com/html/gather/index.asp"; }
function ethouse2() { location.href="http://www.et-house.com/html/single/class01/index.asp"; }
function ethouse3() { location.href="http://www.et-house.com/html/etsearch/index.asp"; }
function ethouse4() { location.href="http://www.et-house.com/html/freecont/index.asp"; }
function ethouse5() { location.href="http://www.et-house.com/html/engtraining/index.asp"; }
function ethouse6() { location.href="http://www.et-house.com/html/freecont/index.asp"; }
function books() { location.href="http://www.et-house.com/html/books/index.asp"; }
function teens() { location.href="http://teens.et-house.com/html/index.asp"; }
function tomato() { location.href="http://www.tomatotoeic.com/index.eng"; }
function kids() { location.href="http://kids.et-house.com/html/index.asp"; }
function ivys() { location.href="http://ivys.et-house.com/html/index.asp"; }

function GNBFooter(){
document.write("\
<!-- ÇÏ´Ü Copy //-->\
<div style='width:100%;background:#ECECEC' class='clear'>\
	<div style='position:absolute;margin:89 0 0 14;z-index:1'>\
		<select name='comboName' onChange='goUrl()' style='width: 142px;'>\
		<option value=''>ÆÐ¹Ð¸®»çÀÌÆ®</option>\
		<option value='http://www.et-house.com/'>itomato</option>\
		<option value='http://www.englishcare.com/'>EnglishCare</option>\
		<option value='http://www.tenenglishclub.com/'>TEN English Club</option>\
		<option value='http://jr.neungyule.com/'>Áß°íµî¿µ¾î</option>\
		<option value='http://www.howfun.co.kr/'>HowFun</option>\
		<option value='http://www.neungyule.com/'>¢ß´É·ü±³À°</option>\
		</select>\
	</div>\
	<img src='/images/main/copy.gif' usemap='#MCopy'><br>\
	<map name='MCopy'>\
	  <area shape='rect' coords='170,14,212,34' href='http://www.neungyule.com/' target='new'>\
	  <area shape='rect' coords='229,13,275,34' href='http://www.et-house.com/html/etc/footer/cooperation.asp'>\
	  <area shape='rect' coords='292,14,386,33' href='#'>\
	  <area shape='rect' coords='403,14,480,33' href='http://www.et-house.com/html/common/join/private.asp'>\
	  <area shape='rect' coords='496,14,588,34' href=\"javascript:PopUP('https://security.neungyule.com/member/mguide.asp', '800','500')\">\
	  <area shape='rect' coords='603,14,651,33' href='http://www.et-house.com/html/common/join/agreement.asp'>\
	  <area shape='rect' coords='662,13,741,34' href='http://www.et-house.com/html/common/join/legal.asp'>\
	  <area shape='rect' coords='755,13,862,34' href=\"javascript:email_open('https://security.neungyule.com/member/email.asp',380,190)\">\
	  <area shape='rect' coords='272,54,404,69' href='#'>\
	</map>\
</div>\
<!--// ÇÏ´Ü Copy -->\
");
}



function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)

// function Bottom(){
//	document.write("\
//	<div style='position:absolute;left:0;'>\
//		<div style='position:absolute;margin:70px 0 0 20px;z-index:1'>\
//			<select name='comboName' onChange='goUrl()' style='width:120px;font-size:11px'>\
//			<option value=''>Family Site</option>\
//		<option value='http://www.itomato.co.kr/'>itomato</option>\
//		<option value='http://www.tomatotoeic.com/'>Åä¸¶ÅäÅäÀÍ</option>\
//		<option value='http://www.tomatotoefl.com/'>Åä¸¶ÅäÅäÇÃ</option>\
//		<option value='http://www.teensup.com/'>Teens UP</option>\
//		<option value='http://www.4englishteachers.com/'>4EnglishTeachers</option>\
//		<option value='http://www.hello-et.com/'>HelloET</option>\
//		<option value='http://www.necamp.co.kr/'>NESchool</option>\
//		<option value='http://www.tenenglishclub.com/'>TEN English Club</option>\
//		<option value='http://www.opendictionary.co.kr/'>OpenDictionary</option>\
//			</select>\
//		</div>\
//	<img src='http://www.tomatotoeic.com/images/renew/main/copy_091105.gif' usemap='#MCopy'></div>\
//	<map name='MCopy'>\
//		<area shape='rect' coords='45,14,144,67' href='http://www.et-house.com/'>\
//		<area shape='rect' coords='184,10,227,31' href='http://www.neungyule.com/' target='_blank'>\
//		<area shape='rect' coords='' href=''>\
//		<area shape='rect' coords='232,11,280,31' href='http://www.itomato.co.kr/pages/etc/business_edu.asp'>\
//		<area shape='rect' coords='286,11,333,32' href='http://www.itomato.co.kr/pages/etc/partnership.asp'>\
//		<area shape='rect' coords='343,10,388,32' href='hhttp://www.itomato.co.kr/pages/etc/recruit.asp'>\
//		<area shape='rect' coords='396,10,481,33' href=\"javascript:fncCMAct('http://www.et-house.com/html/common/join/private.asp');\">\
//		<area shape='rect' coords='489,11,536,33' href=\"javascript:fncCMAct('http://www.et-house.com/html/common/join/agreement.asp');\">\
//		<area shape='rect' coords='' href='http://www.et-house.com/html/common/join/legal.asp'>\
//		<area shape='rect' coords='543,10,630,31' href=\"javascript:pop('http://www.et-house.com/html/etc/footer/pop_email.asp','PEmail',460,246)\">\
//		<area shape='rect' coords='635,10,747,32' href='/2009event/2009_sitmap.asp'>\
//		<area shape='rect' coords='667,60,812,73' href='mailto:necpo@neungyule.com'>\
//	</map>\
//	");
//}


function fnc_ssoURL() {
	if (document.all.familysiteUrl.selectedIndex != 0 ) {
		var ssowin = window.open('https://members.neungyule.com/pages/t_member/bridge.asp?PURL=' + document.all.familysiteUrl[document.all.familysiteUrl.selectedIndex].value);
		ssowin.focus();
	}
}

function Bottom(){
	document.write("\
	<div style='position:absolute;left:0;'>\
		<div style='position:absolute;margin:70px 0 0 20px;z-index:1'>\
			<select name='familysiteUrl' onChange='fnc_ssoURL()' style='width:120px;font-size:11px'>\
			<option value=''>Family Site</option>\
			<option value='http://www.neungyule.com'>´É·ü±³À°</option>\
			<option value='http://www.teensup.com'>Teens UP</option>\
			<option value='http://www.itomato.co.kr'>itomato</option>\
			<option value='http://www.tomatotoefl.com'>Åä¸¶ÅäÅäÇÃ</option>\
			<option value='http://www.hello-et.com'>Hello-ET</option>\
			<option value='http://www.ibuildandgrow.com'>Build&Grow</option>\
			<option value='http://www.et-house.com'>ET-house</option>\
			<option value='http://www.englishtop.co.kr'>¿µ¾îÅ¾</option>\
			<option value='http://www.youngtimes.co.kr'>Young Times</option>\
			</select>\
		</div>\
	<img src='http://www.tomatotoeic.com/images/renew/main/copy_091105.gif' usemap='#MCopy'></div>\
	<map name='MCopy'>\
		<area shape='rect' coords='45,14,144,67' href='http://www.neungyule.com/' target='_blank'>\
		<area shape='rect' coords='184,10,227,31' href='http://www.neungyule.com/' target='_blank' alt='È¸»ç¼Ò°³' >\
		<area shape='rect' coords='' href=''>\
		<area shape='rect' coords='' href='http://www.itomato.co.kr/pages/etc/business_edu.asp' alt='±â¾÷±³À°' >\
		<area shape='rect' coords='' href='http://www.itomato.co.kr/pages/etc/partnership.asp' alt='Á¦ÈÞ¹®ÀÇ'>\
		<area shape='rect' coords='' href='http://www.itomato.co.kr/pages/etc/recruit.asp' alt='°­»ç¸ðÁý' >\
		<area shape='rect' coords='240,14,316,30' href=\"javascript:fncCMAct('https://members.neungyule.com/pages/t_member/private.asp?WHEREJOIN=41&FNUM=1');\" alt='°³ÀÎÁ¤º¸'>\
		<area shape='rect' coords='325,12,375,30' href=\"javascript:fncCMAct('https://members.neungyule.com/pages/t_member/agreement.asp?WHEREJOIN=41&FNUM=1');\" alt='ÀÌ¿ë¾à°ü'>\
		<area shape='rect' coords='' href='http://www.et-house.com/html/common/join/legal.asp'>\
		<area shape='rect' coords='381,13,486,32' href=\"javascript:pop('https://members.neungyule.com/pages/t_member/pop_email_policy.asp','PEmail',460,246)\" alt='¸ÞÀÏ¹«´Ü¼ö½Å°ÅºÎ'>\
		<area shape='rect' coords='495,11,548,33' href='/2009event/2009_sitmap.asp' alt='»çÀÌÆ®¸Ê'>\
		<area shape='rect' coords='667,60,812,73' href='mailto:necpo@neungyule.com' alt='¸ÞÀÏ'>\
	</map>\
	");
}











function frameReSize(frameNm,frameHeight) {
	frameHeight+=30;
	try {
		if (document.getElementById && document.getElementById(frameNm)) {
			document.getElementById(frameNm).style.height = frameHeight;
		} else if (document.getElementByName && document.getElementByName(frameNm)) {
			document.getElementByName(frameNm).style.height = frameHeight;
		} else if (document.all && document.all(frameNm)) {
			document.all(frameNm).style.height = frameHeight;
		} else if (document.layers && document.layers[frameNm]) {
			document.layers[frameNm].style.height = frameHeight;
		}
	} catch (e) {
	}
}


/*
 *******************************************************************************
 * ÇÃ·¹½Ã ¸Þ´º °ü·Ã ½ºÅ©¸³Æ®
 *******************************************************************************
 */

function func_expressFlash(FN,W,H)
{			
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+W+"' height='"+H+"' id='purzon_sub3' align='middle'>");
	document.write("<param name='allowScriptAccess' value='sameDomain' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<param name='movie' value='"+FN+"' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='"+FN+"' quality='high' bgcolor='#ffffff' width='"+W+"' height='"+H+"' name='purzon_sub3' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}

/*
 *******************************************************************************
 * ÇÃ·¹½Ã ¸Þ´º °ü·Ã ½ºÅ©¸³Æ®
 *******************************************************************************
 */

function logout()
{
	location.href = "http://www.et-house.com/ne_common/logout.asp?PURL=http://www.tomatotoeic.com/index.eng";
}

function modifyMyInfo()
{
	location.href = "http://www.et-house.com/html/common/join/relogin.asp";
}





/*
 *******************************************************************************
 * ÀÌ¹ÌÁö ¸µÅ©½Ã ¹Ú½º Á¦°Å
 *******************************************************************************
 */

function allblur() {
  for (i = 0; i < document.links.length; i++) {
    var obj = document.links[i];
    if(obj.addEventListener) obj.addEventListener("focus", oneblur, false);
    else if(obj.attachEvent) obj.attachEvent("onfocus", oneblur);
  }
}
 
function oneblur(e) {
  var evt = e ? e : window.event;

 

  if(evt.target) evt.target.blur();
  else if(evt.srcElement) evt.srcElement.blur();
}



/*
 *******************************************************************************
 * µ¿¿µ»ó ÇÃ·¹ÀÌ Å×±×
 *******************************************************************************
 */
function embed_Movie(linkUrl,wid,hei)
{
	document.write("<EMBED name='mv' SRC='"+linkUrl+"' AUTOSTART='false' WIDTH='"+wid+"' HEIGHT='"+hei+"' loop=-1>");
}
	
 

function window::onload() { allblur(); }


function fnc_showHelp(num) {
	if (parseInt(num) != num) {
		var newwin = window.open('/renew/help/help_list.asp?types=1','pop_help','width=638,height=590,scrollbars=yes');
	} else {
		var newwin = window.open('/renew/help/help_list.asp?types=' + num,'pop_help','width=638,height=590,scrollbars=yes');
	}

	newwin.focus();
}



/*
 *******************************************************************************
 * ÇÃ·¡½Ã °ü·Ã Ãß°¡ 4renew
 *******************************************************************************
 */

function Flash(id,url,w,h,bg,t){
//	alert(url);
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" wmode="+t+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}




function TomatoMenu(arg1, arg2, arg3, arg4, arg5, arg6) {
	document.write("\
	<div id='TomatoMenuLayer' name='TomatoMenuLayer' style='position:absolute;width:" + arg3 + ";height:" + arg4 + ";overflow:hidden; z-index:2;'>\
	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + arg3 + "' height='" + arg4 + "' id='sm_leftmenu' align='middle' onmouseover='TomatoMenu_size_big();' onmouseout='TomatoMenu_size_small();'>\
	<param name='allowScriptAccess' value='always' />\
	<param name='movie' value='" + arg2 + "' />\
	<param name='wmode' value='" + arg6 + "' />\
	<param name='quality' value='high' />\
	<param name='bgcolor' value='#ffffff' />\
	</object>\
	</div>\
	");

	TomatoMenu_size_small();
//		<param name='movie' value='/images/main/mnav.swf?dataURL=/commonPage/link.txt&curMnu=000' />\
}

var TomatoMenu_size_flag = 0;
var TomatoMenu_tid;

function TomatoMenu_size_small(){
	if (TomatoMenu_size_flag == 1) {
		TomatoMenu_size_flag = 0;
		TomatoMenu_tid = setTimeout(TomatoMenu_size_small,400);
	} else {
		document.all.TomatoMenuLayer.style.height = 43;
		clearTimeout(TomatoMenu_tid);
	}
}

function TomatoMenu_size_big() {
	clearTimeout(TomatoMenu_tid);
	document.all.TomatoMenuLayer.style.height=470;
	TomatoMenu_size_flag=1;
}

function authnum_write() {
	var newwin = window.open('/mypage/popup_input_book_authcode.asp','','width=700,height=650');
}

function goOpenUrl(url,size,scroll) {
	if (url == undefined) { url = "http://www.necamp.co.kr/"; }
	if (scroll == undefined) { scroll = "0"; }
	if (size != undefined) {
		var splitS = size.split(",");
		var ws = splitS[0];
		var hs = splitS[1];
		if (scroll == "0") {
			window.open(url,"","width="+ws+",height="+hs);
		} else {
			window.open(url,"","width="+ws+",height="+hs+",scrollbars=1");
		}
	} else {
		window.open(url,"","");
	}
}

function fncAct(nextUrl) {
	document.addInfoForm.action = nextUrl;
	document.addInfoForm.submit();
}

function actLogin() {
	var pForm = document.loginForm;
	if(pForm.userid.value == "") {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		pForm.userid.focus();
		return;
	}
	if(pForm.passwd.value == "") {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		pForm.passwd.focus();
		return;
	}

	pForm.submit();
}

function fncCMAct(nextUrl) {
	top.glLoginForm.action = nextUrl;
	top.glLoginForm.submit();
}

/*************************************************************
 *    DYNIFS - Dynamic IFrame Auto Size v1.0.0
 *
 *    Copyright (C) 2006, Markus (phpMiX)
 *    This script is released under GPL License.
 *    Feel free to use this script (or part of it) wherever you need
 *    it ...but please, give credit to original author. Thank you. :-)
 *    We will also appreciate any links you could give us.
 *    http://www.phpmix.org
 *
 *    Enjoy! ;-)
*************************************************************/

var DYNIFS = {
    // Storage for known IFrames.
    iframes: {},
    // Here we save any previously installed onresize handler.
    oldresize: null,
    // Flag that tell us if we have already installed our onresize handler.
    ready: false,
    // The document dimensions last time onresize was executed.
    dim: [-1,-1],
    // Timer ID used to defer the actual resize action.
    timerID: 0,
    // Obtain the dimensions (width,height) of the given document.
    getDim: function(d) {
        var w=200, h=200, scr_h, off_h;
        if( d.height ) { return [d.width,d.height]; }
        with( d.body ) {
            if( scrollHeight ) { h=scr_h=scrollHeight; w=scrollWidth; }
            if( offsetHeight ) { h=off_h=offsetHeight; w=offsetWidth; }
            if( scr_h && off_h ) h=Math.max(scr_h, off_h);
        }
        return [w,h];
    },
    // This is our window.onresize handler.
    onresize: function() {
        // Invoke any previously installed onresize handler.
        if( typeof this.oldresize == 'function' ) { this.oldresize(); }
        // Check if the document dimensions really changed.
        var dim = this.getDim(document);
        if( this.dim[0] == dim[0] && this.dim[1] == dim[1] ) return;
        // Defer the resize action to prevent endless loop in quirksmode.
        if( this.timerID ) return;
        this.timerID = setTimeout('DYNIFS.deferred_resize();', 10);
    },
    // This is where the actual IFrame resize is invoked.
    deferred_resize: function() {
        // Walk the list of known IFrames to see if they need to be resized.
        for( var id in this.iframes ) this.resize(id);
        // Store resulting document dimensions.
        this.dim = this.getDim(document);
        // Clear the timer flag.
        this.timerID = 0;
    },
    // This is invoked when the IFrame is loaded or when the main window is resized.
    resize: function(id) {
        // Browser compatibility check.
        if( !window.frames || !window.frames[id] || !document.getElementById || !document.body )
            return;
        // Get references to the IFrame window and layer.
        var iframe = window.frames[id];
        var div = document.getElementById(id);
        if( !div ) return;
        // Save the IFrame id for later use in our onresize handler.
        if( !this.iframes[id] ) {
            this.iframes[id] = true;
        }
        // Should we inject our onresize event handler?
        if( !this.ready ) {
            this.ready = true;
            this.oldresize = window.onresize;
            window.onresize = new Function('DYNIFS.onresize();');
        }
        // This appears to be necessary in MSIE to compute the height
        // when the IFrame'd document is in quirksmode.
        // OTOH, it doesn't seem to break anything in standards mode, so...
        if( document.all ) div.style.height = '0px';
        // Resize the IFrame container.
        var dim = this.getDim(iframe.document);
        div.style.height = (dim[1]+20) + 'px';
    }
};