﻿//历史密码新版
function input_history_pwd_safecenter(tbOldPwd,ltbOldPwd) 
{
    if(document.getElementById(tbOldPwd).value == '')
    {
        return;
    }
    if(document.getElementById(ltbOldPwd).options.length > 500)
    {
        alert("密码个数超过500个！");
        return;
    }
    jsAddItemToSelect(document.getElementById(ltbOldPwd),document.getElementById(tbOldPwd).value,document.getElementById(tbOldPwd).value);
    document.getElementById(tbOldPwd).value = '';
}	
function remove_history_pwd_safecenter(ltbOldPwd) 
{
    jsRemoveSelectedItemFromSelect(document.getElementById(ltbOldPwd));
}

/**********历史密码2010版**********/
//找回密码函数
function questionInit() {
    for (var i = 1; i <= 2; i++) {
        $('#regquestion' + i + '_list')[0].options.add(new Option("请选择...", ""));
        $('#regquestion' + i + '_list')[0].options.add(new Option("我的小学名字？", "我的小学名字？"));
        $('#regquestion' + i + '_list')[0].options.add(new Option("我妈妈的生日？", "我妈妈的生日？"));
        $('#regquestion' + i + '_list')[0].options.add(new Option("我最难忘的日子？", "我最难忘的日子？"));
        $('#regquestion' + i + '_list')[0].options.add(new Option("我的手机号码是什么？", "我的手机号码是什么？"));
        $('#regquestion' + i + '_list')[0].options.add(new Option("自已编写问题", "自已编写问题"));
    }
}
function questionListChange(id) {
    if ($('#regquestion' + id + '_list').val() == '自已编写问题')
	{
	    $('#regquestion' + id).val('');
	    $('#regquestion' + id).show();
	    $('#regquestion' + id).focus();
	}
	else
	{
	    $('#regquestion' + id).val($('#regquestion' + id + '_list').val());
	    $('#regquestion' + id).hide();
	}
}
function hisPwdAdd() {
    if ($('#hispwd_input').val() == '') {
        return;
    }
    if ($('#hispwd_list')[0].options.length > 500) {
        alert("密码个数超过500个！");
        return;
    }
    $('#hispwd_list')[0].options.add(new Option($('#hispwd_input').val(), $('#hispwd_input').val()));
    $('#hispwd_input').val('');
}	
function hisPwdRemove() 
{
    var length = $('#hispwd_list')[0].options.length - 1;    
    for(var i = length; i >= 0; i--){
        if ($('#hispwd_list')[0].options[i].selected == true) {
            $('#hispwd_list')[0].options[i] = null;    
        }    
    }  
}


