// JavaScript Document
function showArticleContent(id)
{
    GoTop();
  var info='<img src="images/ajax-loader.gif" />';
    $("#mainContent").html(info);
    
    $.post('getArticleContent.aspx',{id:id},function(data)
    {
         $("#mainContent").html(data);
    }
    );
}
function gotoMessage()
{
	if(islogin())
    {
		window.location="myMessage.aspx";
	}
    else
    {
            alert("请先登录");
            getLoginReg(document.getElementById("logininfo"),'login.html');
    }
}
function GoTop() {
 window.scrollTo(0,0);
} 
function sendMsg(name,phone,mail,content,checkcode)
{
    if(name!=""&&content!=""&&checkcode!="")
    {
        $.post('sendMsg.aspx',{name:name,phone:phone,mail:mail,content:content,checkcode:checkcode},function(data)
        {
            switch(data)            
            {
                case "3":alert("内容填写不完整");				      
				        break;
				case "1":alert("验证码错误");
				        changeCheckCode()
				        break;
				case "2":
						$("#sendMsgPanel").html("您的留言已经成功提交。我们会尽快回复！");
					   setTimeout("tb_remove()",800);
					   window.location='MyMessage.aspx';
					   break;
			    case "4":
						$("#sendMsgPanel").html("留言提交失败。请联系管理员！");
					   setTimeout("tb_remove()",800);
					   break;
				default : alert(data);
						break;
            }
           
        }
        );
    }
    else
    {
        alert("信息填写不完整,打*号的为必填项");
    }
}