﻿var ASW_qqonline = [["田田", "826632119"], ["佳佳", "1652348470"], ["欣欣", "284816515"], ["乐乐", "282360465"],["菲菲", "826632119"], ["莲莲", "1652348470"], ["珍珍", "284816515"], ["静静", "282360465"]];
var sort_array = new Array();
for (i = 0; i < ASW_qqonline.length; i++) {
    sort_array[i] = i;
}
sort_array.sort(function() { return Math.random() > 0.5 ? -1 : 1; });
var qq_list = "<div class=\"qqico\"><div id=\"qqonlineico\"></div></div><ul>";
for (i = 0; i < sort_array.length; i++) {
    qq_list += "<li><a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=1&uin=" + ASW_qqonline[sort_array[i]][1] + "&site=qq&menu=yes\"><img border=\"0\" src=\"http://wpa.qq.com/pa?p=2:" + ASW_qqonline[sort_array[i]][1] + ":4\" alt=\"七条龙QQ服务\" title=\"七条龙QQ服务\">" + ASW_qqonline[sort_array[i]][0] + "</a></li>";
}
qq_list += "</ul>";
var qqonline_time, qqspeed = 10, qqdistance = 20, qq_time = 3000;
function qq_right() {
    var R = document.getElementById("aswqqonline").style.right.replace("px", "");
    return parseInt(R != null && R != '' ? R : 0);
}
function qq_hide() {
    if (qq_right() > -164) {
        document.getElementById("aswqqonline").style.right = qq_right() - qqdistance + "px";
    }
    else {
        document.getElementById("aswqqonline").style.right = "-164px";
        clearInterval(qqonline_time);
    }
}
function qq_show() {
    if (qq_right() < 0 && qq_right()+qqdistance<0) {
        document.getElementById("aswqqonline").style.right = qq_right() + qqdistance + "px";
    }
    else {
      	document.getElementById("aswqqonline").style.right = "0px";
        clearInterval(qqonline_time);
    }
}

function qq_Init() {
    document.getElementById("aswqqonline").innerHTML = qq_list;
    setTimeout(function() { qqonline_time = setInterval(qq_hide, qqspeed); }, qq_time);
    document.getElementById("aswqqonline").onmouseover = function() {
        clearInterval(qqonline_time);
        qqonline_time = setInterval(qq_show, qqspeed);
    }
    document.getElementById("aswqqonline").onmouseout = function() {
        if (qq_right() == 0) {
            clearInterval(qqonline_time);
            qqonline_time = setInterval(qq_hide, qqspeed);
        }
    }
}
