//oykX个人网站程序
//官方论坛：http://bbs.psdzj.com
//版权所有: http://www.周祥.com
var g_zzjs_net = {};
var oDiv = null;
var g_iSpeed = 0;
var t = null;
window.onload = function() {

    oDiv = document.getElementById("zzjs_net");
    oDiv.style.height = "0px";
    document.oncontextmenu = function(ev) {
        var oEvent = window.event || ev;
        cancelDefault(oEvent);
        g_zzjs_net.MouseX = oEvent.clientX;
        g_zzjs_net.MouseY = oEvent.clientY;
        oDiv.style.left = g_zzjs_net.MouseX + "px";
        oDiv.style.top = g_zzjs_net.MouseY + "px";
        /* 初始化经过背景为空 */
        var oUl = document.getElementById("zzjs");
        var aLi = oUl.getElementsByTagName("li");
        for (var i = 0; i < aLi.length; i++) {
            aLi[i].style.background = "none";
        }
        clearInterval(t);
        doDiv();
    }
    document.body.onmousedown = function(ev) {
        var oEvent = window.event || ev;
        clearInterval(t);
        g_iSpeed = 0;
        g_zzjs_net.h = 0;
        oDiv.style.height = g_zzjs_net.h + "px";
        oDiv.style.display = "none";
    }
    oDiv.onmousedown = function(ev) {
        var oEvent = window.event || ev;
        oEvent.cancelBubble = true;
    }
}
function doDiv(ev) {
    var oEvent = window.event || ev;
    oDiv.style.display = "block";
    t = setInterval(doMove, 30);
}
function doMove() {
    if (oDiv.offsetHeight >= 222) {
        g_iSpeed *= -0.7;
        oDiv.style.height = 222 + "px";
    }
    g_zzjs_net.h = g_iSpeed + oDiv.offsetHeight;
    g_iSpeed += 10;
    oDiv.style.height = g_zzjs_net.h + "px";
}
function cancelDefault(oEvent) {
    if (oEvent.preventDefault) {
        oEvent.preventDefault();
    }
    else {
        oEvent.returnValue = false;
    }
}
function confirm() {
    asyncbox.confirm('您确定要退出系统吗?', '系统提示', function(action) {
        //confirm 返回三个 action 值，分别是 'ok'、'cancel' 和 'close'。
        if (action == 'ok') {
            //alert('ok');
        }
        if (action == 'cancel') {
           // alert('cancel');
        }
        if (action == 'close') {
           // alert('close');
        }
    });

}
function getRiZi() {
    //            asyncbox.tips('sdas');
    asyncbox.open({
        id: "a_open",
        title: "查找",
        url: '',
        width: 410,
        height: 465
    });
}