function isInserted(msg) {
	if(arguments.length > 1) {
		for(i=1; i<arguments.length; i++) {
			if(arguments[i] && arguments[i].value.replace(/ /g, '') == '') {
				if(msg != '') {				
					alert(msg + ' 입력하세요');			
				}			
			arguments[i].focus();			
			return false;		
			}	
		}
	}
	return true;
}

function down_file(filefullpath){
	location.href='/common/inc/download_file.asp?FilePath='+filefullpath
}
//iframe resize
function iframe_resize(id){

	parent.document.getElementById(id).height=document.body.scrollHeight ;
}
var ckflag
//전체선택 전체 해제
function ChkAll(check) {
	var frm=document.frm;
    for(i = 0; i < frm.elements.length; ++i) {
		var ele=frm.elements[i];
       if(ele.name == 'cklist' && ele.disabled != true){
			ele.checked = check;
		}
    }
}

function gotop(){
	//location.href="#gotop"
	document.getElementById("gotop").focus();
}
//전체선택
function check_all() {
	if (!ckflag){
		ckflag = true ;
	} else{
	ckflag = false ;
	}
	ChkAll(ckflag);
}

//컨텐츠 프린트
function gFunc_Print(){
	
	//window.open("../../other/pop_print.asp","pop_gPrint","width=822,height=606")
	window.open("../../other/pop_print_contents.asp","pop_gPrint","width=847,height=606,scrollbars=yes")
	
}
//박물관 컨텐츠 프린트
function gFunc_Museum_Print(){
	
	window.open("../../other/pop_museum_print_contents.asp","pop_gPrint","width=847,height=606,scrollbars=yes")
}


//메일발송팝업
function gFunc_MailSend(url){
	window.open("../../other/pop_email_send.asp?url="+url+"","pop_gEmail","width=504,height=484")
}

function pop_rss(n){
	if (n == 1){
		window.open("../../other/pop_rss_report.asp","pop_rss","width=450,height=234")
	}else{
		window.open("../../other/pop_rss_focus.asp","pop_rss","width=450,height=234")
	}
}

	//로그인유무
	function islogin(uID){
		
		if (uID == ""){
			if (confirm("로그인하시겠습니까?")){
				document.frm.action = "../../other/login.asp";
				document.frm.submit();
				return false;
			}
		}else{
			return true;
		}

	}
function chkNumber(objectX) {
	e = window.event; //윈도우의 event를 잡는것입니다. 그냥 써주심됩니당.

	if(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode == 8 || e.keyCode == 46 || e.keyCode == 9 || e.keyCode >= 37 && e.keyCode <= 40 || e.keyCode == 17 || event.ctrlKey && e.keyCode == 67 || event.ctrlKey && e.keyCode == 86 || event.ctrlKey && e.keyCode == 88 || e.keyCode >= 33 && e.keyCode <= 36) {
	}
	else{ //숫자가 아니면 넣을수 없다.
		e.returnValue=false;
	}
}



//콤마찍기
function func_Comma(n){
	if(isNaN(n) || n.length == 0) return "";

	var sRetVal = "";
	var sTmpVal = "";
	var sFractionVal = "";

	intNum = n.toString();
	intNum = intNum.replace(/,/g,"")
	var ILength = intNum.search(/\./);

	if (ILength < 0) 
	{
		ILength = intNum.length;
	}else{
		sFractionVal = intNum.substr(ILength);
		ILength = ILength;
	}

	var IRemainder = ILength %3;
	if (IRemainder == 0 && ILength > 0) IRemainder = 3;
	
	sRetVal = intNum.substr(0,IRemainder);

	while(IRemainder < ILength) {
		sTmpVal = sTmpVal + "," + intNum.substr(IRemainder,3);
		IRemainder += 3;
	}
	sRetVal = sRetVal + sTmpVal + sFractionVal;
	return sRetVal;

}

//부가세
function Set_Sal_Sum(n) {

 var SAL_AMT   = n;
 var SAL_PRICE = 0;
 var SAL_VAT   = 0;


 
  //SAL_VAT   = ((SAL_AMT/1.1)*0.1);    // 부가세(VAT)
  SAL_VAT	= SAL_AMT * 0.1

  SAL_PRICE = Math.round(SAL_AMT - SAL_VAT); // 단가(반올림)
  SAL_VAT   = Math.round(SAL_VAT);    // 부가세(반올림)
 
  return SAL_VAT;

} 
