function initTrainSearch(){
	//增加Select元素
	$("#province_id").change(function(){
		$('option:selected', this).each(function(){
			if(this.value != ''){
				addSelectItem("#city_id", eval("province"+this.value) , "－－选择城市－－");
			}
		});
	});

	//关键字输入框获得焦点时清空其中的初始内容
	$("#courseKey").focus(function(){
		if(this.value == this.title)
			$(this).val("");
	});

	//点击搜索按钮
	$("#startSearchTrain").click(function(){
		//课程类别
		var ctype = selectVal("coursetype_id");
		
		//省
		var prov = selectVal("province_id");

		//市
		var city = selectVal("city_id");

		//关键字
		var key = $("#courseKey").val();
		key = key == $("#courseKey")[0].title ? "" : key.replace(/\s+/g,""); //去除所有的空格
		location.href = "/trainsetups/?ctype="+ctype+"&prov="+prov+"&city="+city+"&key="+( key == "" ? "" : escape(key) );
		//alert( "ctype="+ctype+"&prov="+prov+"&city="+city+"&key="+( key == "" ? "" : escape(key) ) );
	});
}
