
var CurrProvinceID = -1 ;

//生成省的select
//provinceID: 需要选中的省的值，如果没有，传入－1
//width：生成的select的宽度
function getProvinceSelect( provinceID , width )
{
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	
	var strProSelect ;
	strProSelect = "<select name='selProvince' style='width:" + width + "px;' onchange='showCity(this.value, -1)'>" ;
	if ( provinceID == -1 )
		strProSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strProSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strProvinceID.length ; i ++ )
	{
		if ( provinceID == strProvinceID[i] )
			strProSelect += "<option value=" + strProvinceID[i] + " selected>" + strProvinceName[i] + "</option>" ;
		else		
			strProSelect += "<option value=" + strProvinceID[i] + ">" + strProvinceName[i] + "</option>" ;
	}
	strProSelect += "</select>" ;
	
	return strProSelect ;
}

//生成市的select
//width：生成的select的宽度
function getCitySelect( width )
{
	var strCitySelect ;
	strCitySelect = "<select name='selCity' style='width:" + width + "px;' onchange='showUniversity(this.value, -1)'>" ;
	strCitySelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strCitySelect += "</select>" ;
	
	return strCitySelect ;
}

//生成大学的select
//width：生成的select的宽度
function getUniversitySelect( width )
{
	var strUniSelect ;
	strUniSelect = "<select name='selUniversity' style='width:" + width + "px;'>" ;
	strUniSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strUniSelect += "</select>" ;
	
	return strUniSelect ;
}

//显示某个省的城市
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1
function showCity( provinceID , cityID )
{
	if (! document.all.selCity)
	{
		alert("selCity is not exist");
		return ;
	}
	CurrProvinceID = provinceID ;

	//clear city
	for ( var i = 1 ; i < document.all.selCity.length ; i ++ )
	{
		document.all.selCity.options[1] = null;
		i -- ;
	}
	
	//clear university
	if ( document.all.selUniversity )
	{
		for ( var i = 1 ; i < document.all.selUniversity.length ; i ++ )
		{
			document.all.selUniversity.options[1] = null ;
			i -- ;			
		}
	}
	
	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		
		
	for ( var i = 0 ; i < strCityID.length ; i ++ )
	{
		var tempopt=new Option(strCityName[i],strCityID[i]);
		document.all.selCity.options[i + 1] = tempopt;
		if ( cityID == strCityID[i] )
			document.all.selCity.options[i + 1].selected = true;
	}
}

//显示某个城市的大学
//cityID: 城市ID
//uniID: 需要选中的大学的值，如果没有，传入－1
function showUniversity( cityID, uniID )
{
	if (! document.all.selUniversity)
	{
		//alert("selUniversity is not exist");
		return ;
	}

	for ( var i = 1 ; i < document.all.selUniversity.length ; i ++ )
	{
		document.all.selUniversity.options[1] = null;
		i -- ;
	}
	
	if ( CurrProvinceID == -1 || cityID == -1 )
		return ;
	
	var strPCID = CurrProvinceID + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
				
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		var tempopt=new Option(strUniName[i],strUniID[i]);
		document.all.selUniversity.options[i + 1] = tempopt;
		if ( uniID == strUniID[i] )
			document.all.selUniversity.options[i + 1].selected = true;
	}
}



//生成学科的select
//deptID: 需要选中的学科的值，如果没有，传入－1
//width：生成的select的宽度
function getDepartmentSelect( deptID , width )
{
	if (typeof(DeptID) == "undefined" ) 
	{
		return("not found DeptID info");		
	}

	var strDeptID = eval("DeptID.split(',')");
	var strDeptName = eval("DeptName.split(',')") ;
	
	var strDeptSelect ;
	strDeptSelect = "<select name='selDepartment' style='width:" + width + "px;' onchange='showSpeciality(this.value, -1)'>" ;
	if ( deptID == -1 )
		strDeptSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strDeptSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strDeptID.length ; i ++ )
	{
		if ( deptID == strDeptID[i] )
			strDeptSelect += "<option value=" + strDeptID[i] + " selected>" + strDeptName[i] + "</option>" ;
		else		
			strDeptSelect += "<option value=" + strDeptID[i] + ">" + strDeptName[i] + "</option>" ;
	}
	strDeptSelect += "</select>" ;
	
	return strDeptSelect ;
}


