﻿
function Kind(Type,Start,Key,Cmp){S='';L=Cmp.length;var Select=new Array('公司属性','民营企业','外资企业','合资企业','教育机构','科研机构','医疗机构','金融机构','政府机构','中介服务机构','国有企业','其他');var Value=new Array('公司属性','002','003','004','005','006','007','008','009','010','011','020');P=0;D=11;C=parseInt(Cmp,10);if(L!=0)while(P!=D){i=Math.round((D+P)/2);if(parseInt(Value[i].substring(0,L),10)<C)P=i;else D=i-1;}if(P!=11)P++;if(Type=='select'){for(i=P;i<12&&(L==0||Value[i].substring(0,L)==Cmp);i++)S+='<option value='+Value[i]+'>'+Select[i]+'</option>';S=(Start+S).replace('>'+Key+'<',' selected=true>'+Key+'<');}else if(Type=='value'){for(i=1;i<12;i++)if(Select[i]==Cmp){S=Value[i];break;}}else if(Type=='text'&&Value[P]==Cmp)S=Select[P];	return S;}
