Here is EditArea, a free javascript editor for source code. It allows to write well formatted source code with line enumeration, tab support, search & replace (with regexp) and live syntax highlighting (customizable).