//生成专业的select
//width：生成的select的宽度
function getSepcialitySelect( width )
{
	var strSpeSelect ;
	strSpeSelect = "<select name='selSpeciality' style='width:" + width + "px;' >" ;
	strSpeSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strSpeSelect += "</select>" ;
	
	return strSpeSelect ;
}

//显示某个学科的专业
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1
function showSpeciality( deptID , speID )
{
	if (! document.all.selSpeciality)
	{
		alert("selSpeciality is not exist");
		return ;
	}

	//clear speciality
	for ( var i = 1 ; i < document.all.selSpeciality.length ; i ++ )
	{
		document.all.selSpeciality.options[1] = null;
		i -- ;
	}
	
	if ( deptID == -1 || deptID == 0 )
		return ;
		
	var strSpeID = eval("SpeID" + deptID + ".split(',')");
	var strSpeName = eval("SpeName" + deptID + ".split(',')") ;
		
		
	for ( var i = 0 ; i < strSpeID.length ; i ++ )
	{
		var tempopt=new Option(strSpeName[i],strSpeID[i]);
		document.all.selSpeciality.options[i + 1] = tempopt;
		if ( speID == strSpeID[i] )
			document.all.selSpeciality.options[i + 1].selected = true;
	}
}


//指定名称生成学科的select
//parentSelectName：学科select的名字
//childSelectName：专业select的名字
//deptID: 需要选中的学科的值，如果没有，传入－1
//width：生成的select的宽度
function getDepartmentSelectWithName( parentSelectName, childSelectName, deptID , width )
{
	if (typeof(DeptID) == "undefined" ) 
	{
		return("not found DeptID info");		
	}

	var strDeptID = eval("DeptID.split(',')");
	var strDeptName = eval("DeptName.split(',')") ;
	
	var strDeptSelect ;
	strDeptSelect = "<select name='" + parentSelectName + "' style='width:" + width + "px;' onchange='showSpecialityWithName( \"" + childSelectName + "\", this.value, -1)'>" ;
	if ( deptID == -1 )
		strDeptSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strDeptSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strDeptID.length ; i ++ )
	{
		if ( deptID == strDeptID[i] )
			strDeptSelect += "<option value=" + strDeptID[i] + " selected>" + strDeptName[i] + "</option>" ;
		else		
			strDeptSelect += "<option value=" + strDeptID[i] + ">" + strDeptName[i] + "</option>" ;
	}
	strDeptSelect += "</select>" ;
	
	return strDeptSelect ;
}


//指定名字生成专业的select
//selectName：专业select的名字
//width：生成的select的宽度
function getSepcialitySelectWithName( selectName, width )
{
	var strSpeSelect ;
	strSpeSelect = "<select name='" + selectName + "' style='width:" + width + "px;' >" ;
	strSpeSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strSpeSelect += "</select>" ;
	
	return strSpeSelect ;
}

//显示某个学科的专业
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1
function showSpecialityWithName( changingSelectName, deptID , speID )
{
	if (! document.all[changingSelectName])
	{
		alert( changingSelectName + " is not exist");
		return ;
	}		

	//clear speciality
	for ( var i = 1 ; i < document.all[changingSelectName].length ; i ++ )
	{
		document.all[changingSelectName].options[1] = null;
		i -- ;
	}
	
	if ( deptID == -1 || deptID == 0 )
		return ;
		
	var strSpeID = eval("SpeID" + deptID + ".split(',')");
	var strSpeName = eval("SpeName" + deptID + ".split(',')") ;
		
		
	for ( var i = 0 ; i < strSpeID.length ; i ++ )
	{
		var tempopt=new Option(strSpeName[i],strSpeID[i]);
		document.all[changingSelectName].options[i + 1] = tempopt;
		if ( speID == strSpeID[i] )
			document.all[changingSelectName].options[i + 1].selected = true;
	}
}



