<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312">
<title><?php echo $title;?></title>
    <link rel="stylesheet" href="http://<?php echo 'ph';?>.sell.house365.com/template/<?php echo 'ph';?>/style/newVersion.css">
<link rel="stylesheet" type="text/css" href="<?php echo USER_CENTER;?>css/all.css"/>
<script type="text/javascript" src="<?php echo USER_CENTER;?>js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<?php echo USER_CENTER;?>js/Validform_v5.3.2_ncr_min.js"></script>
<script type="text/javascript" src="<?php echo USER_CENTER;?>js/code.js"></script>

<script type="text/javascript">
$(function(){
	$(".form").Validform({
		tiptype:2,
        callback:function(form){
			yz()
			return false;
		}
           });
})
</script>
</head>

<body>
<div class="top">
	<div class="w960">
		<div class="topleft"><a href="<?php echo GB_SITE_URL;?>" target="_blank">首页</a>|<a href="<?php echo GB_NEWS_URL;?>" target="_blank">房产资讯</a>|<a href="<?php echo  GB_NEWHOUSE_URL;?>" target="_blank">新房</a>|<a href="<?php echo GB_SELL_URL;?>" target="_blank">二手房</a>|<a href="<?php echo GB_RENT_URL;?>" target="_blank">租房</a>|<a href="<?php echo GB_HOME_URL;?>" target="_blank">家居</a>|<a href="<?php echo GB_BBS_URL?>" target="_blank">华侨路茶坊</a></div>
		<script src="http://www.house365.com/houseshare/login_js.php" language="javascript"></script>|<a href="<?php echo GB_WO_URL;?>" target="_blank">网络经纪人</a></div>
</div>
<div id="js_boxMiddle"> 
	<!--logo开始-->
	<div class="logo">
		<div class="w904">
			<div class="logol"><a href="<?php echo GB_SITE_URL;?>"><img title="" alt="" src="../images/logo.gif"></a></div>
			<div class="u-font">找回密码</div>
		</div>
	</div>
	<!--logo结束-->
	
	<div class="w904 innerBg">
<!--        <form class="form"  action="--><?php //echo USER_CENTER;?><!--findpassword"  method="post">-->
		<form class="form"  action="<?php echo USER_CENTER;?>FindpasswordUcenter"  method="post">
        <table  border="0" cellspacing="0" cellpadding="0" class="r-table">
          <tr>
            <th width="120">手机号：</th>
            <td width="330"><input type="text" class="inputText" id="telno" name="telno"  datatype="m" value="请输入手机号码"  tip="请输入手机号码" nullmsg="请输入手机号码。" errormsg="请正确输入手机号码。" />
        	<input  id="getcode" class="yzm " type="button" value="验证码" /></td>
            <td width="320"><div class="Validform_checktip" id="js_errorBox1">&nbsp;</div>&nbsp;
          </td>
          </tr>
          <tr>
            <th>验证码：</th>
            <td><input type="text" class="inputText"  id="validcode" name="validcode" datatype="s4-7" value="请输入验证码"  tip="请输入验证码" nullmsg="请输入验证码。" errormsg="请正确输入验证码。"></td>
            <td><div class="Validform_checktip" id="js_errorBox">&nbsp;</div>&nbsp;</td>
          </tr>
          <tr>
            <th>新密码：</th>
            <td><input type="password" class="inputText" id="setNewPassword" name="setNewPassword" datatype="s6-16" nullmsg="请输入新密码。" errormsg="密密码范围在6~16位之间,或者有非法字符。"></td>
            <td><div class="Validform_checktip" id="js_errorBox2">&nbsp;</div>&nbsp;</td>
          </tr>
           <tr>
            <th>再次输入新密码：</th>
            <td><input type="password" class="inputText" id="repetPassword" name="repetPassword" recheck="setNewPassword" datatype="s6-16" nullmsg="请正确的再次输入新密码。" errormsg="您两次输入的密码不一致。"></td>
            <td><div class="Validform_checktip" id="js_errorBox3">&nbsp;</div>&nbsp;</td>
          </tr>
         
          <tr>
            <th>&nbsp;</th>
            <td><button class="tj-btn" type="submit">submit</button></td>
          </tr>
        </table>
           <input  type="hidden" name="kind" id="kind" value="4">
		    <?php 
				$rand_num = md5(md5(rand(100000,200000).time()));
				$_SESSION[GB_CITY.'_register_num_2'] = $rand_num;
			?>
			<input type="hidden" value="<?php echo $_SESSION['token'];?>" name="token">
			<input  type="hidden" name="security_key_2" id='security_key_2' value="<?php echo $rand_num;?>">
        </form>
	</div>
	
