 
 function findInsertChk(){
   var frm = document.form;
    
  if(frm.sido.value=="0" || frm.sido.value==""){
    alert('½Ãµµ¸¦ ¼±ÅÃÇÏ½Ê½Ã¿ä.');
    frm.sido.focus();
    return;
  }
  if(frm.gugun.value=="" || frm.gugun.value=="0"){
    alert('½Ã±º±¸¸¦ ¼±ÅÃÇÏ½Ê½Ã¿ä.');
    frm.gugun.focus();
    return;
  }
  if(!frm.buy_type[0].checked && !frm.buy_type[1].checked && !frm.buy_type[2].checked && !frm.buy_type[3].checked && !frm.buy_type[4].checked && !frm.buy_type[5].checked && !frm.buy_type[6].checked && !frm.buy_type[7].checked && !frm.buy_type[8].checked && !frm.buy_type[9].checked){
    alert('°Å·¡À¯ÇüÀ» ¼±ÅÃÇÏ½Ê½Ã¿ä.');
    frm.buy_type[0].focus();
    return;
  }
  
  if(frm.phone.value.length<4){
    alert('¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
    frm.phone.focus();
    return;
  }
  
  if(frm.title.value.length<4){
    alert('Á¦¸ñÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
    frm.title.focus();
    return;
  }
  
  frm.content.value = SubmitHTML();
  if(frm.content.value== false){
    alert('³»¿ëÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
    gsEditor.focus();
    return;
  }
  document.getElementById('submit_btn').disabled='true';
	frm.submit();
 }



 function sido_select(dt){
   var frm = document.form;
   
   if(dt==1){
     frm.gugun.options.length = 1;
     frm.gugun.options[0].selected = true; 
     frm.gugun.options[0].text = "½Ã±º±¸¼±ÅÃ";
     frm.dong.options.length = 1;
     frm.dong.options[0].selected = true; 
     frm.dong.options[0].text = "À¾¸éµ¿¼±ÅÃ";
     frm.bname.options.length = 1;
     frm.bname.options[0].selected = true; 
     frm.bname.options[0].text = "ÇØ´ç´ÜÁö¼±ÅÃ";
   }
   if(dt==2){
     frm.dong.options.length = 1;
     frm.dong.options[0].selected = true; 
     frm.dong.options[0].text = "À¾¸éµ¿¼±ÅÃ";
     frm.bname.options.length = 1;
     frm.bname.options[0].selected = true; 
     frm.bname.options[0].text = "ÇØ´ç´ÜÁö¼±ÅÃ";
   }
   if(dt==3){
     frm.bname.options.length = 1;
     frm.bname.options[0].selected = true; 
     frm.bname.options[0].text = "ÇØ´ç´ÜÁö¼±ÅÃ";
   }
   
   document.getElementById('sido_ifr').src = "addr_api.html?find_id="+frm.find_id.value+"&ksido="+frm.sido.options[frm.sido.selectedIndex].value+"&kgugun="+frm.gugun.options[frm.gugun.selectedIndex].value+"&kdong="+frm.dong.options[frm.dong.selectedIndex].value+"&kbname="+frm.bname.options[frm.bname.selectedIndex].value; 
   return true; 
 }

  function findPrint(find_id,id){
     var left=(screen.width-700)/2;
     var top=(screen.height-650)/2;
     option = "left="+left+", top="+top+", width=700, height=650 , marginwidth=0,marginheight=0,menubar=no,resizable=0,scrollbars=yes";
	   window.open('',"find_print",option);
     var form = document.win_sideview;
     form.method = 'post';
     form.action = "print.html?find_id="+find_id+"&id="+id;
     form.target = 'find_print';
     form.submit();
  }

  function findState(find_id,id){

     var left=(screen.width-450)/2;
     var top=(screen.height-370)/2;
     option = "left="+left+", top="+top+", width=450, height=370 , marginwidth=0,marginheight=0,menubar=no,resizable=0,scrollbars=no";
	   window.open('',"find_state",option);
	   var form = document.win_sideview;
     form.method = 'post';
     form.action = "request.html?request_code=1301&new_win=y&id="+id+"&find_id="+find_id;
     form.target = 'find_state';
     form.submit();
  }

  function findRepleState(find_id,join_id,id){
     var left=(screen.width-450)/2;
     var top=(screen.height-370)/2;
     option = "left="+left+", top="+top+", width=450, height=370 , marginwidth=0,marginheight=0,menubar=no,resizable=0,scrollbars=no";
	   window.open('',"find_reple_state",option);
	   var form = document.win_sideview;
     form.method = 'post';
     form.action = "request.html?request_code=1302&new_win=y&id="+id+"&find_id="+find_id+"&join_id="+join_id;
     form.target = 'find_reple_state';
     form.submit();
  }
  
 function calcHeight(FrameName) 
 { 
    if(document.all) { 
            var the_height = frames[FrameName].document.body.scrollHeight; 
        } else { 
         var the_height= document.getElementById(FrameName).contentWindow.document.body.offsetHeight; 
        } 
  document.getElementById(FrameName).height=the_height+30; 
 }


 function findDelete(id){
   var frm = document.return_form;
   if(confirm('Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')){
   }else{
     return;
   }
   frm.method='post';
   frm.action='delete.html';
	 frm.submit();
 }

 function findSearchIndex(){
   var frm = document.form;
   
   if(frm.find_id.value==""){
     alert('¸Å¹°Á¾·ù¸¦ ¼±ÅÃÇÏ¼¼¿ä.');
     frm.find_id.focus();
     return false;
   }
   frm.submit();
   
 }

 function sido_select_submit(code,str){
   var frm = document.form;
   if(code=='sido'){
     frm.sido.value = str;
     frm.gugun.value = '';
     frm.dong.value = '';
     frm.bname.value = '';
     frm.un.value = '';
    }
    if(code=='gugun'){
     frm.gugun.value = str;
     frm.dong.value = '';
     frm.bname.value = '';
     frm.un.value = '';
    }
    if(code=='dong'){
     frm.dong.value = str;
     frm.bname.value = '';
     frm.un.value = '';
    }
    if(code=='bname'){
     frm.bname.value = str;
     frm.un.value = '';
    }
    if(code=='un'){
     frm.un.value = str;
    }
    frm.submit();
 }
 
 function search_submit(){
   var frm = document.form;
   frm.submit();
 }

///////////////////////////////////////////////////////////////////////////////

 function repleInsertChk(){
   var frm = document.repleForm;
   if(frm.reple_content.value== false){
    alert('³»¿ëÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
    frm.reple_content.focus();
    return;
   }
  document.getElementById('repleSubmitBtn').disabled='true';
	frm.submit();
 }

 function findRepleDelete(reple_id){
   var frm = document.repleForm;
   if(confirm('Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?')){
   }else{
     return;
   }
   frm.reple_id.value = reple_id;
   
   frm.method = 'post';
   frm.action = 'delete_reple.html';
   frm.target = 'delete_reple_ifr';
	 frm.submit();
 }
///////////////////////////////////////////////////////////////////////////////


function findModal(key,find_id,id){
	var width,height,filename;

	switch(key){
		case 1: // print
			width = 700; height = !os ? 600 : 680; filename = 'print.html?find_id='+find_id+'&id='+id;
		break;

		case 2: // state
			width = 450; height = !os ? 400 : 360; filename = 'state.html?find_id='+find_id+'&id='+id;
		break;

		case 3: // reple_edit
			width = 680; height = !os ? 370 : 340; filename = 'reple_edit.html?find_id='+find_id+'&id='+id;
		break;

 }
 //if(!os)
	//  obj = window.showModalDialog(filename,self,"dialogWidth="+width+"px;dialogHeight:"+height+"px; center:true; status:no; resizable:no; scroll:no; ");
 //else
    obj = window.open(filename,'gs_find_modal','staus=no, width='+width+', height='+height+',scrollbars=yes,toolbar=no,menubar=no');
    
}


 function textareaHeight(type,id)
 {
    var tmp_h = document.getElementById(id).style.height;
    var tmp_i = parseInt(tmp_h);
		h1 = 500;
		h2 = 90;
		h3 = 90; //ÇÑ´Ü°è°ª
		if(type=='down') tmp_size = (h1 > tmp_i) ? tmp_i + h3 : h1;
    if(type=='up')  tmp_size = (h2 < tmp_i) ? tmp_i - h3 : h2;
    
    document.getElementById(id).style.height = tmp_size;
 }


 function findRepleEdit(find_id,reple_id)
 {
  document.getElementById('reple_ifr_'+reple_id).src = 'reple_edit.html?find_id='+find_id+'&reple_id='+reple_id;
 }

 function findPaging(page){
   var frm = document.form;
   frm.page_no.value = page;
   frm.submit();
 }
 
function menu(name)
{
  var old='';

	submenu=document.getElementById('submenu_'+name).style;
	if(old!=submenu)
	{
		if(old!='')
		{
			old.display='none';
		}
		submenu.display='block';
		old=submenu;
	}
	else
	{
		submenu.display='none';
		old='';
	}
}

// browser
 var ostmp = navigator.appName.charAt(0);
 os = (ostmp=='M') ? '' : 1;
 
function loginPlz()
{
  alert('·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
  return;
}

function agencyPlz()
{
  alert('ºÎµ¿»êÁß°³¾÷¼Ò È¸¿ø¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
  return;
}

function accountPlz()
{
  alert('À¯·á È¸¿ø¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.');
  return;
}

function no_iframes(){
 var frames_name = parent.frames.length;
 //alert(frames_name);
 if(frames_name!=0) top.location.href='/help/error.html?error_code=1101';
}


function img_view(name){
  var url = '/editor/img_view.php?name='+name;
  window.open(url,'img_view','width=500,height=400,toolbar=no,status=no,scrollbars=yes');
}