//////////////////
//生成大分类的select
//BigCatalogID: 需要选中的大分类的值，如果没有，传入－1
//width：生成的select的宽度
function getFriendSearchCatalogSelect( BigCatalogID , width )
{
	if (typeof(catalogID) == "undefined" ) 
	{
		return("not found catalogID info");		
	}
	var strCatalogID = eval("catalogID.split(',')");
	var strCatalogName = eval("catalogName.split(',')") ;
	
	var strFriendSearchSelect ;
	strFriendSearchSelect = "<select name='selFriendSearchCatalog' style='width:" + width + "px;' onchange='showFriendSearchClass(this.value, -1)'>" ;
	if ( BigCatalogID == -1 )
		strFriendSearchSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strFriendSearchSelect += 	"<option value=-1>--请选择--</option>" ;	

	for ( var i = 0 ; i < strCatalogID.length ; i ++ )
	{
		if ( BigCatalogID == strCatalogID[i] )
			strFriendSearchSelect += "<option value=" + strCatalogID[i] + " selected>" + strCatalogName[i] + "</option>" ;
		else		
			strFriendSearchSelect += "<option value=" + strCatalogID[i] + ">" + strCatalogName[i] + "</option>" ;
	}

	strFriendSearchSelect += "</select>" ;
	
	return strFriendSearchSelect ;
}

function getFriendSearchCatalogSelectNum( BigCatalogID , width ,row)
{
	if (typeof(catalogID) == "undefined" ) 
	{
		return("not found catalogID info");		
	}
	var strCatalogID = eval("catalogID.split(',')");
	var strCatalogName = eval("catalogName.split(',')") ;
	
	var strFriendSearchSelect ;
	strFriendSearchSelect = "<select name='selFriendSearchCatalog' style='width:" + width + "px;' onchange='showFriendSearchClass(this.value, -1)'>" ;
	if ( BigCatalogID == -1 )
		strFriendSearchSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strFriendSearchSelect += 	"<option value=-1>--请选择--</option>" ;	

	for ( var i = 0 ; i < strCatalogID.length && i<= row; i ++ )
	{
		if ( BigCatalogID == strCatalogID[i] )
			strFriendSearchSelect += "<option value=" + strCatalogID[i] + " selected>" + strCatalogName[i] + "</option>" ;
		else		
			strFriendSearchSelect += "<option value=" + strCatalogID[i] + ">" + strCatalogName[i] + "</option>" ;
	}

	strFriendSearchSelect += "</select>" ;
	
	return strFriendSearchSelect ;
}


//生成小分类的select
//width：生成的select的宽度
function getFriendSearchClassSelect( width )
{
	var strFriendSearchClassSelect ;
	strFriendSearchClassSelect = "<select name='selFriendSearchClass' style='width:" + width + "px;' >" ;
	strFriendSearchClassSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strFriendSearchClassSelect += "</select>" ;
	
	return strFriendSearchClassSelect ;
}

//显示某个学科的专业
//catalogID: 大分类ID
//classID: 需要选中的小分类的值，如果没有，传入－1
function showFriendSearchClass( catalogID , classID )
{
	if (! document.all.selFriendSearchClass)
	{
		alert("selFriendSearchClass is not exist");
		return ;
	}

	//clear speciality
	for ( var i = 1 ; i < document.all.selFriendSearchClass.length ; i ++ )
	{
		document.all.selFriendSearchClass.options[1] = null;
		i -- ;
	}
	
	if ( catalogID == -1 )
		return ;
		
	var strCatalogID = eval("catalogID" + catalogID + ".split(',')");
	var strCatalogName = eval("catalogName" + catalogID + ".split(',')") ;
		
		
	for ( var i = 0 ; i < strCatalogID.length ; i ++ )
	{
		var tempopt=new Option(strCatalogName[i],strCatalogID[i]);
		document.all.selFriendSearchClass.options[i + 1] = tempopt;
		if ( classID == strCatalogID[i] )
			document.all.selFriendSearchClass.options[i + 1].selected = true;
	}
}


/////////////////////////////////////////////////////////////////////


function getProvinceText( provinceID)
{
	
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	var strProSelect ;

	
	value = strProvinceName[provinceID-1];
	if (typeof(value)!= "undefined" ) 
	document.write("<a HREF='/dipian/jsp/search/search.do?selProvince="+provinceID+"' target='_blank' >"+value+"</a>");
		else value="";
		
		
	return value ;
}






