function resizeFrame(iframeObj){
	var innerBody = iframeObj.contentWindow.document.body;
	oldEvent = innerBody.onclick;
	innerBody.onclick = function(){ resizeFrame(iframeObj, 1);oldEvent; };
	var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
	iframeObj.style.height = (innerHeight + 20) + 'px';
//	var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
//	iframeObj.style.width = innerWidth + 'px';    
	if( !arguments[1] )        /* 특정 이벤트로 인한 호출시 스크롤을 그냥 둔다. */
	this.scrollTo(0,0);
}

function openPopup(url,width,height) {	
	var sw=screen.width;
	var sh=screen.height;
	var px=(sw-width)/2;
	var py=(sh-height)/2;
	window.open(url,'_blank',"width=" + width + ",height=" + height + ",top=" + py + ",left=" + px + ",scrollbars=yes" ); 
}
function isEmail(str) {
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		return false
	 }
	 return true					
}

function historyBack() {
	history.go(-1);
}

function historyForward() {
	history.go(1);
}

function cancelAction(question, url) {
	if(typeof(question) == 'undefined') {
		question = true;
	}

	if(question) {
		if(confirm('작성하던 데이터는 저장되어지지 않습니다.\n\n취소하시겠습니까?')) {
			if(typeof(url) == 'undefined') {
				history.go(-1);
			} else {
				location.href = url;
			}
		}
	} else {
			if(typeof(url) == 'undefined') {
				history.go(-1);
			} else {
				location.href = url;
			}
	}
}
