$Filter={};
$Filter.xss=function(html)
{
	if((typeof html)=='string')
	{
		var arr=['on','expression','script','meta','link']
		var arr1=['o n','e xpression','s cript','m eta','l ink']
		var re=/(\<[^\<]+\>)/gi;
		var res;
		while(res=re.exec(html))
		{
			for (var val in arr) 
			{
				res[1]=res[1].replace(arr[val],arr1[val]);
			}
			html=html.replace(res[0],res[1]);
		}
		html=html.replace(/\{%/g,'{&zwj;%').replace(/%\}/g,'%&zwj;}');
	}
	return html;
}
 
$Filter.href=function(str,back)
{
	back=back?back:'$M.href';
	return str.replace
	(
		/<a ([\s\S]*?)\shref=(['"])(.*?)\2(.*?>)/,
		'<a $1 onclick="'+back+'(\'$3\')" $4'
	)
}

$Filter.escape=function(sql_str) 
{
	if((typeof sql_str)=='string')
	{
		return sql_str.replace(/(['|"|\\])/g,'\\$1')
	}
	return sql_str;
}

