function returnObject(frmIndex,eleIndex,errMessage){
	if(errMessage!='')
		alert(errMessage);
	document.forms[frmIndex].elements[eleIndex].focus();
}

function submitFrm(frmIndex){
	document.forms[frmIndex].submit();
}

function chkKeydown()
{
	if(event.keyCode ==13)//enter
	{
		searchFrm();
	}    
}

function checkAll(frmIndex){
	var totalCount=document.forms[frmIndex].chkID.length;	
	if(totalCount>1){
		if(document.forms[frmIndex].chkID[0].checked){
			for(i=0;i<totalCount;i++){
				document.forms[frmIndex].chkID[i].checked=false;
			}
		}else{
			for(i=0;i<totalCount;i++){
				document.forms[frmIndex].chkID[i].checked=true;
			}
		}
	}else{
		if(document.forms[frmIndex].chkID.checked)
			document.forms[frmIndex].chkID.checked=false;
		else
			document.forms[frmIndex].chkID.checked=true;
	}
	return;
}

function checkAllS(frmIndex){
	var totalCount=document.forms[frmIndex].chkID.length;
	var nChkID;
	if(totalCount>1){
		if(document.forms[frmIndex].CACheckBox.checked){
			for(i=0;i<totalCount;i++){
				nChkID=document.forms[frmIndex].chkID[i];
				if(nChkID.disabled==true){
					nChkID.checked=false;
				}else{
					nChkID.checked=true;
				}
			}
		}else{
			for(i=0;i<totalCount;i++){
				nChkID=document.forms[frmIndex].chkID[i];
				nChkID.checked=false;
			}
		}
	}else{
		if(document.forms[frmIndex].CACheckBox.checked){
			nChkID=document.forms[frmIndex].chkID;
			if(nChkID.disabled==true){
				nChkID.checked=false;
			}else{
				nChkID.checked=true;
			}
		}else{
			document.forms[frmIndex].chkID.checked=false;
		}
	}
	return;
}

function movePage(mPage,sURL){
	//setValue();
	document.actFrm.action=sURL;
	document.actFrm.nowPage.value=mPage;
	document.actFrm.submit();
}

function chkMove(mPage,totalPage,sURL){
	if(mPage.value==''){
		alert("ÆäÀÌÁö ¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		mPage.focus();
		return;
	}
	if(mPage.value*1>totalPage*1){
		alert("ÀÌµ¿ÇÏ·Á´Â ÆäÀÌÁö ¹üÀ§¸¦ ³Ñ¾î¼¹½À´Ï´Ù");
		mPage.focus();
		return;
	}
	//setValue();
	document.actFrm.action=sURL;
	document.actFrm.nowPage.value=mPage.value;
	document.actFrm.submit();
}

function openWin(oURL,wwidth,wheight){
	window.open(oURL,"openWindow","left=500,top=300,width="+wwidth+",height="+wheight+",scrollbars=no,resizable=no,menubar=no,status=no,toolbar=no,location=no");
}


function openWinS(oURL,wwidth,wheight){
	window.open(oURL,"openWindow","left=0,top=0,width="+wwidth+",height="+wheight+",scrollbars=no,resizable=yes,menubar=no,status=no,toolbar=no,location=no");
}

function dataClear(i){
	opener.document.actFrm.applyData1.value='';
	opener.document.actFrm.applyData2.value='';
	opener.document.actFrm.applyData3.value=''; 
	opener.document.actFrm.applyData4.value='';
	opener.document.actFrm.applyData5.value='';
	opener.document.actFrm.applyType[i].checked=true;
}


// for Publishing Tool
function OpenWin(URL,WinName,x,y,Menu,cSize,scroll) 
{
	var features;
	
	var nTop = (screen.height - y) / 2 - 30;
	var nLeft = (screen.width - x) / 2;
	
	if (Menu == 0 )
		features = "toolbar=no,width=" + x + ",height=" + y + ",top=" + nTop + ",left=" + nLeft + ",status=no,menubar=no";
	else
		features = "toolbar=no,width=" + (x + 18) + ",height=" + y + ",top=" + nTop + ",left=" + nLeft + ",status=no,menubar=yes";
	
	if (cSize == 0)  
		features = features + ",resizable=no";
	else
		features = features + ",resizable=yes"; 
	
	if (scroll == 0 )
		features = features + ",scrollbars=no";
	else
		features = features + ",scrollbars=yes";
	
	//alert(features);
	
	TheWindow = window.open(URL, WinName, features);
}

// ÁöÁ¤ ¹üÀ§¸¦ ¹þ¾î³¯ °æ¿ì ½ºÅ©·Ñ¹Ù°¡ »ý±ä´Ù.
function ResizePopup_Size() 
{
	window.resizeTo(10, 10);

	var scrollHeight = document.body.scrollHeight;

	var clientHeight = document.body.clientHeight;

	if( scrollHeight > 600 )

	{

	// ½ºÅ©·Ñ¹Ù°¡ »ý±æ ½Ã ³Êºñ,³ôÀÌ Á¶Á¤

	document.body.scroll = "yes"

	window.resizeTo(document.body.scrollWidth, 600);

	window.resizeBy(document.body.scrollWidth - document.body.clientWidth, 0);

	}

	else

	{
	// ½ºÅ©·Ñ¹Ù°¡ ¾øÀ» °æ¿ì ³ôÀÌ Á¶Á¤
	
	document.body.scroll = "no"
	
	window.resizeBy(document.body.scrollWidth - document.body.clientWidth, scrollHeight - clientHeight);	

	}

}


