function GetCategoryTitle(sCategory, sUrl, sRel)
{
	var sHtml = "";
	sHtml += '<div class="ClearFix" style="height:24px;background:url(../images/main_categorytitle_bg.jpg) repeat-x top;">';
	sHtml += '	<div style="float:left;display:inline;height:24px;margin-left:35px;padding:2px 10px 0 10px;color:#CB7A43;background:#FFFFFF;font-size:14px;font-weight:bold;">' + sCategory + '</div>';
	if (sUrl)
	{
		if (!sRel) sRel = "";
		sHtml += '	<div style="float:right;padding:5px 10px 0 0;"><a class="More" rel="' + sRel + '" href="' + sUrl + '">&gt;&gt;&nbsp;更多..</a></div>';
	}
	sHtml += '</div>';
	document.write(sHtml);
}

function _GetCategoryTitle(sCategory, sRelativePath, sUrl)
{
	var sText = sUrl ? "<a class=CurPos2 target=_blank href='" + sUrl + "'>" + sCategory + "</a>" : sCategory;
	var sTitleWidth = 18 * sCategory.length + 30;
	document.write("<table width='100%' height='27' cellpadding='0' cellspacing='0'>");
	document.write("	<tr>");
	document.write("		<td width=" + sTitleWidth + ">");
	document.write("			<table width=100% height=26 cellpadding=0 cellspacing=0 background='" + sRelativePath + "images/sub_ArticleCategory_bg.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_ArticleCategory_left.gif'></td>");
	document.write("					<td align=left class=CurPos2>");
	document.write("						" + sText);
	document.write("					</td>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_ArticleCategory_right.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("		<td width=5></td>");
	document.write("		<td width=1><img src='" + sRelativePath + "images/sub_title_left.gif'></td>");
	document.write("		<td class=TitleTBSub>&nbsp;</td>");
	document.write("		<td width='1' align=right><img src='" + sRelativePath + "images/sub_title_right.gif'></td>");
	document.write("	</tr>");
	document.write("	<tr height=3><td></td></tr>");
	document.write("</table>");
}

function GetCategoryTitle2(sCategory, sRelativePath, sUrl)
{
	var sText = sUrl ? "<a class=CurPos2 target=_blank href='" + sUrl + "'>" + sCategory + "</a>" : sCategory;
	if (!sHtml) sHtml = sCategory;
	var sTitleWidth = 18 * sCategory.length + 30;
	document.write("<table width='100%' height='27' cellpadding='0' cellspacing='0'>");
	document.write("	<tr>");
	document.write("		<td width=" + sTitleWidth + ">");
	document.write("			<table width=100% height=26 cellpadding=0 cellspacing=0 background='" + sRelativePath + "images/sub_ArticleCategory_bg2.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_ArticleCategory_left2.gif'></td>");
	document.write("					<td align=left class=CurPos2 style='filter:glow(Color=#83650a,Strength=1)'>");
	document.write("						" + sText);
	document.write("					</td>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_ArticleCategory_right2.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
	document.write("		</td>");
	document.write("		<td width=5></td>");
	document.write("		<td width=1><img src='" + sRelativePath + "images/sub_title_left.gif'></td>");
	document.write("		<td class=TitleTBSub>&nbsp;</td>");
	document.write("		<td width='1' align=right><img src='" + sRelativePath + "images/sub_title_right.gif'></td>");
	document.write("	</tr>");
	document.write("	<tr height=3><td></td></tr>");
	document.write("</table>");
}

function GetNavTitle(sCategory, sHtml)
{
	if (!sHtml) sHtml = sCategory;
	var sTitleWidth = 18 * sCategory.length + 30;
	document.write("			<table width=" + sTitleWidth + " height=26 cellpadding=0 cellspacing=0 background='../images/sub_ArticleCategory_bg.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='../images/sub_ArticleCategory_left.gif'></td>");
	document.write("					<td align=left class=CurPos2>");
	document.write("						" + sHtml);
	document.write("					</td>");
	document.write("					<td width=1><img src='../images/sub_ArticleCategory_right.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetNavTitle2(sCategory, sHtml)
{
	if (!sHtml) sHtml = sCategory;
	var sTitleWidth = 18 * sCategory.length + 30;
	document.write("			<table width=" + sTitleWidth + " height=26 cellpadding=0 cellspacing=0 background='../images/sub_ArticleCategory_bg2.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='../images/sub_ArticleCategory_left2.gif'></td>");
	document.write("					<td align=left class=CurPos2 style='filter:glow(Color=#83650a,Strength=1)'>");
	document.write("						" + sHtml);
	document.write("					</td>");
	document.write("					<td width=1><img src='../images/sub_ArticleCategory_right2.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetSideTitle(sCategory, sRelativePath, sUrl)
{
	document.write("			<table width=100% cellpadding=0 cellspacing=0 class=TitleTBSide>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/side_title_left.gif'></td>");
	document.write("					<td class=TitleTBSide style='padding-left:5px'>");
	document.write("						" + sCategory);
	document.write("					</td>");
	document.write("					<td align=right>");
	if (sUrl)
	{
		document.write("					<a target=_blank href='" + sUrl + "'><img border=0 src='" + sRelativePath + "images/side_title_more.gif'></a>");
	}
	document.write("					</td>");
	document.write("					<td width=1 align=right><img src='" + sRelativePath + "images/side_title_right.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetSideTitle2(sCategory, sRelativePath, sUrl)
{
	document.write("			<table width=100% cellpadding=0 cellspacing=0 class=TitleTBSide>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/side_title_left2.gif'></td>");
	document.write("					<td class=TitleTBSide2 style='padding-left:5px'>");
	document.write("						" + sCategory);
	document.write("					</td>");
	document.write("					<td align=right>");
	if (sUrl)
	{
		document.write("					<a target=_blank href='" + sUrl + "'><img border=0 src='" + sRelativePath + "images/side_title_more.gif'></a>");
	}
	document.write("					</td>");
	document.write("					<td width=1 align=right><img src='" + sRelativePath + "images/side_title_right2.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetMainTitle(sCategory, sRelativePath, sUrl)
{
	document.write("			<table width=100% cellpadding=0 cellspacing=0 class=TitleTBMain>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/main_title_left.gif'></td>");
	document.write("					<td>" + sCategory + "</td>");
	document.write("					<td align=right><img src='" + sRelativePath + "images/main_title_bgright.gif'></td>");
	document.write("					<td width=1 align=right valign=bottom>");
	if (sUrl)
	{
		document.write("					<a target=_blank href='" + sUrl + "'><img border=0 src='" + sRelativePath + "images/main_title_more.gif'></a>");
	}
	document.write("					</td>");
	document.write("					<td width=1 align=right><img src='" + sRelativePath + "images/main_title_right.gif'></td>");
	document.write("				</tr>");
	document.write("				<tr height=11>");
	document.write("					<td colspan=5 background='" + sRelativePath + "images/main_title_bottombg.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetPageCategoryTitle(sCategory)
{
	document.write("			<table width=100% height=25 cellpadding=0 cellspacing=0 background='../images/category_title_bg2.gif'>");
	document.write("				<tr>");
	document.write("					<td style='background:url(../images/category_title_bg.gif) no-repeat' class=Position2>&nbsp;&nbsp;&nbsp;&nbsp;" + sCategory + "</td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetSubcategoryNavigator(sCategory, sInner)
{
	document.write("			<div style='border:1px solid #DDDDDD;'>");
	document.write("				" + sInner);
	document.write("			</div>");
}

function GetSectionTitle(sCategory, sUrl)
{
	document.write("			<table width='100%' height='25' cellpadding='0' cellspacing='0'>");
	document.write("				<tr>");
	document.write("					<td width='50%' class='SectionTitle'>&nbsp;&nbsp;<img src='../images/li_05.gif' />&nbsp;&nbsp;" + sCategory + "</td>");
	document.write("					<td width='50%' class='SectionTitle2' align='right' style='padding-right:30px;'>");
	if (sUrl)
	{
		document.write("					<a class='More' href='" + sUrl + "'>&gt;&gt;&nbsp;更多..</a>");
	}
	document.write("					</td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetSectionTitle2(sCategory, sUrl)
{
	document.write("			<table width='100%' cellpadding='0' cellspacing='0'>");
	document.write("				<tr>");
	document.write("					<td width='50%' style='color:#319ED9;padding-left:20px;'><img src='../images/li_04.jpg' />&nbsp;【" + sCategory + "】</td>");
	document.write("					<td width='50%' align='right' style='padding-right:30px;'>");
	if (sUrl)
	{
		document.write("					<a class='More' href='" + sUrl + "'>&gt;&gt;&nbsp;更多..</a>");
	}
	document.write("					</td>");
	document.write("				</tr>");
	document.write("			</table>");
}

//WORD附件上传
function UploadDocument(p_TextBox)
{
	var oReturn = showModalDialog("../Modules/eWebEditor/dialog/file_doc.htm", window, "dialogWidth:350px;dialogHeight:125px;help:no;scroll:no;status:no");
	if (oReturn != null) p_TextBox.value = oReturn;
}

//设置鼠标移动到表格某行时高亮显示该行
function HighLightRow(sTableName, iRowIndex)
{
	iRowIndex += 1;
	var myTable = document.getElementById(sTableName);
	var iRowCount = myTable.rows.length;
	for (var i = 1; i < iRowCount; i++)
	{
		var sClassName = myTable.rows(i).className;

		if (i == iRowIndex)
		{
			if (sClassName != "")
			{
				sClassName += " ";
			}
			sClassName += "SelectedRow";
		}
		else
		{
			var iPos = sClassName.indexOf("SelectedRow");
			if (iPos == 0)
			{
				sClassName = "";
			}
			else if (iPos > 0)
			{
				sClassName = sClassName.substring(0, iPos - 1);
			}
		}
		myTable.rows(i).className = sClassName;
	}
}

//若图片尺寸超出指定范围则自动进行调整
function ResizeImg(imgD, iWidth, iHeight)
{
	if (imgD.style.width != "" || imgD.style.height != "") return;		//若已通过css指定了图片大小则不再调整(style="width:)

	var imgTmp = new Image();
	imgTmp.src = imgD.src; 

	if (imgTmp.width != imgD.width || imgTmp.height != imgD.height) return;		//若已在页面中指定了图片大小则不再调整(<img width=)

	if (imgTmp.width > 0 && imgTmp.height > 0)
	{
		//未指定高度，只根据宽度按比例缩小
		if (iWidth && !iHeight)
		{
			if (imgTmp.width > iWidth)
			{
				imgD.width = iWidth; 
				imgD.height = (imgTmp.height * iWidth) / imgTmp.width; 
			}
			return;
		}
		//未指定宽度，只根据高度按比例缩小
		if (iHeight && !iWidth)
		{
			if (imgTmp.height > iHeight)
			{
				imgD.height = iHeight;
				imgD.width = (imgTmp.width * iHeight) / imgTmp.height; 
			}
			return;
		}
		//同时指定了高度和宽度，按原始比例缩小
		if (imgTmp.width / imgTmp.height >= iWidth / iHeight)
		{
			if (imgTmp.width > iWidth)
			{
				imgD.width = iWidth; 
				imgD.height = (imgTmp.height * iWidth) / imgTmp.width; 
			}
			else
			{
				imgD.width = imgTmp.width; 
				imgD.height = imgTmp.height; 
			} 
		} 
		else
		{
			if (imgTmp.height > iHeight)
			{
				imgD.height = iHeight; 
				imgD.width = (imgTmp.width * iHeight) / imgTmp.height; 
			}
			else
			{
				imgD.width = imgTmp.width; 
				imgD.height = imgTmp.height; 
			}
		}
	}
}
