//跳转菜单
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//弹出窗口
function newin (url,w,h){
	window.open(url,"","toolbar=no,width="+w+",height="+h+",directories=no,status=no,scrollbars=no,resizable=no,menubar=no")
}

function FillSelect(Arr,DropList)
{
	//将一个特定的数组填充到一个下拉框中
	for( var i=0;i<Arr.length;i++){
		DropList.options[DropList.length]= new Option( Arr[i].areaName,Arr[i].id);
	}
	
}

function FillSelectByValue(Arr,DropList,Value)
{
	//将一个特定的数组填充到一个下拉框中
	FillSelect(Arr,DropList);
	DropList.value=Value;
	
}

//Arr,DropListParent,DorpListChild
function ChangeChild(Arr,DropListParent,DorpListChild)
{
	var pid;
	pid=DropListParent.value;
	DorpListChild.length = 0;
	for (var i in Arr)
	{
		if (Arr[i].parentId == pid){
			DorpListChild.options[DorpListChild.length] = new Option( Arr[i].areaName,Arr[i].id);		
		}
	}
}


function OnitParentChild(ArrParent,ArrChild,ParentValue,ChildValue,DropListParent,DorpListChild)
{
	
	FillSelectByValue(ArrParent,DropListParent,ParentValue);
	ChangeChild(ArrChild,DropListParent,DorpListChild);
	DorpListChild.value=ChildValue;
	
}

function OnitArea(ParentValue,ChildValue,DropListParent,DorpListChild)
{
	var ArrProv=[],ArrCity=[];

	for (var i=0;i<ArrArea.length ; i++ )
	{
		if(ArrArea[i].parentId==0){
			ArrProv[ArrProv.length]=ArrArea[i];
		}
		else{
			ArrCity[ArrCity.length]=ArrArea[i];
		}
	}


	OnitParentChild(ArrProv,ArrCity,ParentValue,ChildValue,DropListParent,DorpListChild);
}
