function PushMsg(html){
	$.prompt(html,{
			buttons: { 关闭:0},
			submit:function(v,m,f){
				if(v==0){
					$.prompt.close();
				}
			},
			top:'30%'
		}
	);
}
function SmsLogin(id){
	var html = '<input name="mobile" id="wdownid" value="" style="display:none;"/>';
		html += '<div id="tabs">';
		html += '	<ul>';
		html += '		<li><a href="#tabs-1">用户登录</a></li>';
		html += '	</ul>';
		html += '	<div id="tabs-1">';
		html += '	手机号：<input name="wtel" id="wtel" value="" /> 仅限厦门移动<br />';
		html += '	验证码：<input name="wcode" id="wcode" value="" />';
		html +='	<button onclick="getcode();" style="padding:0px;margin:0px;height:20px;line-height:20px;">获取验证码</button><br />';
		html += '	<button onclick="LoginSB('+id+');" style="padding:0px;margin:0px;height:20px;line-height:20px;">登录</button><br />';
		html +='	<div id="wsmstext" style="text-align:center;"></div>';
		html += '		<p>对不起，您需要进行登录才能做相应操作，谢谢！<br />请输入手机号并点击获取验证码，进行登录验证</p>';
		html += '	</div>';
		html += '</div>';
	$.prompt(html,{
			buttons: { 关闭: 0 },
			submit:function(v,m,f){
				if(v==0){
					$.prompt.close();
				}
			},
			top:'25%'
		}
	);
	$(function(){$("#tabs").tabs();});
}
function LoginSB(id){
	tel = $('#wtel').val();
	code = $('#wcode').val();
	$.ajax({
		type: "POST",
		url: "/include/ajax.func.php",
		data: "act=login&code="+code+"&tel="+tel,
		dataType: "text",
		success: function(data){
			if(data){
				if(data=='ok'){
					alert('登录成功！');
					$.prompt.close();
				}
				else if(data=='err'){
					alert('登录失败！请检查您的手机号是否正确');
				}
				else if(data=='err_code'){
					alert('您输入的验证码有误！请重新输入');
				}
				else if(data=='no_num'){
					alert('手机号不能为空或您输入的号码是全角数字或是字符，请输入正确手机号');
				}
				else if(data=='no_11'){
					alert('您输入的号码不足11位');
				}
				else{
					alert('异常：'+data+'\r\n请通知管理员处理！');
				}
			}
		}
	});
}
function getcode(){
	tel = $('#wtel').val();
	if(!tel){
		alert('手机号不能为空！');
		return false;
	}
	else{
		$.ajax({
			type: "POST",
			url: "/include/ajax.func.php",
			data: 'act=smscode&tel='+tel,
			dataType: "text",
			success: function(data){
				if(data){
					$('#wsmstext').html('');
					if(data=='ok'){
						alert('验证码发送成功，请收查短信！');
					}
					else if(data=='err'){
						alert('发送失败！请检查您的手机号是否正确');
					}
					else if(data=='no_11'){
						alert('您输入的号码不足11位');
					}
					else if(data=='no_num'){
						alert('您输入的号码是全角数字或是字符，请输入正确手机号');
					}
					else{
						alert('异常：'+data+'\r\n请通知管理员处理！');
					}
				}
				else{
					str = '<font color="red"><img src="../../images/loading.gif">正在发送......</font>';
					$('#wsmstext').html(str);
				}
			}
		});
	}
}
