function Trim(str, main)
{
	var Re, Rs, Str;
	Str = str;
	switch (parseInt(main))
	{
		case 1:			//È¥³ý×ó±ß¿Õ°×
			Re = /^\s*/g;
			Rs = "";
			Str = Str.replace(Re, Rs);
		break;
		case 2:			//È¥³ýÓÒ±ß¿Õ°×
			Re = /\s*$/g;
			Rs = "";
			Str = Str.replace(Re, Rs);
		break;
		case 3:			//È¥³ý×óÓÒ¿Õ°×£¬ÐÞ¼ôÖÐ¼ä¶àÓà¿Õ°×
			Re = /(^\s*)|(\s*$)/g;
			Rs = "";
			Str = Str.replace(Re, Rs);
			Re = /\s+/g;
			Rs = " ";
			Str = Str.replace(Re, Rs);
		break;
		case 4:			//È¥³ýËùÓÐ¿Õ°×
			Re = /\s+/g;
			Rs = "";
			Str = Str.replace(Re, Rs);
		break;
		default :			//È¥³ý×óÓÒ¿Õ°×
			Re = /(^\s*)|(\s*$)/g;
			Rs = "";
			Str = Str.replace(Re, Rs);
		break;
	}
	return Str;
}

function SqlStr(str)
{
	var Re = /'/g;
	var Rs = '"';
	var string = str.replace(Re, Rs);
	return string;
}
