﻿
float_layer = function ()
{

this.float_html ='' 
+'<div id="div_float_right" '
+'style="position:absolute; width:120px; height:100px; text-align:left;">'
+'<div style="background-color:#fff;">'
+'<dl class="tbox">'
+'<dt><strong>常用工具</strong></dt>'
+'<dd>'
+'<ul class="float_link">'
+'<li><a href="/" target="_blank">IP地址查询</a></li>'
+'<li><a href="/" target="_blank">IP地址段查询</a></li>'



+'</ul>'
+'</dd>'
+'</dl>'
+'</div>'
+'</div>';


this.creatediv = function(html)
{
document.write(html);
}

this.p_init = false;

this.move = function() 
{
var d = document.getElementById("div_float_right");
var dh = parseInt(d.style.height);
var dw = parseInt(d.style.width) + 2;
var w = document.documentElement.clientWidth - dw  + parseInt(document.documentElement.scrollLeft);
var h = document.documentElement.clientHeight * 0.5 - dh  + parseInt(document.documentElement.scrollTop);
var isGO = (window.navigator.userAgent.indexOf("Chrome") != -1)?true:false;
if (isGO) 
{
    h = document.documentElement.clientHeight * 0.5 + document.body.scrollTop - dh;  
}

if (f_layer.p_init==false)
{
p_init = true;
d.style.left = w+"px";
d.style.top = h+"px";
}

var l = parseInt(d.style.left);
var t = parseInt(d.style.top);



if (l!=w||t!=h){ 
if (l!=w){ l = Math.floor(l*0.8+w*0.2); 
if (Math.abs(l-w)<5) 
{
if ((l-w)<0)
l = l+1;
else 
l = l-1; 
}
d.style.left = l + "px"; 
}

if (t!=h){ t = Math.floor(t*0.8+h*0.2); 
if (Math.abs(t-h)<5) 
{
if ((t-h)<0)
t = t+1; 
else
t = t-1; 
}
d.style.top = t + "px"; 
}

}

setTimeout("f_layer.move();",50);

};

}


var f_layer = new  float_layer();
f_layer.creatediv(f_layer.float_html);
f_layer.move();