function getCityText(provinceID,cityID)
{
		
	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		

	
	value = strCityName[cityID-1];
	if (typeof(value)!= "undefined" ) 
	document.write("<a HREF='/dipian/jsp/search/search.do?selCity="+cityID+"&selProvince="+provinceID+"' target='_blank' >"+value+"</a>");	
		else value="";
	
	return(value)

}


function getUniText(provinceID,cityID, uniID)
{
	if ( provinceID == -1 || cityID == -1 )
		return ;
	
	var strPCID = provinceID + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
	
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		if ( uniID == strUniID[i] )
			{			
	value = strUniName[i];
	if (typeof(value)!= "undefined" ) 
	document.write("<a HREF='/dipian/jsp/university/universityIndexController.do?selUniversity="+uniID+"' target='_blank'>"+value+"</a>");	
	else value="";
	return(value)			
	}
	}	
}


////////////////no document.write  just return string////////////////////////////////////////////////

function getProvinceTextStr( provinceID)
{
	
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	var strProSelect ;

	
	value = strProvinceName[provinceID-1];
	
		if (typeof(value)== "undefined" ) 
		value="";
	
	return("<a HREF='/dipian/jsp/search/search.do?selProvince="+provinceID+"' target='_blank' >"+value+"</a>");

	
	
}






function getCityTextStr(provinceID,cityID)
{
		
	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		

	
	value = strCityName[cityID-1];
	
	if (typeof(value)== "undefined" ) 
		value="";
		
	return("<a HREF='/dipian/jsp/search/search.do?selCity="+cityID+"&selProvince="+provinceID+"'>"+value+"</a>");	
	
	
}


function getUniTextStr(provinceID,cityID, uniID)
{
	if ( provinceID == -1 || cityID == -1 )
		return ;
	
	var strPCID = provinceID + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
	
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		if ( uniID == strUniID[i] )
			{			
	value = strUniName[i];
	if (typeof(value)== "undefined" ) 
		value="";
	
	return("<a HREF='/dipian/jsp/university/universityIndexController.do?selUniversity="+uniID+"'>"+value+"</a>");		

	}
	}	
}
//得到纯文本
///////////////no document.write  just return string////////////////////////////////////////////////

function getProvincePlainTextStr( provinceID)
{
	
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	var strProSelect ;

	
	value = strProvinceName[provinceID-1];
	
	if (typeof(value)== "undefined" ) 
		value="";
	return(value);
	
	
}


function getCityPlainTextStr(provinceID,cityID)
{
		
	if ( provinceID == -1 || provinceID == 0)
		return "";		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		

	
	value = strCityName[cityID-1];
	
		if (typeof(value)== "undefined" ) 
		value="";

	return(value);	
	
}


function getUniPlainTextStr(provinceID,cityID, uniID)
{
	if ( provinceID == -1 || cityID == -1 || uniID==-1)
		return "";
	
	var strPCID = provinceID + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
	
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		if ( uniID == strUniID[i] )
			{			
	value = strUniName[i];
	
		if (typeof(value)== "undefined" ) 
		value="";
	
	
	
	

	
	return(value);		
		
	}
	}	
}






//////////可以自己命名的sel框///////////////////////////////////
// JavaScript Document
var CurrProvinceID2 = -1 ;
var selProvince ="";
var selCity ="";
var selUniversity ="";


//生成省的select
//provinceID: 需要选中的省的值，如果没有，传入－1
//width：生成的select的宽度
function getProvinceSelect2( provinceID , width ,pname)
{
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	
	var strProSelect ;
	selProvince =pname;
	
	strProSelect = "<select name='"+selProvince+"' style='width:" + width + "px;' onchange='showCity2(this.value, -1)'>" ;
	if ( provinceID == -1 )
		strProSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strProSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strProvinceID.length ; i ++ )
	{
		if ( provinceID == strProvinceID[i] )
			strProSelect += "<option value=" + strProvinceID[i] + " selected>" + strProvinceName[i] + "</option>" ;
		else		
			strProSelect += "<option value=" + strProvinceID[i] + ">" + strProvinceName[i] + "</option>" ;
	}
	strProSelect += "</select>" ;
	
	return strProSelect ;
}

