//这个专门给富文本编辑器用的，针对页面中myDiv元素中的内容进行语法高亮处理
function preHighlight() {
	if ($("#myDiv pre").length!=0)
	{
		for (var i=0;i<$("#myDiv pre").length;i++ )
		{
			var arr = $("#myDiv pre").eq(i).html().split("\n");
			var text = "<ol><font color='#0'>";
			$.each(arr,function(i,item){
				//if(item.trim()!=""){
					if (item.search(/\'[\s\S]*?\'/gm))
					{
						var ts=item.match(/\'[\s\S]*?\'/gm);
						item=item.replace(/\'[\s\S]*?\'/gm,'<font color="#3333FF">'+ts+'</font>');
					}
					if (item.search(/\/\/[\s\S]*/gm))
					{
						var ts=item.match(/\/\/[\s\S]*/gm);
						item=item.replace(/\/\/[\s\S]*/gm,'<font color="#009900">'+ts+'</font>');
					}
					text += "<li>"+item+"</li>";
				//}
			});
			text += "</ol></font>";
			text=text.replace(/function/igm,'<font color="#0000CC">function</font>');
			text=text.replace(/begin/igm,'<font color="#0000CC">begin</font>');
			text=text.replace(/end/igm,'<font color="#0000CC">end</font>');
			text=text.replace(/procedure/igm,'<font color="#0000CC">procedure</font>');
			if (text.search(/\(\*[\s\S]*?\*\)/gm))
			{
				var ts=text.match(/\(\*[\s\S]*?\*\)/gm);
				text=text.replace(/\(\*[\s\S]*?\*\)/gm,'<font color="#009900">'+ts+'</font>');
			}
			$("#myDiv pre").eq(i).html(text);
		}
	}
}
//将页面中所有pre元素中的内容进行语法高亮化处理
function preHighlightAll() {
	if ($("pre").length!=0)
	{
		for (var i=0;i<$("pre").length;i++ )
		{
			var arr = $("pre").eq(i).html().split("\n");
			var text = "<ol><font color='#0'>";
			$.each(arr,function(i,item){
				//if(item.trim()!=""){
					if (item.search(/\'[\s\S]*?\'/gm))
					{
						var ts=item.match(/\'[\s\S]*?\'/gm);
						item=item.replace(/\'[\s\S]*?\'/gm,'<font color="#3333FF">'+ts+'</font>');
					}
					if (item.search(/\/\/[\s\S]*/gm))
					{
						var ts=item.match(/\/\/[\s\S]*/gm);
						item=item.replace(/\/\/[\s\S]*/gm,'<font color="#009900">'+ts+'</font>');
					}
					text += "<li>"+item+"</li>";
				//}
			});
			text += "</ol></font>";
			text=text.replace(/function/igm,'<font color="#0000CC">function</font>');
			text=text.replace(/begin/igm,'<font color="#0000CC">begin</font>');
			text=text.replace(/end/igm,'<font color="#0000CC">end</font>');
			text=text.replace(/procedure/igm,'<font color="#0000CC">procedure</font>');
			if (text.search(/\(\*[\s\S]*?\*\)/gm))
			{
				var ts=text.match(/\(\*[\s\S]*?\*\)/gm);
				text=text.replace(/\(\*[\s\S]*?\*\)/gm,'<font color="#009900">'+ts+'</font>');
			}
			$("pre").eq(i).html(text);
		}
	}
}