/* ----------------------------------------------------------------------------
 * find_box.js
 * 検索条件入力フォーム管理js
 * 
 * CREATED:			2007.06.05
 * LAST MODIFIED:	2007.06.05
 * 
 * Copyright (C) 2007 ACTOR,co,ltd. Allrights Reserved.
 * ------------------------------------------------------------------------- */

function toggleDetail()
{
	var iconOpen = $('iconDetailOpen');
	var iconClose = $('iconDetailClose')
	var detailArea = $('detail_condition');
	
	var inputAge = $(IDX_AGE);
	var inputST = $(IDX_SALARY_TYPE);
	var inputKeyword = $(IDX_KEYWORD);
	
	if (detailArea.style.display == '')
	{
		iconOpen.style.display = '';
		iconClose.style.display = 'none';
		detailArea.style.display = 'none';
		
//		inputAge.disabled = true;
		inputST.disabled = true;
		inputKeyword.disabled = true;
	}
	else
	{
		iconOpen.style.display = 'none';
		iconClose.style.display = '';
		detailArea.style.display = '';
		
//		inputAge.disabled = false;
		inputST.disabled = false;
		inputKeyword.disabled = false;
	}
	
	return false;
}

function clearCondition()
{
	A1A2Reset();
	$(IDX_PREF).selectedIndex = 0;
	$(IDX_EMPLOY_TYPE).selectedIndex = 0;
	
	$(IDX_KEYWORD).value = '';
//	$(IDX_AGE).selectedIndex = 0;
	$(IDX_SALARY_TYPE).selectedIndex = 0;
	$(IDX_SALARY_TYPE).onchange();
	
	$(IDX_NEW_INFO).checked = false;
	$(IDX_BEGINNER).checked = false;
	$(IDX_HURRY).checked = false;
//	$(IDX_PICTURE).checked = false;
	
	return false;
}

function changeOrder(orderKey)
{
	$(IDX_ORDER + "_H").value = orderKey;
	$('find_box_form').submit();
	
	return false;
}

function changePerPage(per_page)
{
	$(IDX_PER_PAGE + "_H").value = per_page;
	$('find_box_form').submit();
}

function find_by_pref(pref_id)
{
	clearCondition();
	$(IDX_PREF).selectedIndex = pref_id;
	$('f').submit();
}

function find_by_a2(a2_id)
{
	var a1_id = $F(IDX_A1);
	
	clearCondition();
	$("A2_SELECT_" + (a1_id)).value = a2_id;
	$('f').submit();
}

function changePage(page)
{
	$(IDX_PAGE).value = page;
	$('find_box_form').submit();
	
	return false;
}
