/**
 * 팝업창
 * @return
 */
function pophelp()
{
    window.open('../ccenter/help-search.php','help','toolbar=no,status=no,width=635,height=700,directories=no,scrollbars=yes,location=(left,top),resizable=no,menubar=no');
}

function frmSearchHistory(val, pg)
{
    if (!pg) pg = 1;
    frmSearch.search.value = val;
    if (pg) frmSearch.page.value = pg;
    frmSearch.submit();
}

function categorySubMenu(groupId, imgId)
{
    var group = document.getElementById(groupId);
    imgId = eval("document." + imgId);
    if (group)
    {
        if (group.style.display == '')
        {
            group.style.display = 'none';
            imgId.src = "../imgs/tree_off.gif";
        }
        else
        {
            group.style.display = '';
            imgId.src = "../imgs/tree_on.gif";
        }
    }
}

function OpenSubMenu(id)
{
    var group = document.getElementById("tr_" + id);
    imgId = eval("document.im_" + id);
    if (group)
    {
        group.style.display = '';
        imgId.src="../imgs/tree_on.gif";
    }
}

function in_array(val, arr)
{
    jj = arr.length;
    for (ii = 0; ii < jj; ii++)
    {
        if (arr[ii] == val)
        {
            return true;
            break;
        }
    }
    return false;
}

function frmSearchCategory(keyword, ccode, address, type)
{
    if(keyword.length > 0)
    {
        frmSearch.search.value = keyword;
        frmSearch.category_code.value = ccode;
        frmSearch.category_address.value = address;
        frmSearch.category_type.value = type;
        frmSearch.submit();
    }
}

function changeSearchSite(site)
{
    switch (site)
    {
        case "imageclick":
            frmSearch.optPriceBand[0].checked = true;
            frmSearch.optAlamy.value = "";
            frmSearch.submit();
            break;
        case "imageclick-low":
            frmSearch.optPriceBand[3].checked = true;
            frmSearch.optAlamy.value = "";
            frmSearch.submit();
            break;
        case "alamy":
            frmSearch.optAlamy.value = "on";
            frmSearch.submit();
            break;
    }
}

function more_history()
{
    ch_menu_id="more_history";
    var obj = document.getElementById(ch_menu_id);
    if(obj)
    {
        if(obj.style.display == '')
      obj.style.display = 'none';
        else
            obj.style.display = '';
    }
}

