// JavaScript Document

//마우스 이벤트 금지
//document.oncontextmenu = new Function("return false");
//document.ondragstart = new Function("return false");
//document.onselectstart = new Function("return false");

// 풍선말 버튼 띄우기 =======================================
function	balloon_btn(id_name, img_name, left)	{
	obj_T = document.getElementById('' + id_name + '');
	obj_img	= document.getElementById('' + id_name + '_img');
	obj_T.style.display	="block";
	obj_img.src="" + img_name + "";
	obj_T.style.left	="" + left + "px";
}

function	ballloon_hidden	(id_name)	{
	obj_T = document.getElementById('' + id_name + '');
	obj_T.style.display	="none";
}


// 풍선말 : 이미지도움말  =======================
function show_imgInfo(topV,leftV)	{
	var value_X= (88*leftV);
	var value_Y= (88*(topV-1));

	obj_B = document.getElementById('balloon_photo');

	obj_B.style.display="block";

	obj_B.style.top	=	(value_Y)-60 + "px";
	obj_B.style.left =	(value_X)-88 + "px";

}

function show_imgInfo2(topV,leftV)	{
	var value_X= (133*leftV);
	var value_Y= (112*(topV-1));

	obj_B = document.getElementById('balloon_photo');

	obj_B.style.display="block";

	obj_B.style.top	=	(value_Y)-55 + "px";
	obj_B.style.left =	(value_X)-111 + "px";

}

function hidden_imgInfo()	{
	obj_T = document.getElementById('balloon_photo');
	obj_T.style.display="none";
}



function show_calendar(topV,leftV)	{
	var value_X= (22*leftV);
	var value_Y= (22*(topV-1));

	obj_B = document.getElementById('calendar_balloon');

	obj_B.style.display="block";

	obj_B.style.top	=	(value_Y)-18 + "px";
	obj_B.style.left =	(value_X)-60 + "px";

}

function hidden_calendar()	{
	obj_T = document.getElementById('calendar_balloon');
	obj_T.style.display="none";
}


//PageOnload.add("bgPNGFix", "bg_ConBox");

// 셀렉트 레이어 ============================================
function select_view(id_name, inputV)	{

	obj_T	  = document.getElementById(''+ id_name + '');
	obj_input = document.getElementById(''+ id_name + '_input' + '');
	

	if	(obj_T.style.display=='none' || obj_T.style.display=='')	{
		obj_T.style.display='block';
		obj_T.style.zIndex='100'
	}
	else	{
		obj_T.style.display='none';
		if	(inputV != "")	{
			obj_input.value=inputV
		}
		obj_T.style.zIndex='3'
	}
}


// 레이어팝업닫기 ============================================
function layerClose(id_name)	{
	obj_T	  = document.getElementById(''+ id_name + '');		
	obj_T.style.display='none';
}

function goMenu(form, menunm, subnm, action_url){
	form.menunm.value = menunm;
	form.subnm.value = subnm;
	form.action = action_url;
	form.submit();
}


//namo 에디터에 기존 html세팅
function setDocument(form, objContents){
//nomo객체명은 고정
form.Wec.Value = objContents.value;
form.Wec.TemplateIniURL = "http:\\localhost:8080\namo\kor\template.ini"
}


function print_proc()
 {
       //var test = document.getElementById("print_btn_div");
	   //test.style.visibility="hidden";
       print();
	   //test.style.visibility="visible";
       
 }

//window open
function open_popup(m_url, m_title, width, height, menubar, scrollbars, left, top) {
 
		if (m_url == ""){
			alert("찾는 대상이 없습니다.");
		}else{
			if (left == "" && top == ""){
				add_parameter = "width="+width+",height="+height+",menubar="+menubar+",scrollbars="+scrollbars+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
			}else{
				add_parameter = "width="+width+",height="+height+",menubar="+menubar+",scrollbars="+scrollbars+",left="+left+",top="+top;
			}
			var wp
		
			wp = window.open(m_url, m_title, add_parameter);
			wp.focus();
		}
}


   

//select tag  text -> title value
function setTitle(){
	var frm = document.form1;
	var title = "";
	title = frm.category_no.options[frm.category_no.selectedIndex].text;
	if( frm.category_no.selectedIndex == 0 ){
		frm.title.value = "";
	}else{
		frm.title.value = title;
	}
}


function validNum(field){
	var valid = "1234567890"
    var isvalue = "true"  //
    var numvalue = field.value;
    var numvaluelen = numvalue.length;
    var temp
    for(var i=0; i<numvaluelen; i++){
        temp = "" + numvalue.substring(i, i+1)
        if(valid.indexOf(temp)=="-1"){ isvalue= "false" }
    }
    
	if( isvalue == 'false' ){
		alert('숫자만 입력 하십시요');
		field.focus();
		field.select();
		return;
	}

}


function windowPrint(){
	window.print();
}

function print_iframe(){
	document.view_iframe.focus();
	document.view_iframe.windowPrint();
}

function email_chk(){
	var frm = document.form1;
		/*if(chkValidateStr2(frm.email_01,'7')== false){
			alert("이메일은 한글을 사용할 수 없습니다.");
			frm.email_01.value="";
			return;
		}*/
}

function focus_mailtext()
	{
		document.form1.email_02.value= document.form1.sel_mail[document.form1.sel_mail.selectedIndex].value;
	}	


