function getcity(citycode)
{
	$("#astr").val(citycode);
	//alert(citycode);
	$("#catid").load("?act=city&code="+citycode);
	$("#py").hide();
	
}
function userdel(ids,what,dbgo)
{
	if(confirm("你确定要删除吗？")){
		$("#tr"+ids).remove();
		$.get("?act=del&do="+what+"&id="+ids); 
		$("#msg").html(ids+"删除成功");
	}else{
		return 
	}
}
function yuyue()
{
	
	
	myname=/^[\u0391-\uFFE5]+$/;
	if(!myname.test($("#name").val()))
	{
		$("#msg").html("姓名必要中文");	
		return;
	}
	isPhone = /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/;
//	if(!isPhone.test($("#tel").val()))
//	{
//		$("#msg").html("电话号码格式错了");	
//		return;
//	}
	
	isMobile = /^((\(\d{2,3}\))|(\d{3}\-))?(13|15)\d{9}$/;
	if(!isMobile.test($("#mobile").val()) &&  !isPhone.test($("#tel").val()))
	{
		$("#msg").html("手机格式错误 或 电话号码格式错了 ");	
		return;
	}
	isEmail = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/;
	if(!isEmail.test($("#email").val()))
	{
		$("#msg").html("email格式错误");	
		return;
	}
	
	
		$.ajax({
				beforeSend:function(){$("#msg").html("正在发送");},
				type: "post",
				url:"/info.php?act=save",
				data:$("#yuyue input").serialize()+"&content="+$("#content").val(),
				success: function(comm){
						$("#msg").html(comm);
						//alert(comm);
						$("#yuyue").hide("slow");
						$("#yuyue input[@type=text]").val("");
						$("#content").val("");
				},
				error:function(){
				$("#msg").html("链接出错");
			}
	});
	//$("#msg").html("正在提交");	
		
}

function changeimg()
{
	$("#codeimg").attr("src","/code.php?id="+Math.random());
}
function loadimg()
{
	$("#safecode").html("<img src='/code.php?id="+Math.random()+"' />");	
}

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:"?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("链接出错");
			}
	});
	
}