// JavaScript Document

function SelectChange(ObjChildField , ParentValue , ObjParentArray , ObjChildArray)
{
	var thisField = document.getElementById(ObjChildField);
	for(var aa = thisField.length; aa > 0; aa--)
	{
		thisField.remove(aa);
	}
	thisField.options[0] = new Option("-选择工作职位-" , "");
	if(ParentValue != "")
	{
		for(aa = 0; aa < ObjParentArray.length; aa++)
		{
			if(ObjParentArray[aa] == ParentValue)
			{
				thisField.options[1] = new Option(ObjParentArray[aa]+"-不限" , "不限");
				for(var ii = 0; ii < ObjChildArray[aa].length; ii++)
				{
					thisField.options[ii + 2] = new Option(ObjChildArray[aa][ii][0], ObjChildArray[aa][ii][1]);
				}
			}
		}

	}
}
function InitPosition(ObjPosition_bField , ObjPosition_sField , ObjArray_b , ObjArray_s , str_b , str_s)
{
	var thisField_b = document.getElementById(ObjPosition_bField);
	var thisField_s = document.getElementById(ObjPosition_sField);
	
	thisField_b.options[0] = new Option("-选择工作职能-" , "");
	for(var i = 0; i < ObjArray_b.length; i++)
	{
		thisField_b.options[i+1] = new Option(ObjArray_b[i] , ObjArray_b[i]);
		if(ObjArray_b[i] == str_b)
			thisField_b.options[i+1].selected = true;
	}
	
	thisField_s.options[0] = new Option("-选择工作职位-" , "");
	if(str_b != "")
	{
		for(i = 0; i < ObjArray_b.length; i++)
		{
			if(ObjArray_b[i] == str_b)
			{
				thisField_s.options[1] = new Option(ObjArray_b[i]+"-不限" , "不限");
				if(str_s == "不限")
					thisField_s.options[1].selected = true;
				for(var ii = 0; ii < ObjArray_s[i].length; ii++)
				{
					thisField_s.options[ii + 2] = new Option(ObjArray_s[i][ii][0], ObjArray_s[i][ii][1]);
						if(ObjArray_s[i][ii][1] == str_s)
							thisField_s.options[ii + 2].selected = true;
				}
			}
		}

	}
}