//生成市的select
//width：生成的select的宽度
function getCitySelect2( width ,cname)
{
	var strCitySelect ;
	selCity =cname;
	strCitySelect = "<select name='"+selCity+"' style='width:" + width + "px;' onchange='showUniversity2(this.value, -1)'>" ;
	strCitySelect += "<option value=-1 selected>--请选择--</option>" ;
	strCitySelect += "</select>" ;

	return strCitySelect ;
}

//生成大学的select
//width：生成的select的宽度
function getUniversitySelect2( width ,uname)
{
	selUniversity = uname;
	var strUniSelect ;
	strUniSelect = "<select name='"+selUniversity+"' style='width:" + width + "px;'>" ;
	strUniSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strUniSelect += "</select>" ;

	return strUniSelect ;
}

//显示某个省的城市
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1
function showCity2( provinceID , cityID )
{
	if (!eval("document.all."+selCity))
	{
		alert("selCity is not exist");
		return ;
	}
	CurrProvinceID2 = provinceID ;
	
	//clear city
	for ( var i = 1 ; i < eval("document.all."+selCity).length ; i ++ )
	{
		eval("document.all."+selCity).options[1] = null;
		i -- ;
	}

	//clear university
	if (eval("document.all."+selUniversity) )
	{
		for ( var i = 1 ; i <eval("document.all."+selUniversity).length ; i ++ )
		{
			eval("document.all."+selUniversity).options[1] = null ;
			i -- ;			
		}
	}

	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		
	for ( var i = 0 ; i < strCityID.length ; i ++ )
	{
		var tempopt=new Option(strCityName[i],strCityID[i]);
		eval("document.all."+selCity).options[i + 1] = tempopt;
		if ( cityID == strCityID[i] )
			eval("document.all."+selCity).options[i + 1].selected = true;
	}

}

//显示某个城市的大学
//cityID: 城市ID
//uniID: 需要选中的大学的值，如果没有，传入－1
function showUniversity2( cityID, uniID )
{
	if (! eval("document.all."+selUniversity))
	{
		//alert("selUniversity is not exist");
		return ;
	}

	for ( var i = 1 ; i < eval("document.all."+selUniversity).length ; i ++ )
	{
		eval("document.all."+selUniversity).options[1] = null;
		i -- ;
	}
	
	if ( CurrProvinceID2 == -1 || cityID == -1 )
		return ;
	
	var strPCID = CurrProvinceID2 + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
				
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		var tempopt=new Option(strUniName[i],strUniID[i]);
		eval("document.all."+selUniversity).options[i + 1] = tempopt;
		if ( uniID == strUniID[i] )
			eval("document.all."+selUniversity).options[i + 1].selected = true;
	}
}






























///////////////////////////////seal in to a Class...can't bear it

var AreaSelectBox = Class.create();
//defining the rest of the class implmentation
AreaSelectBox.prototype = {	
initialize: function(prefix,varname) {
this.prefix = prefix;
this.varname = varname
s1 = ("this."+prefix+"CurrProvinceID2= -1");
s2 = ("this."+prefix+"Province= '"+prefix+"Province'");
s3 = ("this."+prefix+"City='"+prefix+"City'");
s4 = ("this."+prefix+"University= '"+prefix+"University'");

/*
alert(s1);
alert(s2);
alert(s3);
alert(s4);
*/

eval(s1);
eval(s2);
eval(s3);
eval(s4);


	  }
 , 
getProvinceSelect2: function(provinceID) {

	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;	
	var strProSelect ;
	selProvince =eval("this."+this.prefix+"Province");
	width=200;
	
	strProSelect = "<select name='"+selProvince+"' style='width:" + width + "px;' onchange='"+this.varname+".showCity2(this.value, -1)'>" ;
	if ( provinceID == -1 )
		strProSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strProSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strProvinceID.length ; i ++ )
	{
		if ( provinceID == strProvinceID[i] )
			strProSelect += "<option value=" + strProvinceID[i] + " selected>" + strProvinceName[i] + "</option>" ;
		else		
			strProSelect += "<option value=" + strProvinceID[i] + ">" + strProvinceName[i] + "</option>" ;
	}
	strProSelect += "</select>" ;
	
	return strProSelect ;
},

