function SelectTopCityAuto(ObjID,ElementID,Channel,Category) {
	this.position = null;
	this.obj = null;
	this.Channel = null;
	this.Category = null;
	this.switchNO = 1;
	this.currentNO = 1;
	this.isDisplay = false;
	this.win = null;
	this.isInit = false;
	this.isClose = true;
	this.absolute = false;
	this.getTagPositionByObj = function(obj,offsetTop,offsetLeft) {
		var a = obj;
		var pLeft=a.offsetLeft;
		var pTop=a.offsetTop;
		while (a.tagName.toUpperCase()!="BODY") {
			a=a.offsetParent;
			pLeft+=a.offsetLeft;
			pTop+=a.offsetTop;
		}
		var re = {top:pTop+offsetTop,left:pLeft+offsetLeft};
		return re;
	}
	this.HotCities = new Array( 
		new Array(440,'北京'), 
		new Array(439,'上海'),
		new Array(25,'广州'),
		new Array(444,'深圳'),
		new Array(458,'成都'),
		new Array(470,'重庆'),
		new Array(2095,'苏州'),
		new Array(687,'杭州'),
		new Array(448,'南京'),
		new Array(455,'武汉'),
		new Array(2219,'郑州'),
		new Array(2050,'青岛'),
		new Array(3114,'大连'),
		new Array(447,'哈尔滨'),
		new Array(467,'香港'),
		new Array(468,'台湾'),
		new Array(469,'澳门')
	);
	this.AllCities = new Array(
		new Array(13746,'阿坝','A',false),
		new Array(489,'阿克苏','A',false),
		new Array(469,'澳门','A',false),
		new Array(271,'安庆','A',false),
		new Array(223,'鞍山','A',false),
		new Array(13307,'安阳','A',false),
		new Array(241,'白城','B',false),
		new Array(239,'白山','B',false),
		new Array(113,'保定','B',false),
		new Array(417,'宝鸡','B',false),
		new Array(440,'北京','B',true),
		new Array(7314,'滨州','B',false),
		new Array(118,'沧州','C',false),
		new Array(446,'长春','C',false),
		new Array(331,'常德','C',false),
		new Array(411,'昌都','C',false),
		new Array(494,'昌吉','C',false),
		new Array(456,'长沙','C',false),
		new Array(202,'长治','C',false),
		new Array(4423,'常州','C',false),
		new Array(458,'成都','C',true),
		new Array(334,'郴州','C',false),
		new Array(470,'重庆','C',true),
		new Array(405,'大理','D',false),
		new Array(3114,'大连','D',false),
		new Array(226,'丹东','D',false),
		new Array(250,'大庆','D',false),
		new Array(375,'德阳','D',false),
		new Array(1789,'东莞','D',false),
		new Array(294,'东营','D',false),
		new Array(219,'鄂尔多斯','E',false),
		new Array(325,'恩施','E',false),
		new Array(362,'防城港','F',false),
		new Array(3827,'佛山','F',false),
		new Array(224,'抚顺','F',false),
		new Array(451,'福州','F',false),
		new Array(471,'甘南','G',false),
		new Array(289,'赣州','G',false),
		new Array(25,'广州','G',true),
		new Array(351,'桂林','G',false),
		new Array(459,'贵阳','G',false),
		new Array(475,'海北','H',false),
		new Array(472,'海东','H',false),
		new Array(2630,'海口','H',false),
		new Array(473,'海南','H',false),
		new Array(474,'海西','H',false),
		new Array(114,'邯郸','H',false),
		new Array(687,'杭州','H',false),
		new Array(447,'哈尔滨','H',false),
		new Array(450,'合肥','H',false),
		new Array(119,'衡水','H',false),
		new Array(3784,'衡阳','H',false),
		new Array(13308,'荷泽','H',false),
		new Array(467,'香港','H',false),
		new Array(109,'淮安','H',false),
		new Array(2635,'呼和浩特','H',false),
		new Array(100,'惠州','H',false),
		new Array(110,'湖州','H',false),
		new Array(288,'吉安','J',false),
		new Array(4330,'江门','J',false),
		new Array(302,'焦作','J',false),
		new Array(4103,'嘉兴','J',false),
		new Array(348,'揭阳','J',false),
		new Array(235,'吉林','J',false),
		new Array(245,'佳木斯','J',false),
		new Array(453,'济南','J',false),
		new Array(4203,'金华','J',false),
		new Array(295,'济宁','J',false),
		new Array(227,'锦州','J',false),
		new Array(282,'九江','J',false),
		new Array(4455,'开封','K',false),
		new Array(486,'克拉玛依','K',false),
		new Array(497,'喀什','K',false),
		new Array(460,'昆明','K',false),
		new Array(360,'来宾','L',false),
		new Array(13752,'莱芜','L',false),
		new Array(115,'廊坊','L',false),
		new Array(2598,'兰州','L',false),
		new Array(2684,'拉萨','L',false),
		new Array(256,'连云港','L',false),
		new Array(298,'聊城','L',false),
		new Array(207,'临汾','L',false),
		new Array(102,'临沂','L',false),
		new Array(350,'柳州','L',false),
		new Array(4150,'洛阳','L',false),
		new Array(274,'马鞍山','M',false),
		new Array(469,'澳门','M',false),
		new Array(101,'茂名','M',false),
		new Array(382,'眉山','M',false),
		new Array(376,'绵阳','M',false),
		new Array(452,'南昌','N',false),
		new Array(383,'南充','N',false),
		new Array(448,'南京','N',false),
		new Array(457,'南宁','N',false),
		new Array(279,'南平','N',false),
		new Array(4293,'南通','N',false),
		new Array(303,'南阳','N',false),
		new Array(2051,'宁波','N',false),
		new Array(233,'盘锦','P',false),
		new Array(373,'攀枝花','P',false),
		new Array(310,'平顶山','P',false),
		new Array(434,'平凉','P',false),
		new Array(393,'黔东南','Q',false),
		new Array(394,'黔南','Q',false),
		new Array(395,'黔西南','Q',false),
		new Array(2050,'青岛','Q',false),
		new Array(248,'齐齐哈尔','Q',false),
		new Array(3994,'泉州','Q',false),
		new Array(396,'曲靖','Q',false),
		new Array(416,'日喀则','R',false),
		new Array(13309,'日照','R',false),
		new Array(309,'三门峡','S',false),
		new Array(278,'三明','S',false),
		new Array(439,'上海','S',true),
		new Array(304,'商丘','S',false),
		new Array(3343,'汕头','S',false),
		new Array(3896,'绍兴','S',false),
		new Array(445,'沈阳','S',false),
		new Array(444,'深圳','S',true),
		new Array(442,'石家庄','S',false),
		new Array(240,'松原','S',false),
		new Array(2095,'苏州','S',false),
		new Array(493,'塔城','T',false),
		new Array(296,'泰安','T',false),
		new Array(468,'台湾','T',false),
		new Array(443,'太原','T',false),
		new Array(108,'泰州','T',false),
		new Array(4252,'台州','T',false),
		new Array(4056,'唐山','T',false),
		new Array(441,'天津','T',false),
		new Array(427,'天水','T',false),
		new Array(231,'铁岭','T',false),
		new Array(4396,'潍坊','W',false),
		new Array(297,'威海','W',false),
		new Array(420,'渭南','W',false),
		new Array(403,'文山','W',false),
		new Array(2052,'温州','W',false),
		new Array(213,'乌海','W',false),
		new Array(455,'武汉','W',false),
		new Array(270,'芜湖','W',false),
		new Array(466,'乌鲁木齐','W',false),
		new Array(3850,'无锡','W',false),
		new Array(467,'香港','X',false),
		new Array(2588,'厦门','X',false),
		new Array(462,'西安','X',false),
		new Array(312,'襄樊','X',false),
		new Array(329,'湘潭','X',false),
		new Array(339,'湘西','X',false),
		new Array(319,'咸宁','X',false),
		new Array(418,'咸阳','X',false),
		new Array(117,'邢台','X',false),
		new Array(2610,'西宁','X',false),
		new Array(299,'新乡','X',false),
		new Array(305,'信阳','X',false),
		new Array(301,'许昌','X',false),
		new Array(3927,'徐州','X',false),
		new Array(380,'雅安','Y',false),
		new Array(421,'延安','Y',false),
		new Array(242,'延边','Y',false),
		new Array(106,'盐城','Y',false),
		new Array(4374,'扬州','Y',false),
		new Array(2952,'烟台','Y',false),
		new Array(314,'宜昌','Y',false),
		new Array(2621,'银川','Y',false),
		new Array(13755,'义乌','Y',false),
		new Array(228,'营口','Y',false),
		new Array(332,'岳阳','Y',false),
		new Array(293,'枣庄','Z',false),
		new Array(111,'张家口','Z',false),
		new Array(432,'张掖','Z',false),
		new Array(105,'漳州','Z',false),
		new Array(104,'湛江','Z',false),
		new Array(345,'肇庆','Z',false),
		new Array(398,'昭通','Z',false),
		new Array(2219,'郑州','Z',false),
		new Array(107,'镇江','Z',false),
		new Array(3649,'中山','Z',false),
		new Array(482,'中卫','Z',false),
		new Array(306,'周口','Z',false),
		new Array(3431,'珠海','Z',false),
		new Array(308,'驻马店','Z',false),
		new Array(328,'株洲','Z',false),
		new Array(292,'淄博','Z',false)
	);
	this.outHTML = ''
	+'<table align="center" style="width:100%; font-size:13px;" border="0" cellspacing="0" cellpadding="0">'
		+'<tr style="height:24px;">'
			+'<td id="'+ObjID+'_nav_1" align="center" valign="middle" style="width:16%; height:22px; font-weight:bold; border:solid 1px #80AAC0; border-bottom:0px; cursor:default; background:transparent url(images/qiehuan_current.gif) repeat-x scroll left center;" onclick="'+ObjID+'.multi_over(1,this);"><a href="javascript:void(0);" target="_self" style="color:#FF6600; cursor:default;">热门城市</a></td>'
			+'<td valign="middle" style="width:1%; border-bottom:solid 1px #80AAC0;">&#xA0;</td>'
			+'<td id="'+ObjID+'_nav_2" align="center" valign="middle" style="width:16%; height:22px; font-weight:bold; border:solid 1px #80AAC0; cursor:pointer;" onclick="'+ObjID+'.multi_over(2,this);"><a href="javascript:void(0);" target="_self">所有城市</a></td>'
			+'<td align="right" valign="middle" style="width:68%; border-bottom:solid 1px #80AAC0;"><a href="HomePageURL" target="_blank" style="font-weight:bold;">全国</a>&#xA0;<a href="javascript:'+ObjID+'.close();" target="_self" style="color:#FF6600;">关闭</a></td>'
		+'</tr>'
		+'<tr>'
			+'<td id="'+ObjID+'_List" colspan="4" style="padding:8px; text-align:center; border:solid 1px #80AAC0; border-top:0px;">&#xA0;</td>'
		+'</tr>'
	+'</table>';
	this.open = function() {
		if (!this.isInit) {
			this.Init();
		}
		this.obj.style.display = "block";
		this.isDisplay = true;
	};
	this.close = function() {
		this.obj.style.display = "none";
		this.isDisplay = false;
	};
	this.OpenSwitch = function() {
		if (this.isDisplay) this.close();
		else this.open();
	}
	this.Init = function() {
		var tmpDiv = document.getElementById(ElementID);
		if (this.absolute) {
			this.position = this.getTagPositionByObj(tmpDiv,0,0);
		}
		tmpDiv.style.display = "none";
		var pDiv = document.createElement("div");
		pDiv.id = ObjID.toString();
		pDiv.style.width = "100%";
		if (this.absolute) {
			pDiv.style.position = "absolute";
			pDiv.style.top = parseInt(this.position.top)+"px";
			pDiv.style.left = parseInt(this.position.left)+"px";
		}
		pDiv.style.backgroundColor = "white";
		pDiv.style.display = "none";
		tmpDiv.parentNode.insertBefore(pDiv,tmpDiv);
		if (Channel) {
			this.Channel = Channel;
		}
		if (Category) {
			this.Category = parseInt(Category);
		}
		this.obj = document.getElementById(pDiv.id);
		if (!this.isClose) {
			this.outHTML = this.outHTML.replace('<a href="javascript:'+ObjID+'.close();" target="_self" style="color:#FF6600;">关闭</a>','');
		}
		switch (Channel) {
			case (null):
				this.outHTML = this.outHTML.replace('HomePageURL','/');
				break;
			case ("jobs"):
				this.outHTML = this.outHTML.replace('HomePageURL','http://www.jinti.com/'+Channel);
				break;
			default:
				this.outHTML = this.outHTML.replace('HomePageURL','http://'+Channel+'.jinti.com/');
				break;
		}
		this.obj.innerHTML = this.outHTML;
		this.multi_over(this.switchNO);
		this.isInit = true;
	};
	this.multi_over = function multi_over(cid,obj) {
		if (obj) {}
		else {
			obj = document.getElementById(ObjID+'_nav_'+cid);
		}
		if (obj.id!=(ObjID+'_nav_'+this.currentNO)) {
			var total = 2;
			for (var i=1; i<=total; i++) {
				var tmp_obj = document.getElementById(ObjID+'_nav_'+i);
				tmp_obj.style.borderBottom = 'solid 1px #80AAC0';
				tmp_obj.style.cursor = 'pointer';
				tmp_obj.style.background = '';
				tmp_obj.firstChild.style.color = '';
				tmp_obj.firstChild.style.cursor = '';
			}
			obj.style.borderBottom = '0px';
			obj.style.cursor = 'default';
			obj.style.background = 'transparent url(images/qiehuan_current.gif) repeat-x scroll left center;';
			obj.firstChild.style.color = '#FF6600';
			obj.firstChild.style.cursor = 'default';
			this.currentNO = cid;
		}

		var list = document.getElementById(ObjID+'_List');
		var strChannel = "";
		if (this.Channel=="" || this.Channel==null) strChannel="www";
		else strChannel = this.Channel;
		var strCategory = "";
		if (this.Category==0 || this.Category==null) strCategory="";
		else strCategory = this.Category+"/";
		switch (cid) {
			case 1:
				var tmp_str = '<table style="width:100%;" border="0" cellspacing="0" cellpadding="0"><tr>';
				for (var i=0; i<this.HotCities.length; i++) {
					tmp_str += '<td align="center" valign="middle"><a href="http://'+strChannel+'.jinti.com/'+this.HotCities[i][0]+'/'+strCategory+'" target="_top" style="font-weight:bold;">'+this.HotCities[i][1]+'</a></td>';
				}
				tmp_str += '</tr></table>';
				list.innerHTML = tmp_str;
				break;
			case 2:
				list.innerHTML = "building...";
				var rows = 18;
				var flg_Zimu = "";
				var flg_i = 0;
				var isSep = false;
				var tmp_str = '<table style="width:100%; line-height:24px;" border="0" cellspacing="0" cellpadding="0"><tr>';
				for (var i=0; i<this.AllCities.length; i++) {
					if ((flg_i%rows)==0)  tmp_str += '<td align="center" valign="top"><table style="text-align:left;"><tr><td>';
					if (this.AllCities[i][2]!=flg_Zimu) {
						flg_Zimu=this.AllCities[i][2];
						tmp_str += '<div style="color:#FF6600;">'+flg_Zimu+"</div>";
						if ((flg_i%rows)==(rows-1))  tmp_str += '</td></tr></table></td>';
						flg_i++;
						if ((flg_i%rows)==0)  tmp_str += '<td align="center" valign="top"><table style="text-align:left;"><tr><td>';
					}
					var isBold = "";
					if (this.AllCities[i][3]==true) isBold=' style="font-weight:bold;"';
					tmp_str += '<div style="width:52px;"><a href="http://'+strChannel+'.jinti.com/'+this.AllCities[i][0]+'/'+strCategory+'" target="_top"'+isBold+'>'+this.AllCities[i][1]+'</a></div>';
					if ((flg_i%rows)==(rows-1))  tmp_str += '</td></tr></table></td>';
					flg_i++;
				}
				if (((flg_i-1)%rows)!=(rows-1))  {
					if ((18-(flg_i%rows))>=2) tmp_str += '<div style="width:52px;">&nbsp;</div><div style="width:52px;"><a href="http://'+strChannel+'.jinti.com/1988/'+strCategory+'" target="_top"'+isBold+'>其他城市</a></div>';
					tmp_str += '</td></tr></table></td>';
				}
				else {
					isSep = true;
				}
				tmp_str += '</tr></table>';
				if (isSep==true) {
					tmp_str += '<div align="right" style="padding-right:8px;"><a href="http://'+strChannel+'.jinti.com/1988/'+strCategory+'" target="_top">其他城市</a></div>';
				}
				else {
					tmp_str += '<div align="right" style="padding-right:8px;"><a href="http://menu.jinti.com/SelectTopCity960/index_new.asp" target="_top" style="font-weight:bold;">所有城市</a></div>';
				}
				list.innerHTML = tmp_str;
				break;
			default:
				break;
		}
	};
}