function new_js_get_cat(sub_cat_id, sub_cat_title){

        document.getElementById("sub_cat_id").value = sub_cat_id;
        document.getElementById("sub_cat_title").value = sub_cat_title;
        document.getElementById("page").value = "";
        document.getElementById("total_page").value = "";
        document.getElementById("input_form").submit();
    
}
function new_expand_sub(obj, cat_id){
    var real_obj = obj.nextSibling.nextSibling;
    if (real_obj.style.display == "block"){ real_obj.style.display = "none";}
    else{real_obj.style.display = "block";}
    document.input_form.cat_id.value = cat_id;
}

function new_js_get_area(area_id, select_id){
    document.input_form.area_id.value = area_id;
    document.input_form.select_id.value = select_id;
    document.input_form.submit();
}

function new_real_view_detail(val){
    document.input_form.ccid.value = val;
    document.input_form.submit();
}
function new_view_detail(val){
    document.input_form.ccid.value = val;
    document.input_form.submit();
}
function yp_set_page_num(page_val, total_page_val){
    document.input_form.page.value = page_val;
    document.input_form.total_page.value = total_page_val;
    document.input_form.submit();
}

function new_real_js_get_cat(aid, atitle){
    document.input_form.ccid.value = "";
    document.input_form.page.value = "";
    document.input_form.total_page.value = "";
    document.input_form.cat_id.value = aid;
    document.input_form.submit();
}
function new_real_search_company(){
     var getStr = "";
    
     var company_name = document.getElementById("company_txt").value;
     if (company_name != ''){
      getStr = "new_real.php?cname=" + company_name;
     self.location.replace(getStr);
     }
     
}
    
function new_search_company(){
     var getStr = "";
    
     var company_name = document.getElementById("company_txt").value;
     if (company_name != ''){
      getStr = "new_yp.php?cname=" + company_name;
     self.location.replace(getStr);
     }
     
}

function new_checkEnter(e){ //e is event object passed from function invocation
var characterCode //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
new_search_company(); //submit the form
return false
}
else{
return true
}

}


function real_new_checkEnter(e){ //e is event object passed from function invocation
var characterCode //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
new_real_search_company(); //submit the form
return false
}
else{
return true
}

}

