﻿/*
* Function: QQ login
* Author: lianghm (redcapliang@163.com)
* Date: 2008-04-18
* Remark: If there is no landing, go to QQ login pages.
*/

function QQLogin() {
    location.href = "handle/loginqq.ashx";
    
//    $.ajax({ type: "GET", url: "handle/QQLogin.ashx?rand=" + Rand(), dataType: "json",
//        error: function(xml, status, e) {
//            //var err = "<b>AajxStatus:</b>"+status+"<br/><b>responseText:</b>"+xml.responseText+"<br/><b>readyState:</b>"+xml.readyState+"<br/><b>statusText:</b>"+xml.statusText+"<br/><b>status:</b>"+xml.status+"<br/>";
//            //DialogAlert("出现系统错误! [Status=" + xml.status + "]");
//        },
//        success: function(response) {
//            if (response.QQ == "-1") {
//                location.href = response.Url;
//                return false;
//            }
//            //$("#divQQ").html(response.QQ);
//            //$("#divQQ").val(response.QQ);
//            //$("#spaQQ").text(HalfShow(response.QQ));
//            //LoadingHidden();
//        }, async: true
//    });

    return false;
}

// 半明文显示，如349808429显示为34****429
function HalfShow(str) {////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    var len = str.length;
    if (len < 5) {
        return str;
    }
    var leftStr, rightStr, midStr;
    midStr = "";
    leftStr = str.substring(0, 2);
    rightStr = str.substring(len - 3, len);
    // 显示*号
    len = len - 5;
    while (len > 0) {
        midStr = midStr + '*'
        len = len - 1
    }
    str = leftStr + midStr + rightStr;
    return str;
}

function Rand() {
    return new Date().getTime();
}