<script>
    //发送验证码
    // $('#getcode').getVnum();
    $('#getcode').getVnumUcenter();

    function yz(){
   
		var flag = true;
        $.ajax({
            type: 'post',
            //url : '<?php //echo USER_CENTER;?>findpassword',
            url : '<?php //echo USER_CENTER;?>findpasswordUcenter',
            data: "telno="+$("#telno").val()+"&validcode="+$("#validcode").val()+"&setNewPassword="+$("#setNewPassword").val()+"&repetPassword="+$("#repetPassword").val()+"&kind="+$("#kind").val(),
            dataType:'html',
            success: function(msg){

                switch(msg){
                     case '1':
                        openWin('warning');
						// setTimeout("location.href='http://nj.sell.house365.com'",3000);
                         setTimeout("location.href=" + "'<?= GB_NEWRENT_INDEX_URL ?>'",3000);
					    break;
					
                    case '2':
                        $("#js_errorBox").empty();
                        $("#js_errorBox").removeClass("Validform_checktip Validform_right").addClass("Validform_checktip Validform_wrong")
		            	$("#js_errorBox").html("请正确输入验证码。");
			            $("#telno").focus();
						flag = false;
					    break;
				    case '3':
                    	$("#js_errorBox1").empty();
                        $("#js_errorBox1").removeClass("Validform_checktip Validform_right").addClass("Validform_checktip Validform_wrong")
		            	$("#js_errorBox1").html("更改密码失败。");
			            $("#telno").focus();
						flag = false;
					    break;
                    case '4':
                    	$("#js_errorBox1").empty();
                        $("#js_errorBox1").removeClass("Validform_checktip Validform_right").addClass("Validform_checktip Validform_wrong")
		            	$("#js_errorBox1").html("手机号不存在。");
			            $("#telno").focus();
						flag = false;
					    break;
                    case '10':
                        $("#js_errorBox1").empty();
                        $("#js_errorBox1").removeClass("Validform_checktip Validform_right").addClass("Validform_checktip Validform_wrong")
                        $("#js_errorBox1").html("操作过频繁，歇会再操作。");
                        $("#telno").focus();
                        flag = false;
                        break;
                }
            }
        });
		if(!flag)
        {
        return false;
        }
    }
</script>

<?php require APPPATH_MVC.'views/footer.php'; ?>

<script>
var openWin = function(obj){
	var winHeght = $(document).height() ;
	var winElemt = $('#'+ obj);
	
	var win = {
		
		height : function(){
			return winElemt.outerHeight();
		},
		
		width : function(){
			return winElemt.outerWidth();
		},
		
		show : function(){
			winElemt.css({
				'position':'absolute',
				'z-index':'9999902',
				'left':'50%',
				'margin-left':'-' + win.width() / 2 + 'px',
				'top':$(window).height()/2 - (win.height()/2) + $(window).scrollTop() + 'px'
			}).show();
		},
		
		hide : function(){
			winElemt.hide();
		}
	
	};
	win.show();
	$('.close-win').click(function(){
		win.hide();
	});
};
</script>
<div id="warning" class="pop" style=" display:none;z-index:100">
    <div class="hd">
    	<h2>提示</h2>
    	<a href="javascript:void(0)" class="close-win">关闭</a>
    </div>
    <div class="bd">
    	<div class="warning-inner">
        	<div class="war-bg" style="background:url(images/pop-ico.gif)  0 0 no-repeat;"></div>
        	<p class="war-text">登陆成功,页面将跳转到二手房首页。</p>
        </div>
    	<div class="pop-btn-area"><a href="javascript:void(0)" class="close-win" style="background:#29B966;color:#fff;padding:7px 15px;margin:0 5px;border:1px solid #26AB5E">确定</a></div>
    </div>
</div>
<style>
.Validform_right{ display:none;}
#js_errorBox,
#js_errorBox2,
#js_errorBox3{margin-left:-85px; _position: relative;_top:10px;}
#js_errorBox1{_position: relative;_top:10px;}
</style>