//生成市的select
//width：生成的select的宽度
getCitySelect2: function() {
	var strCitySelect ;
	selCity =eval("this."+this.prefix+"City");
	width=200;
	
	strCitySelect = "<select name='"+selCity+"' style='width:" + width + "px;' onchange='"+this.varname+".showUniversity2(this.value, -1)'>" ;
	strCitySelect += "<option value=-1 selected>--请选择--</option>" ;
	strCitySelect += "</select>" ;
	
	return strCitySelect ;
},

//生成大学的select
//width：生成的select的宽度
getUniversitySelect2: function() {

	selCity =eval("this."+this.prefix+"City");
	width=200;
	
	
	selUniversity = eval("this."+this.prefix+"University");;
	var strUniSelect ;
	strUniSelect = "<select name='"+selUniversity+"' style='width:" + width + "px;'>" ;
	strUniSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strUniSelect += "</select>" ;
	
	return strUniSelect ;
},

//显示某个省的城市
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1

showCity2: function(provinceID,cityID) 
{
	

	selCity = eval("this."+this.prefix+"City");
	selUniversity = eval("this."+this.prefix+"University");
	if (!eval("document.all."+selCity))
	{
		alert("selCity is not exist");
		return ;
	}
	eval("this."+this.prefix+"CurrProvinceID2= "+provinceID);
	//clear city
	for ( var i = 1 ; i < eval("document.all."+selCity).length ; i ++ )
	{
		eval("document.all."+selCity).options[1] = null;
		i -- ;
	}

	//clear university
	if (eval("document.all."+selUniversity) )
	{
		for ( var i = 1 ; i <eval("document.all."+selUniversity).length ; i ++ )
		{
			eval("document.all."+selUniversity).options[1] = null ;
			i -- ;			
		}
	}

	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		

	for ( var i = 0 ; i < strCityID.length ; i ++ )
	{
		
		
		var tempopt=new Option(strCityName[i],strCityID[i]);
		eval("document.all."+selCity).options[i + 1] = tempopt;
		if ( cityID == strCityID[i] )
			eval("document.all."+selCity).options[i + 1].selected = true;
	}

},

//显示某个城市的大学
//cityID: 城市ID
//uniID: 需要选中的大学的值，如果没有，传入－1
showUniversity2:function ( cityID, uniID )
{
	
	selCity = eval("this."+this.prefix+"City");
	selUniversity = eval("this."+this.prefix+"University");
	CurrProvinceID2 = eval("this."+this.prefix+"CurrProvinceID2");
	
	//alert(selCity +selUniversity + CurrProvinceID2);
	if (! eval("document.all."+selUniversity))
	{
		//alert("selUniversity is not exist");
		return ;
	}

	for ( var i = 1 ; i < eval("document.all."+selUniversity).length ; i ++ )
	{
		eval("document.all."+selUniversity).options[1] = null;
		i -- ;
	}
	
	if ( CurrProvinceID2 == -1 || cityID == -1 )
		return ;
	
	var strPCID = CurrProvinceID2 + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
				
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		var tempopt=new Option(strUniName[i],strUniID[i]);
		eval("document.all."+selUniversity).options[i + 1] = tempopt;
		if ( uniID == strUniID[i] )
			eval("document.all."+selUniversity).options[i + 1].selected = true;
	}
}




}









//////////可以自己命名的sel框///////////////////////////////////
// JavaScript Document
var CurrProvinceID3 = -1 ;
var ssProvince ="";
var ssCity ="";
var ssUniversity ="";


