function texttrn(sendtext) {
	var Tcolor = "";
	switch (parseInt(sendtext)) {
	case 1 :
		Tcolor = '舒体';
		break;
	case 2 :
		Tcolor = '隶书';
		break;
	case 3 :
		Tcolor = '彩云';
		break;
	case 4 :
		Tcolor = '细黑';
		break;
	case 5 :
		Tcolor = '新魏';
		break;
	case 6 :
		Tcolor = '宋体';
		break;
	case 7 :
		Tcolor = '姚体';
		break;
	case 8:
		Tcolor = '幼圆';
		break;
	case 9 :
		Tcolor = '仿宋';
		break;
	case 0 :
		Tcolor = '行楷';
		break;
}
  return Tcolor;
}
function colortrn(sendcol) {
	var Tcolor = "";
	switch (sendcol) {
	case "a" :
		Tcolor = "#EE1D24";
		break;
	case "b" :
		Tcolor = "#F16522";
		break;
	case "c" :
		Tcolor = "#F7941D";
		break;
	case "d" :
		Tcolor = "#FFF100";
		break;
	case "e" :
		Tcolor = "#8FC63D";
		break;
	case "f" :
		Tcolor = "#37B400";
		break;
	case "g" :
		Tcolor = "#00A650";
		break;
	case "h" :
		Tcolor = "#00A99E";
		break;
	case "i" :
		Tcolor = "#00AEEF";
		break;
	case "j" :
		Tcolor = "#0072BC";
		break;
	case "k" :
		Tcolor = "#0054A5";
		break;
	case "l" :
		Tcolor = "#2F3192";
		break;
	case "m" :
		Tcolor = "#652C91";
		break;
	case "n" :
		Tcolor = "#91278F";
		break;
	case "o" :
		Tcolor = "#ED008C";
		break;
	case "p" :
		Tcolor = "#EE1000";
		break;
	}
  return Tcolor;
}


function formatReplace(srcString) {
	var regstr = new RegExp("\n", "g");
	srcString=srcString.replace(regstr, "<br>");
	var regstr = new RegExp(" ", "g");
	srcString=srcString.replace(regstr, "&nbsp;");
	return srcString;
}

function htmlReplace(srcString) {
	var regstr = new RegExp("<", "g");
	srcString=srcString.replace(regstr, "&lt;");

	regstr = new RegExp(">", "g");
	srcString=srcString.replace(regstr, "&gt;");
	
	return srcString;
}


//功能：扩展日期函数，支持YYYY-MM-DD或YYYY-MMDD hh:mm:ss字符串格式
//返回：如果正确，则返回javascript中支持UTC日期格式，如果错误，则返回false
//举例： var myDate = Date_Ex("2004-12-21 23:01:00"); //返回正确的日期
//       var myDate = Date_Ex("2004-12-21");     //返回正确的日期
//       var myDate = Date_Ex("2004-23-12 12:60:29");//返回false，且提示日期或时间超出有效范围
function Date_Ex(value1)
{
	var strDate = value1;
	if (strDate.length == 0)
		return false;

	//先判断是否为短日期格式：YYYY-MM-DD，如果是，将其后面加上00:00:00，转换为YYYY-MM-DD hh:mm:ss格式
	var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/;   //短日期格式的正则表达式
	var r = strDate.match(reg);

	if (r != null)   //说明strDate是短日期格式，改造成长日期格式
		strDate = strDate + " 00:00:00";

	reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})/;
	r = strDate.match(reg);
	if (r == null)
	{
		alert("你输入的日期格式有误，正确格式为：2004-12-01 或 2004-12-01 12:23:45");
		return false;
	}

	var d = new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
	return d;
}

function printBirthday(birthday)
{
	var bir = new Date(birthday);
	var year = bir.getYear();
	var month = bir.getMonth()+1;
	var date = bir.getDate();
	if (year == 1899 && month == 11 && date == 30)
		document.write("");
	else
		document.write(year+"年"+month+"月"+date+"日");
}