/* Common js 함수 ################################################################################*/
/* 팝업 */
/* 
	mypage : 팝업URL myname: 팝업이름
	w:가로길이, h:세로길이 scroll: 스크롤여부
*/
function WinPopup(mypage,myname, w, h,scroll) { //v2.0

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,scrollbars='+scroll+'';
	popWin = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		//popWin.window.focus();
	}
}
/* 팝업 사이즈 조절 */
/* 
	width:가로길이, height:세로길이 
*/
function popupsize(width,height)
{
	var divEl = document.createElement("div");
	divEl.style.position = "absolute";
	divEl.style.left = "0px";
	divEl.style.top = "0px";
	divEl.style.width = "100%";
	divEl.style.height = "100%";
	document.body.appendChild(divEl);
	window.resizeBy(width-divEl.offsetWidth, height-divEl.offsetHeight);
	document.body.removeChild(divEl);
}
/* Common js 함수 ################################################################################*/
// 레이어 open 
/*
item : item id 
*/
function divopen(item) {
	obj=document.getElementById(item);
	obj.style.display="";
}
// 레이어 close
/*
item : item id 
*/
function divclose(item) {
	obj=document.getElementById(item);
	obj.style.display="none";
}
function divopenclose(item,item1) {
	obj=document.getElementById(item);
	obj.style.display="";
	obj1=document.getElementById(item1);
	obj1.style.display="none";
}
function divopenclose1(num,tot) {
	
	for (i=1;i<tot+1;i++){
		var item ="item"+i		
		obj = document.getElementById(item);
		if (num==i)
		{
			obj.style.display="";
		}else{
			obj.style.display="none";
		}
	} 
}

function adjustIFrameSize(id) {
	var myIframe = document.getElementById(id);
	if (myIframe) {
		if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
				// W3C DOM (and Mozilla) syntax
				myIframe.height = myIframe.contentDocument.body.offsetHeight;
		} else if (myIframe.Document && myIframe.Document.body.scrollHeight) {
				// IE DOM syntax
				myIframe.height = myIframe.Document.body.scrollHeight;
				//alert(myIframe.height);
		}
	}
}