//生成省的select
//provinceID: 需要选中的省的值，如果没有，传入－1
//width：生成的select的宽度
function getProvinceSelect3( provinceID , width ,pname)
{
	if (typeof(ProvinceID) == "undefined" ) 
	{
		return("not found province info");		
	}

	var strProvinceID = eval("ProvinceID.split(',')");
	var strProvinceName = eval("ProvinceName.split(',')") ;
	
	var strProSelect ;
	ssProvince =pname;
	strProSelect = "<select name='"+ssProvince+"' style='width:" + width + "px;' onchange='showCity3(this.value, -1)'>" ;
	if ( provinceID == -1 )
		strProSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	else
		strProSelect += 	"<option value=-1>--请选择--</option>" ;	
	for ( var i = 0 ; i < strProvinceID.length ; i ++ )
	{
		if ( provinceID == strProvinceID[i] )
			strProSelect += "<option value=" + strProvinceID[i] + " selected>" + strProvinceName[i] + "</option>" ;
		else		
			strProSelect += "<option value=" + strProvinceID[i] + ">" + strProvinceName[i] + "</option>" ;
	}
	strProSelect += "</select>" ;
	
	return strProSelect ;
}

//生成市的select
//width：生成的select的宽度
function getCitySelect3( width ,cname)
{
	var strCitySelect ;
	ssCity =cname;
	strCitySelect = "<select name='"+ssCity+"' style='width:" + width + "px;' onchange='showUniversity3(this.value, -1)'>" ;
	strCitySelect += "<option value=-1 selected>--请选择--</option>" ;
	strCitySelect += "</select>" ;
	
	return strCitySelect ;
}

//生成大学的select
//width：生成的select的宽度
function getUniversitySelect3( width ,uname)
{
	ssUniversity = uname;
	var strUniSelect ;
	strUniSelect = "<select name='"+ssUniversity+"' style='width:" + width + "px;'>" ;
	strUniSelect += 	"<option value=-1 selected>--请选择--</option>" ;
	strUniSelect += "</select>" ;

	return strUniSelect ;
}

//显示某个省的城市
//provinceID: 省ID
//cityID: 需要选中的市的值，如果没有，传入－1
function showCity3( provinceID , cityID )
{

	if (!eval("document.all."+ssCity))
	{
		alert("ssCity is not exist");
		return ;
	}
	CurrProvinceID3 = provinceID ;

	//clear city
	for ( var i = 1 ; i < eval("document.all."+ssCity).length ; i ++ )
	{
		eval("document.all."+ssCity).options[1] = null;
		i -- ;
	}


	//clear university
	if (eval("document.all."+ssUniversity) )
	{
		for ( var i = 1 ; i <eval("document.all."+ssUniversity).length ; i ++ )
		{
			eval("document.all."+ssUniversity).options[1] = null ;
			i -- ;			
		}
	}

	if ( provinceID == -1 || provinceID == 0)
		return ;		
	
	var strCityID = eval("CityID" + provinceID + ".split(',')");
	var strCityName = eval("CityName" + provinceID + ".split(',')") ;
		
	for ( var i = 0 ; i < strCityID.length ; i ++ )
	{
		var tempopt=new Option(strCityName[i],strCityID[i]);
		eval("document.all."+ssCity).options[i + 1] = tempopt;
		if ( cityID == strCityID[i] )
			eval("document.all."+ssCity).options[i + 1].selected = true;
	}

}

//显示某个城市的大学
//cityID: 城市ID
//uniID: 需要选中的大学的值，如果没有，传入－1
function showUniversity3( cityID, uniID )
{
	if (! eval("document.all."+ssUniversity))
	{
		//alert("ssUniversity is not exist");
		return ;
	}

	for ( var i = 1 ; i < eval("document.all."+ssUniversity).length ; i ++ )
	{
		eval("document.all."+ssUniversity).options[1] = null;
		i -- ;
	}
	
	if ( CurrProvinceID3 == -1 || cityID == -1 )
		return ;
	
	var strPCID = CurrProvinceID3 + "_" + cityID ;
	//alert(strPCID);
	var strUniID = eval("UniID_" + strPCID + ".split(',')");
	var strUniName = eval("UniName_" + strPCID + ".split(',')") ;
				
	for ( var i = 0 ; i < strUniID.length ; i ++ )
	{
		var tempopt=new Option(strUniName[i],strUniID[i]);
		eval("document.all."+ssUniversity).options[i + 1] = tempopt;
		if ( uniID == strUniID[i] )
			eval("document.all."+ssUniversity).options[i + 1].selected = true;
	}
}








