function mhHover2(cls){
	event.srcElement.className = cls;
}
function mhHover(tbl, idx, cls) {
	var t = document.getElementById(tbl);
	if (t == null) return;
	var d = t.getElementsByTagName("TD");
	if (d == null) return;
	if (d.length <= idx) return;
	d[idx].className = cls;
}
// 设置当颜色样式为蓝色时的渐变背景
function SetColorBlue()
{
    // 顶部左
    $('#TopHeadLeft').gradient({ from: '4b92d9', to: 'e9f2fa', direction: 'vertical' });
    // 顶部中
    $('#TopHeadMiddle').gradient({ from: 'e9f2fa', to: '1e77d3', direction: 'vertical' });
    // 中部右
    $('#HeadContentMiddle').gradient({ from: '0a6cce', to: 'ffffff', direction: 'vertical' });
    // 站点底部
    $('#SiteFooter').gradient({ from: 'ffffff', to: '3f8cda', direction: 'vertical' });
}
// 设置当颜色样式为红色时的渐变背景
function SetColorRed()
{
    // 顶部左
    $('#TopHeadLeft').gradient({ from: 'f5787c', to: 'FFE0E0', direction: 'vertical' });
    // 顶部中
    $('#TopHeadMiddle').gradient({ from: 'FFE0E0', to: 'eb0007', direction: 'vertical' });
    // 中部右
    $('#HeadContentMiddle').gradient({ from: 'e8040a', to: 'ffffff', direction: 'vertical' });
    // 底部
    $('#SiteFooter').gradient({ from: 'ffffff', to: 'eb0007', direction: 'vertical' });
}
// 设置当颜色样式为黄色时的渐变背景
function SetColorYellow()
{
    // 顶部左
    $('#TopHeadLeft').gradient({ from: 'ffc287', to: 'fff8f1', direction: 'vertical' });
    // 顶部中
    $('#TopHeadMiddle').gradient({ from: 'fff8f1', to: 'ff9610', direction: 'vertical' });
    // 中部右
    $('#HeadContentMiddle').gradient({ from: 'ff8610', to: 'ffffff', direction: 'vertical' });
    // 底部
    $('#SiteFooter').gradient({ from: 'ffffff', to: 'ff8611', direction: 'vertical' });
}
function Sanxing_Page_Initialize()
{
    // 系统公共变量
    var windowWidth = document.body.clientWidth;
    var windowHeight = document.body.clientHeight;
    
    
	var h = document.getElementById("hasMenu").getAttribute("value");
	var mc = document.getElementById("MainContent")
	var root = document.getElementById("root").value;

	// 页脚链接定义
	document.getElementById("lnkIndex").setAttribute("href", root);
	document.getElementById("lnkMap").setAttribute("href", root + "SiteMap.aspx");
	document.getElementById("lnkCopy").setAttribute("href", root + "announce.aspx");
	document.getElementById("lnkPrivacy").setAttribute("href", root + "privacy.aspx");
	

	// headright
	//var headWidth = $('#SiteHeader').width();
	var headWidth = document.getElementById("SiteHeader").clientWidth;
	//var headLeftWidth = $("#TopHeadLeft").width();
	var headLeftWidth = document.getElementById("TopHeadLeft").clientWidth;
	//var headMiddWidth = $("#TopHeadMiddle").width();
	var headMiddWidth = document.getElementById("TopHeadMiddle").clientWidth
	var addLeft = headLeftWidth + headMiddWidth;
	// $("#TopHeadRight").width(headWidth - addLeft);
	document.getElementById("TopHeadRight").style.pixelWidth = (headWidth - addLeft);

	// 设置网站Logo右边渐变
	//var headerWidth = $('#HeadContent').width(); // 头部宽度
	var headerWidth = document.getElementById("HeadContent").clientWidth;
	//var logoWidth = $('#HeadContentLeft').width(); // logo宽度
	var logoWidth = document.getElementById("HeadContentLeft").clientWidth;
	//$('#HeadContentMiddle').width(headerWidth - logoWidth);
	document.getElementById("HeadContentMiddle").style.pixelWidth = headerWidth - logoWidth;
	
	// 定义菜单高度
	if (h == "True")
	{
	    // 定义网站主菜单栏高度，使其撑满
	    var divMainContentHeight = document.getElementById("MainContent").clientHeight; //$('#MainContent').height();
	    var divRightblock = document.getElementById("rightMain");
	    var divRightBlockHeight;
	    if (divRightblock == null)
	        divRightBlockHeight = 0;
	    else
	        divRightBlockHeight = divRightblock.clientHeight; //$('#rightMain').height();

	    // 菜单宽度固定为180px，即主内容输入宽度为窗口宽度-190
	    //$('#MainContent').width(windowWidth - 190);
	    document.getElementById("MainContent").style.pixelWidth = windowWidth - 190;
	    
	    // 如果正文区域大于右边栏
	    if (divMainContentHeight > divRightBlockHeight)
	    {
	        if (divMainContentHeight >= 480)
	        {
	            //$('#Header_MainMenu').height(divMainContentHeight + 10);
	            document.getElementById("Header_MainMenu").style.pixelHeight = divMainContentHeight + 10;
	        }
	        else
	            document.getElementById("Header_MainMenu").style.pixelHeight = 480;
	    }
	    else
	    {
	        // 设置整体大小为右边框栏+10px
	        //$('#MainContent').height(divRightBlockHeight + 10);
	        //$('#Header_MainMenu').height(divRightBlockHeight + 10);

	        document.getElementById("MainContent").style.pixelHeight = divRightBlockHeight + 10;
	        document.getElementById("Header_MainMenu").style.pixelHeight = divRightBlockHeight + 10;
	    }
	    //$("#Header_MainMenu").height($('#MainContent').height() + 2);
	    document.getElementById("Header_MainMenu").style.pixelHeight = document.getElementById("MainContent").clientHeight + 2;
	}
	else
	{
	    mc.className = "MainContentNone";
	}
}
function ChkSiteSearchText(){
	if(document.getElementById("Header_txtSiteSearch").value == "")
		return false;
	else
		return true;
}
function FirstPage_Initialize()
{
    SetWidth();
    Corner();
    SetHeight();
}
function Corner()
{
    // 声明模块圆角操作
    $("#divAnnounce").corner({ tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 5 }, br: { radius: 5} });
    // 新闻块圆角操作
    // 声明模块圆角操作
    $("#divNews").corner({ tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 5 }, br: { radius: 5} });
    // divContact
    $(".rightBlock").corner({ tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 5 }, br: { radius: 5} });
}
// 设置方框内列表高度
function SetHeight()
{
    // ******
    // 新闻块高度
    var newsHeight = $("#divNews").height();
    var newsTitleHeight = $("#newsTitle").height();
    var newsBottomHeight = $('#newsBottom').height();
    $('#ulNews').height((newsHeight - newsTitleHeight - newsBottomHeight) - 2);

    // ****
    // 右侧信息块高度
    var rightBlockHeight = $('.rightBlock').height();
    var rightTitleHeight = $('.rightTitle').height();
    $('#rightText').height((rightBlockHeight - rightTitleHeight) - 8);
    $('.rightUl').height((rightBlockHeight - rightTitleHeight) - 2);

    document.getElementById("MainContent").style.pixelHeight = 580;
}
// 设置首页栏目宽度
function SetWidth()
{
    // 整体宽度
    //var mainWidth = $("#MainContent").width();
    //var mc = document.getElementById("MainContent");
    // 200 是首页右侧边栏固定宽度。
    //$('#leftMain').width(mainWidth - 300);
    document.getElementById("leftMain").style.pixelWidth = document.body.clientWidth -190 - 210;
}