Copy Code code as follows:
<!--home pictures floating start-->
<script type= "Text/javascript" language= "JavaScript" >
function addevent (obj, Evttype, func, CAP) {
Cap = Cap | | False
if (Obj.addeventlistener) {
Obj.addeventlistener (Evttype, func, CAP);
return true;
else if (obj.attachevent) {
if (CAP) {
Obj.setcapture ();
return true;
} else {
Return Obj.attachevent ("on" + Evttype, func);
}
} else {
return false;
}
}
function Getpagescroll () {
var xscroll, Yscroll;
if (Self.pagexoffset) {
Xscroll = Self.pagexoffset;
else if (document.documentelement && document.documentElement.scrollLeft) {
Xscroll = Document.documentElement.scrollLeft;
else if (document.body) {
Xscroll = Document.body.scrollLeft;
}
if (Self.pageyoffset) {
Yscroll = Self.pageyoffset;
else if (document.documentelement && document.documentElement.scrollTop) {
Yscroll = Document.documentElement.scrollTop;
else if (document.body) {
Yscroll = Document.body.scrollTop;
}
Arraypagescroll = new Array (Xscroll, Yscroll);
return arraypagescroll;
}
function GetPageSize () {
var xscroll, Yscroll;
if (window.innerheight && window.scrollmaxy) {
Xscroll = Document.body.scrollWidth;
Yscroll = Window.innerheight + window.scrollmaxy;
else if (Document.body.scrollHeight > Document.body.offsetHeight) {
Xscroll = Document.body.scrollWidth;
Yscroll = Document.body.scrollHeight;
} else {
Xscroll = Document.body.offsetWidth;
Yscroll = Document.body.offsetHeight;
}
var windowwidth, WindowHeight;
if (self.innerheight) {
WindowWidth = Self.innerwidth;
WindowHeight = Self.innerheight;
else if (document.documentelement && document.documentElement.clientHeight) {
WindowWidth = Document.documentElement.clientWidth;
WindowHeight = Document.documentElement.clientHeight;
else if (document.body) {
WindowWidth = Document.body.clientWidth;
WindowHeight = Document.body.clientHeight;
}
if (Yscroll < WindowHeight) {
PageHeight = WindowHeight;
} else {
PageHeight = Yscroll;
}
if (Xscroll < windowwidth) {
PageWidth = WindowWidth;
} else {
PageWidth = Xscroll;
}
Arraypagesize = new Array (PageWidth, PageHeight, WindowWidth, WindowHeight)
return arraypagesize;
}
var admoveconfig = new Object ();
Admoveconfig.isinitialized = false;
ADMOVECONFIG.SCROLLX = 0;
admoveconfig.scrolly = 0;
admoveconfig.movewidth = 0;
admoveconfig.moveheight = 0;
Admoveconfig.resize = function () {
var winsize = GetPageSize ();
Admoveconfig.movewidth = winsize[2];
Admoveconfig.moveheight = winsize[3];
Admoveconfig.scroll ();
}
Admoveconfig.scroll = function () {
var winscroll = Getpagescroll ();
ADMOVECONFIG.SCROLLX = winscroll[0];
admoveconfig.scrolly = winscroll[1];
}
addevent (window, "resize", admoveconfig.resize);
addevent (window, "scroll", admoveconfig.scroll);
function Admove (ID) {
if (! admoveconfig.isinitialized) {
Admoveconfig.resize ();
Admoveconfig.isinitialized = true;
}
var obj = document.getElementById (ID);
Obj.style.position = "absolute";
var W = admoveconfig.movewidth-obj.offsetwidth;
var H = admoveconfig.moveheight-obj.offsetheight;
var x = W * Math.random (), y = H * Math.random ();
var rad = (Math.random () + 1) * MATH.PI/6;
var kx = Math.sin (RAD), KY = Math.Cos (RAD);
var DirX = (Math.random () < 0.5 1:-1), DirY = (Math.random () < 0.5? 1:-1);
var step = 1;
var interval;
This. setlocation = function (VX, VY) {x = vx; y = VY;}
This. Setdirection = function (VX, VY) {DirX = VX; diry = VY;}
Obj. Custommethod = function () {
Obj.style.left = (x + admoveconfig.scrollx) + "px";
Obj.style.top = (y + admoveconfig.scrolly) + "px";
rad = (Math.random () + 1) * MATH.PI/6;
W = Admoveconfig.movewidth-obj.offsetwidth;
H = Admoveconfig.moveheight-obj.offsetheight;
x = x + Step * kx * DIRX;
if (x < 0) {DirX = 1; x = 0; kx = Math.sin (RAD); ky = Math.Cos (RAD);
if (x > W) {DirX =-1; x = W; kx = Math.sin (RAD); ky = Math.Cos (RAD);
y = y + step * KY * DIRY;
if (Y < 0) {DirY = 1; y = 0; kx = Math.sin (RAD); ky = Math.Cos (RAD);
if (Y > H) {diry =-1; y = H; kx = Math.sin (RAD); ky = Math.Cos (RAD);
}
This. Run = function () {
var delay = 10;
Interval = setinterval (obj. Custommethod, delay);
Obj.onmouseover = function () {clearinterval (interval);}
Obj.onmouseout = function () {interval = setinterval (obj. Custommethod, delay); }
}
}
</script>
<!--floating start-->
<div id=ad2 style= "Z-index:5;position:relative" >
<a href= ' policehtk.aspx ' target= ' _blank ' > </a><br> <a href= "#" onclick= "document.getElementById (' ad2 '). style.display= ' None ' > </a>
<!--floating over-->
</DIV>
<script type= "Text/javascript" language= "JavaScript" >
var ad2 = new Admove ("ad2");
Ad2. Run ();
Multiple groups of floating
</script>
<!--home pictures floating over-->