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_category_bg.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_category_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_category_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_category_bg2.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='" + sRelativePath + "images/sub_category_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_category_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_category_bg.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='../images/sub_category_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_category_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_category_bg2.gif'>");
	document.write("				<tr>");
	document.write("					<td width=1><img src='../images/sub_category_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_category_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=24 cellpadding=0 cellspacing=0 class=TitleTBRight>");
	document.write("				<tr>");
	document.write("					<td width=22><img src='../images/infolist_left.gif'></td>");
	document.write("					<td valign=bottom width=500 class=Position2 style='font-size:13px;font-weight:bold;color:#ffffff'>" + sCategory + "</td>");
	document.write("					<td><img src='../images/center_title_pic.gif'></td>");
	document.write("					<td><img src='../images/center_title_right.gif'></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetNavigater(sCategory, sInner)
{
	document.write("			<table width='100%' height=50 cellpadding=0 cellspacing=0 border=8 bordercolor=#20988f>");
	document.write("				<tr>");
	document.write("					<td>");
	document.write("						<table width='100%' height='100%' cellpadding=0 cellspacing=0 border=0>");
	document.write("							<tr>");
	document.write("								<td width=70 valign=top style='padding-top:5px;'>&nbsp;<img src='../images/category_title_icon.gif'></td>");
	document.write("								<td width=220 height=28 valign=top style='font-size:15px;font-weight:bold;color:#20988f;padding-top:5px;'>");
	document.write("									&nbsp;" + sCategory);
	document.write("									<br>");
	document.write("									<table bgcolor=#20988f height=1 width=200 cellpadding=0 cellspacing=0><tr><td></td></tr></table>");
	document.write("								</td>");
	document.write("								<td valign=bottom style='padding-top:5px;'>" + sInner + "</td>");
	document.write("							</tr>");
	document.write("						</table>");
	document.write("					</td>");
	document.write("				</tr>");
	document.write("			</table>");
}

function GetSectionTitle(sCategory)
{
	document.write("			<table width=100% height=25 cellpadding=0 cellspacing=0>");
	document.write("				<tr>");
	document.write("					<td width=40% class=SectionTitle>&nbsp;&nbsp;<img src='../images/li_05.gif'>&nbsp;&nbsp;" + sCategory + "</td>");
	document.write("					<td width=60% class=SectionTitle2></td>");
	document.write("				</tr>");
	document.write("			</table>");
}

//若图片尺寸超出指定范围则自动进行调整
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; 
			}
		}
	}
}