lastScrollX=0;
lastScrollY=0;
function heartBeat(){  
resizeQQDiv();
var diffX;
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop;
else
    {/*Netscape stuff*/}
 
if (document.documentElement && document.documentElement.scrollLeft )
    diffX = document.documentElement.scrollLeft ;
else if (document.body)
    diffX = document.body.scrollLeft ;
else
    {/*Netscape stuff*/}

var _QQDiv =document.getElementById("lovexin12");
percentX=.1*(diffX-lastScrollX); 
if(percentX>0)percentX=Math.ceil(percentX); 
else percentX=Math.floor(percentX); 
_QQDiv.style.left=parseInt(_QQDiv.style.left)+percentX+"px";

lastScrollX=lastScrollX+percentX;     
//alert(diffY);
percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
_QQDiv.style.top=parseInt(_QQDiv.style.top)+percent+"px";

lastScrollY=lastScrollY+percent; 
//alert(lastScrollY);
}

var online= new Array();
var img_All= new Array();
var img_Path='script/qq/qq04/';
var img_on=img_Path+'QQonline.gif ';
var img_off=img_Path+'QQoffline.gif ';
var strGetStatusHead = '<script language="javascript" src="http://webpresence.qq.com/getonline?Type=1&';
var qqArray = ["983039796"];
var qqLinkmanArray = ["ΤΪΟίΧΙΡ―"];
var divHeight = 130+qqArray.length*36;
var strGetStatusEnd = '"></script>';
var QQ_A = new Array();
var strGetALinkHead = '<a style="text-decoration:none;" href="http://wpa.qq.com/msgrd?V=1&Uin=';
var strGetALinkMid = '&Site=ioshenmue&Menu=yes" target="blank">';
var strGetALinkEnd = '</a>';
for(var i=0;i<qqArray.length;i++)
{
    strGetStatusHead += qqArray[i]+":";
    QQ_A.push(strGetALinkHead + qqArray[i] + strGetALinkMid + qqLinkmanArray[i] + strGetALinkEnd);
}

document.write(strGetStatusHead + strGetStatusEnd);
setTimeout("setQQImg()",1);
function setQQImg(){
    var imgQQ=null;
    for(var i=0;i<online.length;i++){
        if (online[i]==0){
            img_All.push(img_off);
        }else{
            img_All.push(img_on);
        }
        imgQQ = document.getElementById("qq_"+i);
        if (imgQQ!=null) {
            imgQQ.src=img_All[i];
        }
    }
    window.onresize = resizeQQDiv;
}
suspendcode12="<DIV id=\"lovexin12\" style='left:0px;POSITION:absolute;width:108px;height:"+divHeight+"px;TOP:0px;z-index:100'>";
suspendcode12+='<iframe style=" z-index: -1; width: 104px;height:'+(divHeight-10)+'px;margin:4px 1px 5px 3px;   scrolling: no;" frameborder="0" src="about:blank"></iframe>';
suspendcode12+="<DIV style='left:0px;POSITION:absolute;;TOP:0px;z-index:100'>";
var recontent='<table align="left" style="width:90px" border="0" cellpadding=0 cellspacing=0 >' + 
'<tr>' + 
'<td style="padding:0;font-size:13px"  ><table style="width:90px" border="0" cellspacing="0" cellpadding="0" height="1">' + 
'<tr>' + 
'<td style="padding:0;font-size:13px; background:none" height="20"><img src="'+img_Path+'head_90304.gif"  border="0" usemap="#MapMapMap"></td>' + 
'</tr>' + 
'<tr>' + 
'<td style="padding:0;font-size:13px;padding-left:1px" background="'+img_Path+'center_1_90304_0.gif" >' + 
'<table style="width:90px"  border="0" align="center" cellpadding="0" cellspacing="0" >' + 
'<tr style="width:90px;height=15px"><td>&nbsp</td></tr>' + 

'<tr>' + 
'<td style="background:#F7F3F7;font-size:13px" >' + 
'<table  border="0" align="left" cellpadding="0" cellspacing="0" style="width:90px">' + 
'<!--begin-->' ;

for(var i=0;i<qqArray.length;i++)
{
    recontent +='<tr><td   align="center"><img id="qq_' +i+'" style="cursor:pointer;" alt="'+qqLinkmanArray[i]+'" src="'+img_Path+'QQonline.gif" onclick="window.open(\'http://wpa.qq.com/msgrd?V=1&Uin='+qqArray[i]+'&Site=ioshenmue&Menu=yes\')"></td></tr>' ;
    recontent +='<tr><td   align="center">&nbsp;' +QQ_A[i]+'</td></tr>';
}

recontent += '</table></td>' ;
recontent +='</tr>' ;
recontent +='<tr style="height=15px"><td>&nbsp</td></tr>' ;
recontent +='</table></td>';
recontent +='</tr>' ;
recontent +='<tr>' ;
recontent +='<td ><img src="'+img_Path+'end_90304.gif"></td>' ;
recontent +='</tr>' ;
recontent +='</table>' ; 
recontent +='</td>' ;
recontent +='</tr>' ; 
recontent +='</table>' ; 
recontent +='<map name="MapMapMap" onclick="far_close()" style="cursor:handle">' ;
recontent +='<area shape="rect" coords="71,8,102,30" href="#">' ; 
recontent +='</map>';

document.write(suspendcode12); 
document.write(recontent); 
document.write("</div></div>"); 
var qqMoveTimer=window.setInterval("heartBeat()",1);

function far_close()
{
	document.getElementById("lovexin12").innerHTML="";
	clearInterval(qqMoveTimer);
}

function resizeQQDiv(){
	try{
	    var QQDiv = document.getElementById("lovexin12");
		var divHeight = parseInt(QQDiv.offsetHeight,10);
		var divWidth = parseInt(QQDiv.offsetWidth,10);
		
		var docWidth = document.documentElement.clientWidth;
		var docHeight = document.documentElement.clientHeight;
		QQDiv.style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10)-50;
		QQDiv.style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10)-5;
		//debugger;
		if (QQDiv.style.left.substring(0,QQDiv.style.left.length-2)>document.body.clientWidth ) {
		    QQDiv.style.left = document.body.clientWidth - divWidth-5;
		    lastScrollX=0;

		}
		if (QQDiv.style.top.substring(0,QQDiv.style.top.length-2)>document.body.clientHeight ) {
		    QQDiv.style.top = document.body.clientHeight - divHeight -50 ;
		    lastScrollY=0;
		}
	}
	catch(e){}
}

