// JavaScript Document

//================================================================
// ¾ÆÀÌÇÁ·¹ÀÓ ¸®»çÀÌÁî
//================================================================
function iframe_auto_resize_both(this_s,min_width,min_height){
	if(!min_width){min_width=300;}
	if(!min_height){min_height=300;}
	try{
	this_s.stylewidth=this_s.contentWindow.document.body.scrollWidth;
		if(this_s.width && this_s.width>=(this_s.contentWindow.document.body.scrollWidth+20)){
		}else{
			this_s.style.height=(this_s.contentWindow.document.body.scrollHeight+20)+'px';
		}

		if(this_s.height && this_s.height>=(this_s.contentWindow.document.body.scrollHeight+20)){
		}else{
			this_s.style.height=(this_s.contentWindow.document.body.scrollHeight+20)+'px';
		}
	}catch(e){
	}
}
var iframe_auto_resize_h_twice_timer = null;
function iframe_auto_resize_h_twice(this_c,min_height){
	iframe_auto_resize_h(this_c,min_height);
	if(iframe_auto_resize_h_twice_timer){
		clearTimeout(iframe_auto_resize_h_twice_timer);
	}
	var fn = function(this_c,min_height){
		return function(){
			iframe_auto_resize_h(this_c,min_height);
		}
	}(this_c,min_height);
	setTimeout(fn,500);
}
function iframe_auto_resize_h(this_c,min_height){
	var sc = 0;
	var sc_t = 0
	if(top.document.documentElement.scrollTop){
		sc_t = 1;
		sc = top.document.documentElement.scrollTop
	}else if(top.document.body.scrollTop){
		sc_t = 2;
		sc = top.document.body.scrollTop
	}
	if(document.documentElement.scrollHeight){
	}
	if(min_height==null){min_height=300;}
	try{
		this_c.style.height = min_height+'px';
		var h = parseInt(this_c.style.height);
		var h2 = this_c.contentWindow.document.body.scrollHeight+30;
		//alert(h+":"+h2);
		if(!isNaN(h) && h>=h2){
		}else{
			this_c.style.height=h2+'px';
		}
	}catch(e){
	}
	if(sc_t==1){
		top.document.documentElement.scrollTop = sc
	}else if(sc_t==1){
		top.document.body.scrollTop = sc;
	}
	
}