/* ************************************************************************ */
/* 																	[TAB:4]	*/
/* 	Do-Entry JavaScript														*/
/* 																			*/
/* ************************************************************************ */

/****************************************************************************/
/*	入力エリアの初期値														*/
/****************************************************************************/
var defString = 'キーワードを入力してください。';
function inputComments(obj)
{
	if (obj.value == defString)
	{
		obj.value = "";
		obj.style.color = "#000000";
	}
}
function initComments(obj)
{
	if (obj.value == obj.defaultValue)
	{
		obj.style.color = "#000000";
	}
}


/****************************************************************************/
/*	入力エリアの初期値のチェック											*/
/****************************************************************************/
function submitCheck( objFrm ) 
{
	if (objFrm.keyword.value == defString)
	{
		objFrm.keyword.value = "";
	}
}

/****************************************************************************/
/*	データ検索																*/
/****************************************************************************/
function searchSubmit( objFrm , mode , act ) 
{
	with ( objFrm )
	{
		var prev_rm;
		var prev_action;
		if ( act )  { prev_action = action;   }
		if ( mode ) { prev_rm     = rm.value; }
		
		if ( mode ) { rm.value = mode; }
		if ( act )  { action   = act;  }
		
		submit();
		
		if ( mode ) { rm.value = prev_rm;     }
		if ( act )  { action   = prev_action; }
	}
}

/****************************************************************************/
/*	勤務地選択																*/
/****************************************************************************/
var ImgSv;
function initImageArray( imageArray )
{
	if(!ImgSv) ImgSv = new Array();
	var j = ImgSv.length;
	
	for(i=0; i <imageArray.length; i++)
	{
		var img = new Image();
		img.src = imageArray[i];
		ImgSv[j++] = img;
	}
}

// ----------------------------------------------------------------------------
function selectImage( val, mapid, img )
{
	if ( val == '') 
	{ 
		val = 0; 
	}
	else
	{
		val = parseInt(val,10);
	}
	
	if ( ! document.getElementById(mapid) ) { return; }
	document.getElementById(mapid).src = img[val];
}

// ----------------------------------------------------------------------------
function selectArea( id, val, mapid, img )
{
	if ( ! document.getElementById(id) ) { return; }
	document.getElementById(id).value = val;
	
	if ( ! document.getElementById(mapid) ) { return; }
	document.getElementById(mapid).src = img;
}

// ----------------------------------------------------------------------------
function feeling_init( objFrm )
{
	slider_set( 0 );
	document.getElementById('area_code_feeling').value = '';
}
// ----------------------------------------------------------------------------
function search_init()
{
	document.getElementById('industry_type').value = '';
	document.getElementById('service_category').value = '';
	document.getElementById('employment_system').value = '';
	document.getElementById('income').value = '';
	document.getElementById('area_id').value = '';
	document.getElementById('ignoring').checked = false;
	document.getElementById('newcheck').checked = false;
	document.getElementById('keyword').value = defString;
	document.getElementById('keyword').style.color = "#aaaaaa";
	
	selectArea('area_id',  '',   'area_map', '../../image/main/search/map.gif');
}
// ----------------------------------------------------------------------------
function search_init_list()
{
	document.getElementById('industry_type').value = '';
	document.getElementById('service_category').value = '';
	document.getElementById('employment_system').value = '';
	document.getElementById('income').value = '';
	document.getElementById('area_code').value = '';
	document.getElementById('ignoring').checked = false;
	document.getElementById('newcheck').checked = false;
	document.getElementById('keyword').value = defString;
	document.getElementById('keyword').style.color = "#aaaaaa";
}

/* ************************************************************************ */
/* 	確認ダイアログ															*/
/* ************************************************************************ */
function CheckDialog( str )
{
	if ( window.confirm( str + "します。よろしいですか？" ) ) 
	{
		return true;
	}
	return false;
}

/* ************************************************************************ */
/* 	入力チェック + Submit													*/
/* ************************************************************************ */
function inputCheck( objFrm )
{
	with ( objFrm )
	{
		with ( c_id ) 
		{
			if ( value == '' ) 
			{
				window.alert ( "会員IDを入力してください。" );
				focus();
				return false;
			}
		}
		with ( c_password ) 
		{
			if ( value == '' ) 
			{
				window.alert ( "パスワードを入力してください。" );
				focus();
				return false;
			}
		}
	}
	
	searchSubmit( objFrm );
	return true;
}

/* ************************************************************************ */
/* 	利用規約確認ダイアログ													*/
/* ************************************************************************ */
function kiyakuCheck( objFrm )
{
	with ( objFrm )
	{
		if (terms_of_use[1].checked)
		{
			window.alert ( "利用規約に同意されない場合、お申込みをお受けできません。" );
			return false;
		}
	}
	
	searchSubmit( objFrm );
	return true;
}

/* ************************************************************************ */
/* [EOF]																	*/
/* ************************************************************************ */
