function htmlconv(){
	// init
	document.htmldata.aft.value = '';
	stramp = '&amp;';
	strlt = '&lt;';
	strquot = '&quot;';
	strgt = '&gt;';
	strcr = '';
	strlf = '<br />';
	amp = new RegExp('&','g');
	lt = new RegExp('<','g');
	quot = new RegExp('"','g');
	gt = new RegExp('>','g');
	cr = new RegExp('\r','g');
	lf = new RegExp('\n','g');
	// get string
	convstr = document.htmldata.bef.value;

	if (document.htmldata.br.checked){
		// convert include lf
		document.htmldata.aft.value = convstr.replace(amp,stramp).replace(lt,strlt).replace(quot,strquot).replace(gt,strgt).replace(cr,strcr).replace(lf,strlf);
	}
	else{
		// not include lf
		document.htmldata.aft.value = convstr.replace(amp,stramp).replace(lt,strlt).replace(quot,strquot).replace(gt,strgt);
	}
};


