function updatecom(dbgo)
{
	if($("#content").val()=="")
	{
		alert("评论内容不能为空");	
		return
	 }
	 $.ajax({
				beforeSend:function(){$("#msg").addClass("msg").html("正在发送");},
				type: "post",
				url:"/ajax.php?act="+dbgo,
				data:$("#comments input").serialize()+"&content="+$("#content").val(),
				success: function(comm){
					$("#msg").html(comm);
					switch($("#what").val())
					{
						case "ruby":
							$("#recom").load("/show.php?act=ruby&id="+$("#rubyid").val());
						break;
						
						case "tv":
							$("#recom").load("/tv.php?act=ruby&id="+$("#rubyid").val());
						break;
						
						case "notice":
							$("#recom").load("/notice.php?act=ruby&id="+$("#rubyid").val());
						break;
						
					}
					
					$("#content").val("");
				},
				error:function(){
				$("#msg").html("链接出错");
			}
	});
}

function upmsg()
{
	
	
	if($("#content").val()=="")
	{
		alert("留言内容不能为空");	
		return
	 }

	 
	 $.ajax({
				beforeSend:function(){$("#msg").addClass("msg").html("正在发送");},
				type: "post",
				url:"/ajax.php?act=book",
				data:$("#comments input").serialize()+"&content="+$("#content").val(),
				success: function(comm){
					$("#msg").html(comm);
					$("#cls6").load("/book.php?act=book");
					$("#content").val("");
				},
				error:function(){
				$("#msg").html("链接出错");
			}
	});
}
function compage(pageid)
{
	switch($("#what").val())
	{
		case "ruby":
			$("#recom").load("/show.php?act=ruby&id="+$("#rubyid").val()+"&page="+pageid);
		break;
		
		case "tv":
			$("#recom").load("/tv.php?act=ruby&id="+$("#rubyid").val()+"&page="+pageid);
		break;
		
		case "notice":
			$("#recom").load("/notice.php?act=ruby&id="+$("#rubyid").val()+"&page="+pageid);
		break;
		
	}
	
}
function update(upid,act)
{
	
	$.ajax({
		beforeSend:function(){$("#3q"+upid).addClass("msg").html("正在发送数据");},
		type: "POST",
		url: "/ajax.php?act="+act,
		data:"up="+upid,
		success: function(comm){
			if(comm!="您已投过票了")
			{
				
				$("#"+act+upid+" span").html(comm);
				$("#3q"+upid).html("感谢您的参与");
			}
			else
			{
				
				$("#3q"+upid).html("您已经投过票了").show();
					
			}
		
			},
		error:function(){("#msg").html("发生错误");}
	})

}
function uplink()
{
		myurl=/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/;
		if(!myurl.test($("#url").val()))
		{
			alert("链接的网址出错了");	
			return;
		}
		if($("#logo").val()!="")
		{
			if(!myurl.test($("#logo").val()))
			{
				alert("logo格式不对");	
				return;
			}
			
		}
		
		$.ajax({
				beforeSend:function(){$("#msg").html("正在发送");},
				type: "post",
				url:"/ajax.php?act=link",
				data:$("input[@type=text]").serialize(),
				success: function(comm){
					if(comm!="提交成功")
					{
						$("#msg").html(comm);
						alert(comm);
					}
					else
					{
						$("input[@type=text]").val("");
						$("#msg").html(comm);
						$("input[@type=text]").attr("disabled","disabled");
					}
					
				},
				error:function(){
				$("#msg").html("链接出错");
			}
	});
	
}
function resetlink()
{
	$("input[@type=text]").val("");
}
function _replyReport(upid)
{	
$.ajax({
		beforeSend:function(){$("#3q"+upid).addClass("msg").html("正在链接数据");},
		type: "POST",
		url: "/ajax.php?act=Report",
		data:"reid="+upid,
		success: function(comm){
			if(comm!="请勿重复举报")
			{
				$("#3q"+upid).html("感谢您的举报");
			}
			else
			{
				$("#3q"+upid).html("请勿重复举报");
			}
			},
		error:function(){$("#3q"+upid).html("发生错误");}
	});
}
function changeimg()
{
	$("#codeimg").attr("src","/code.php?id="+Math.random());
}
