﻿	var coll      = document.all.tags("SELECT");
	var src_array = new Array();
	var des_array = new Array();
	var is_slctd  = 0;
	
	//取出所有option
	for ( i=0; i< coll(1).options.length; i++ ) {
		if ( i == coll(1).selectedIndex ) {
			is_slctd = 1;
		}
		src_array[i] = coll(1).options(i).value + "|" + coll(1).options(i).text + "|" + is_slctd;
	}
	
	//对option进行排序
	des_array = src_array.sort();
	
	//清空现有option
/*	for ( i=0; i<coll(1).options.length; i++ ) {
		coll(1).options.remove(i);
		i--;
	}*/
	
	//写入新的option排序
	for ( i=0; i<coll(1).options.length; i++ ) {
		s_tmp = des_array[i].split("|");

		coll(1).options(i).text = s_tmp[1];
		coll(1).options(i).value = s_tmp[0];
		if ( s_tmp[2] == "1" ) {
			coll(1).options(i).selected = true;
		}
		
	}

