document.writeln("<SCRIPT language=VBScript>");
document.writeln("Sub ClearB_OnClick");
document.writeln("	MyWords.txt_Info.value=\"\"");
document.writeln("	MyWords.txt_OnlyText.value=\"\"");
document.writeln("	MyWords.txt_Info.focus()");
document.writeln("end sub");
document.writeln("");
document.writeln("Sub ChkB_OnClick");
document.writeln("		strKW=MyWords.MyKeyword.value");
document.writeln("		");
document.writeln("		str=replace(MyWords.txt_Info.value,\" \",\"\")");
document.writeln("		str=replace(str,\"&nbsp;\",\"\")");
document.writeln("		str=replace(str,\"&gt;\",\"\")		");
document.writeln("		str=replace(str,\"&lt;\",\"\")");
document.writeln("		str=replace(str,chr(9),\"\")");
document.writeln("		str=replace(str,chr(10),\"\")");
document.writeln("		str=replace(str,chr(13),\"\")");
document.writeln("		str=replace(str,chr(34),\"\")		");
document.writeln("		str=str&\"<\" & \"script\"&\"><\"& \"\/script\" & \">\"");
document.writeln("");
document.writeln("		");
document.writeln("		htmDes=\"<metaNAME=DescriptionCONTENT=\"");
document.writeln("		whereHtmDesL=InStr(1, Str, htmDes,1)");
document.writeln("		if whereHtmDesL>0 then");
document.writeln("			LenDes=len(htmDes)");
document.writeln("			whereHtmDesL=whereHtmDesL+LenDes");
document.writeln("			whereHtmDesR=InStr(whereHtmDesL, Str, \">\",1)");
document.writeln("			MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)");
document.writeln("			str=MyHtmDes&str");
document.writeln("		end if");
document.writeln("		");
document.writeln("		htmDes=\"<metaNAME=keywordsCONTENT=\"");
document.writeln("		whereHtmDesL=InStr(1, Str, htmDes,1)");
document.writeln("		if whereHtmDesL>0 then");
document.writeln("			LenDes=len(htmDes)");
document.writeln("			whereHtmDesL=whereHtmDesL+LenDes");
document.writeln("			whereHtmDesR=InStr(whereHtmDesL, Str, \">\",1)");
document.writeln("			MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)");
document.writeln("			str=MyHtmDes&str");
document.writeln("		end if		");
document.writeln("		");
document.writeln("		LenStr=len(str)");
document.writeln("		\'msgbox \"LenStr=\"&LenStr");
document.writeln("		");
document.writeln("        If InStr(1, Str, \"<\" & \"script\",1) > 0 And InStr(1, Str, \"<\" & \"\/script\" & \">\",1) > 0 Then");
document.writeln("            OnlyText = \"\"");
document.writeln("            i = 1");
document.writeln("            Do Until i > LenStr");
document.writeln("	            ");
document.writeln("                tmpStrL = InStr(i , Str, \"<\" & \"script\", 1)");
document.writeln("                \'MsgBox \"tmpStrL=\"&tmpStrL");
document.writeln("                If tmpStrL > 0 Then");
document.writeln("                    tmpStrR = InStr(tmpStrL, Str, \"<\" & \"\/script\" & \">\",1)");
document.writeln("                    \'MsgBox \"tmpStrR=\"&tmpStrR");
document.writeln("  ");
document.writeln("                      ");
document.writeln("                    If tmpStrR = 0 Then tmpStrR = LenStr");
document.writeln("                    \'MsgBox  \"i=\"&i");
document.writeln("                    OnlyText = OnlyText & Mid(Str, i, tmpStrL-i)");
document.writeln("                    \'MsgBox Mid(Str, i, tmpStrL-i)");
document.writeln("                          ");
document.writeln("                    i = tmpStrR + 9");
document.writeln("                Else");
document.writeln("                    i = i + 1");
document.writeln("                End If");
document.writeln("            Loop");
document.writeln("            Str = OnlyText");
document.writeln("        End If");
document.writeln("	  ");
document.writeln("	  	Str =Str&\"<%\"");
document.writeln("        OnlyText = \"\"");
document.writeln("        i = 1");
document.writeln("        Do Until i > LenStr");
document.writeln("            ");
document.writeln("            tmpStrL = InStr(i, Str, \"<%\", 1)");
document.writeln("            \'MsgBox \"tmpStrL=\" & tmpStrL");
document.writeln("            If tmpStrL > 0 Then");
document.writeln("                tmpStrR = InStr(tmpStrL, Str, \"%>\", 1)");
document.writeln("                \'MsgBox \"tmpStrR=\" & tmpStrR");
document.writeln("");
document.writeln("                  ");
document.writeln("                If tmpStrR = 0 Then tmpStrR = LenStr");
document.writeln("                \'MsgBox \"i=\" & i");
document.writeln("                OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)");
document.writeln("                \'MsgBox Mid(Str, i, tmpStrL - i)");
document.writeln("                      ");
document.writeln("                i = tmpStrR + 2");
document.writeln("            Else");
document.writeln("                i = i + 1");
document.writeln("            End If");
document.writeln("        Loop");
document.writeln("        Str = OnlyText");
document.writeln("        	  ");
document.writeln("	  	Str =Str&\"<\"");
document.writeln("        OnlyText = \"\"");
document.writeln("        i = 1");
document.writeln("        Do Until i > LenStr");
document.writeln("            ");
document.writeln("            tmpStrL = InStr(i, Str, \"<\", 1)");
document.writeln("            \'MsgBox \"tmpStrL=\" & tmpStrL");
document.writeln("            If tmpStrL > 0 Then");
document.writeln("                tmpStrR = InStr(tmpStrL, Str, \">\", 1)");
document.writeln("                \'MsgBox \"tmpStrR=\" & tmpStrR");
document.writeln("");
document.writeln("                  ");
document.writeln("                If tmpStrR = 0 Then tmpStrR = LenStr");
document.writeln("                \'MsgBox \"i=\" & i");
document.writeln("                OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)");
document.writeln("                \'MsgBox Mid(Str, i, tmpStrL - i)");
document.writeln("                      ");
document.writeln("                i = tmpStrR + 1");
document.writeln("            Else");
document.writeln("                i = i + 1");
document.writeln("            End If");
document.writeln("        Loop");
document.writeln("        Str = OnlyText");
document.writeln("");
document.writeln("		 ");
document.writeln(" ");
document.writeln("		LenStr=len(str)  ");
document.writeln("		LenKW=len(replace(strKW,\" \",\"\"))  ");
document.writeln("		  ");
document.writeln("		  ");
document.writeln("  ");
document.writeln("		if LenStr<LenKW then  ");
document.writeln("			msgbox \"关键字居然比文章长！\",64,\"不作计算\"  ");
document.writeln("			exit sub  ");
document.writeln("		end if");
document.writeln("");
document.writeln("		MyWords.txt_OnlyText.value=OnlyText");
document.writeln("		");
document.writeln("		if LenKW<>0 then		");
document.writeln("			KeywordTimes=0  ");
document.writeln("			i=1  ");
document.writeln("			do until i> LenStr  ");
document.writeln("				tmpStr=instr(i,str,strKW,1)  ");
document.writeln("				if tmpStr>0 then  ");
document.writeln("					KeywordTimes=KeywordTimes+1  ");
document.writeln("					i=tmpStr+1  ");
document.writeln("				else  ");
document.writeln("					i=i+1  ");
document.writeln("				end if  ");
document.writeln("			loop  ");
document.writeln("		  ");
document.writeln("");
document.writeln("			strlenKW=int(KeywordTimes*LenKW*1000\/LenStr+0.5)\/10  ");
document.writeln("			fmlenKW=cstr(strlenKW)  ");
document.writeln("			if left(fmlenKW,1)=\".\" then fmlenKW= \"0\" & fmlenKW 		  ");
document.writeln("			msgbox \"有\"& LenStr& \"个字符，关键字出现\"&KeywordTimes&\"次，关键字密度为\" & strlenKW & \"%。\" ,64,\"www.yuzi.net 字符计算\" ");
document.writeln("		else");
document.writeln("			msgbox \"有\"& LenStr& \"个字符\" ,64,\"字符计算\" ");
document.writeln("		end if");
document.writeln("		MyWords.txt_Info.focus()  ");
document.writeln("end sub<\/SCRIPT>")