﻿var Bowos_lastScrollY = 0;
var Bowos_Heightmain = 0;		//主面板位置

var Bowos_TYPE=1; //不能删除
var Bowos_STYLE=1; //不能删除
var Bowos_PANEL_POS={left:'',top:''};
var Bowos_DIV_ID='Bowos_pannel'; //
var Bowos_FIXED='0';  					//布局 固定

	var online= new Array();
$(document).ready(function() {
	
	jQuery.getScript("http://webpresence.qq.com/getonline?Type=1&3578798:351425892:75099666:20010851:351425892:14531053:1033108559:1104632841:", function(){
	if (online[0]==0)
	$("#Bowos_pannel_mid").find("img").eq(1).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");
	if (online[1]==0)
	$("#Bowos_pannel_mid").find("img").eq(3).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");		
	if (online[2]==0)
	$("#Bowos_pannel_mid").find("img").eq(5).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
	if (online[3]==0)
	$("#Bowos_pannel_mid").find("img").eq(8).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
	if (online[4]==0)
	$("#Bowos_pannel_mid").find("img").eq(10).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
	if (online[5]==0)
	$("#Bowos_pannel_mid").find("img").eq(12).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
	if (online[6]==0)
	$("#Bowos_pannel_mid").find("img").eq(14).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
	if (online[7]==0)
	$("#Bowos_pannel_mid").find("img").eq(17).attr("src","http://cs.ecqun.com/images/icon_person_stat_offline.gif");	
																								});
	
	
	 $("#Bowos_pannel").css("left",$("body").innerWidth() - 130);
											window.setInterval(function(){
		 $("#Bowos_pannel").css("left",$("body").innerWidth() - 130);
	}, 500);				   
						   

			window.setInterval(function(){
		if (typeof(Bowos_moveDiv) != 'undefined' && document.getElementById(Bowos_DIV_ID) && Bowos_FIXED=='0') {
			Bowos_moveDiv(Bowos_DIV_ID,'','main');
		}
	}, 2);		  		   
});
function Bowos_moveDiv(id, sid,obj){
	if (obj=='dlg2'){
		Bowos_lastScrollY = Bowos_Heightdlg2;
	}else if (obj=='dlg1'){
		Bowos_lastScrollY = Bowos_Heightdlg1;
	}else{
		Bowos_lastScrollY = Bowos_Heightmain;
	}
	
    var diffY;
    if (document.documentElement && document.documentElement.scrollTop) {
        diffY = document.documentElement.scrollTop;
    }
    else 
        if (document.body) {
            diffY = document.body.scrollTop;
        }
        else {
        }
    percent = 0.1 * (diffY - Bowos_lastScrollY);
    if (percent > 0) {
        percent = Math.ceil(percent);
    }
    else {
        percent = Math.floor(percent);
    }
    if (Bowos_TYPE == 2) {// 上下悬浮
        if (Bowos_STYLE == 1) {
            document.getElementById(id).style.top = parseInt(document.getElementById(id).style.top) + percent + "px";
        }
        else {
            document.getElementById(id).style.bottom = parseInt(document.getElementById(id).style.bottom) - percent + "px";
            if (navigator.Actual_Version == "6.0") {
                document.getElementById(id).style.bottom = 0;
            }
        }
    }
    else {
        document.getElementById(id).style.top = parseInt(document.getElementById(id).style.top) + percent + "px";
        if (Bowos_PANEL_POS) {
            Bowos_PANEL_POS.top = parseInt(document.getElementById(id).style.top) + percent;
        }
    }
    Bowos_lastScrollY = Bowos_lastScrollY + percent;
	if (obj=='dlg2'){
		Bowos_Heightdlg2 = Bowos_lastScrollY;
	}else if (obj=='dlg1'){
		Bowos_Heightdlg1 = Bowos_lastScrollY;
	}else{
		Bowos_Heightmain = Bowos_lastScrollY
	}
}