function setJob(jobInit, positionInit, fieldInit, selJob, selPosition, selField){
	selectJNo = -1;
	selectPNo = -1;
	selectFNo = -1;
	f = document.forms[1];

	//セレクトボックス「職業」欄に、配列JNの値をセットし、value値に配列JVの値をセットする。
	f[selJob].options.length = JN.length + 1;
	for(i = 0; i < JN.length; i++){
		f[selJob].options[i + 1].text = JN[i];
		f[selJob].options[i + 1].value = JV[i];
		if(JV[i] == jobInit){
			f[selJob].selectedIndex = i + 1;
			selectJNo = i;
		}
	}
	if(selectJNo == -1){
		f[selJob].selectedIndex = 0
	}

	//セレクトボックス「役職」欄に、配列PNの値をセットし、value値にPVの値をセットする。
	if(selectJNo != -1){
		f[selPosition].options.length = PN[selectJNo].length + 1;
		for(j = 0; j < PN[selectJNo].length; j++){
			f[selPosition].options[j+1].text = PN[selectJNo][j];
			f[selPosition].options[j+1].value = PV[selectJNo][j];
			if(PV[selectJNo][j] == positionInit){
				f[selPosition].selectedIndex = j + 1;
				selectPNo = j;
			}
		}
	}else{
		f[selPosition].selectedIndex = 0;
		f[selPosition].disabled = true;
	}

	//セレクトボックス「分野」欄に、配列FNの値をセットし、value値にFVの値をセットする。
	if(selectPNo != -1){
		f[selField].options.length = FN[selectJNo][selectPNo].length + 1;
		for( k = 0; k < FN[selectJNo][selectPNo].length; k++){
			f[selField].options[k + 1].text = FN[selectJNo][selectPNo][k];
			f[selField].options[k + 1].value = FV[selectJNo][selectPNo][k];
			if(FV[selectJNo][selectPNo][k] == fieldInit){
				f[selField].selectedIndex = k + 1;
				selectFNo = k;
			}
		}
		
		if(selectFNo != -1 && f[selField].options[selectFNo+1].value == ""){
			f[selField].selectedIndex = 0;
			f[selField].disabled = true;		
		}						
	}else{
		f[selField].selectedIndex = 0;
		f[selField].disabled = true;
	}
}


function changeJob(selJob,selPosition,selField){
	f = document.forms[1];

	selectJNo = f[selJob].selectedIndex - 1;

	//セレクトボックス「役職」の設定
	if(selectJNo == -1){
		f[selPosition].options.length = 1;
		f[selPosition].disabled = true;
	}else{

		f[selPosition].options.length = PN[selectJNo].length + 1;

		f[selPosition].disabled = false;
		for( j = 0; j < PV[selectJNo].length; j++){
			f[selPosition].options[j + 1].text = PN[selectJNo][j];
			f[selPosition].options[j + 1].value = PV[selectJNo][j];
		}
	}

	f[selPosition].selectedIndex = 0;

	//「分野」の設定
	f[selField].options.length = 1;
	f[selField].selectedIndex = 0;
	f[selField].disabled = true;

}


function changePosition(selJob,selPosition,selField){
	f = document.forms[1];

	selectJNo = f[selJob].selectedIndex - 1;
	selectPNo = f[selPosition].selectedIndex - 1;
	
	//セレクトボックス「分野」の設定
	if(selectPNo == -1){
		f[selField].options.length = 1;
		f[selField].disabled = true;
	}else{
		f[selField].options.length = FN[selectJNo][selectPNo].length + 1;
		if(FN[selectJNo][selectPNo].length > 1) {
			f[selField].disabled = false;
			for(j = 0; j < FV[selectJNo][selectPNo].length; j++){
				f[selField].options[j + 1].text = FN[selectJNo][selectPNo][j];
				f[selField].options[j + 1].value = FV[selectJNo][selectPNo][j];
			}
		} else {
			f[selField].disabled = true;
		}
	}
	
	f[selField].selectedIndex = 0;

}


