$.fn.SelectClass = function(options){
	var defaults = {
		bind1: '',
		bind2: '',
		data1:[],
		data2:[]
	};
	var opts = $.extend(defaults, options);
	var _self = this;
	_self.data("data1",["请选择...",""]);
	_self.data("data2",["请选择...",""]);
	if(defaults.bind1==""){
		_self.append("<select></select>&nbsp;");
	}else{
		_self.append("<select id='"+defaults.bind1+"' name='"+defaults.bind1+"'></select>&nbsp;");
	}
	if(defaults.bind2==""){
		_self.append("<select></select>");
	}else{
		_self.append("<select id='"+defaults.bind2+"' name='"+defaults.bind2+"'></select>");
	}
	var $sel1 = _self.find("select").eq(0);
	var $sel2 = _self.find("select").eq(1);
	if(_self.data("data1")){
		$sel1.append("<option value='"+_self.data("data1")[1]+"'>"+_self.data("data1")[0]+"</option>");
	}
	$.each( defaults.data1 , function(index,data){
		if(data.selected=='true'){
			$sel1.append("<option value='"+data.val+"' selected='selected'>"+data.txt+"</option>");
		}else{
			$sel1.append("<option value='"+data.val+"'>"+data.txt+"</option>");
		}
	});
	if(_self.data("data2")){
		$sel2.append("<option value='"+_self.data("data2")[1]+"'>"+_self.data("data2")[0]+"</option>");
	}
	var index1 = "" ;
	$sel1.change(function(){
		if(defaults.data2.length<=0) return;
		//清空第二个下拉框
		$sel2[0].options.length=0;
		index1 = this.selectedIndex;
		if(index1==0){	//当选择的为 “请选择” 时
			if(_self.data("data2")){
				$sel2.append("<option value='"+_self.data("data2")[1]+"'>"+_self.data("data2")[0]+"</option>");
			}
		}else{
			$.each( defaults.data2[index1-1] , function(index,data){
				if(data.selected=='true'){
					$sel2.append("<option value='"+data.val+"' selected='selected'>"+data.txt+"</option>");
				}else{
					$sel2.append("<option value='"+data.val+"'>"+data.txt+"</option>");
				}
			});
		}
	}).change();
};