/*
Floating Image
*/
var cursorpath;
var xpos;
var ypos;
var fwd;
var fht;
var x;
var y;

floaterb=floaternameb;

urlref=floaterurl;
cursorpath=floatername;
xpos=floaterx;
ypos=floatery;
fwd=floaterwd;
fht=floaterht;

if (document.layers)
{
document.write("<LAYER NAME='pointers' LEFT="+xpos+"TOP="+ypos+"><a href='" + urlref + "' target=_blank><img src='"+cursorpath+"' border=0 width="+fwd+" height="+fht+" name='imgA'></a></LAYER>")
}
else if (document.all)
{
document.write("<div id='pointers' style='position:absolute;top:"+ypos+"px;left:"+xpos+"px;width:"+fwd+"px;height:"+fht+"px;z-index:50'><a href='" + urlref + "' target=_blank><img src='"+cursorpath+"' border=0 width="+fwd+" height="+fht+" name='imgA'></a></div>")
}

count=-1;                                                     
move=1;

function Curve()
{
abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)
for (i=0; i < abc.length; i++)
{
var C=Math.round(Math.random()*[i])
}
howbend=abc[C];
setTimeout('Curve()',1900);
return howbend;
}

degree = 60;
function MoveRandom()
{
PathBend=degree+=howbend;//ok!
oldx = x;
oldy = y;
y = 4*Math.sin(PathBend*Math.PI/180);
x = 6*Math.cos(PathBend*Math.PI/180);
if (x < 0 & oldx > 0)
{
  swapThis(floaterb, 'imgA')
}
if (x > 0 & oldx < 0)
{
  swapThis(cursorpath, 'imgA')
}
if (document.layers)
{
ypos+=y;
xpos+=x;
document.pointers.top=ypos+window.pageYOffset;
document.pointers.left=xpos+window.pageXOffset;
}
else if (document.all)
{
ypos+=y;
xpos+=x;
document.all.pointers.style.top=ypos+document.body.scrollTop;
document.all.pointers.style.left=xpos+document.body.scrollLeft;
}
T=setTimeout('MoveRandom()',50);
}
function edges()
{
if (document.layers)
{
if (document.pointers.left >= window.innerWidth-fwd-30+window.pageXOffset)
  {
  swapThis(floaterb, 'imgA')
  degree=Math.round(Math.random()*45+157.5);
  }
if (document.pointers.top >= window.innerHeight-fht-10+window.pageYOffset)
{
degree=Math.round(Math.random()*45-112.5);
}
if (document.pointers.top <= 2+window.pageYOffset)
{
degree = Math.round(Math.random()*45+67.5);//OK!
}
if (document.pointers.left <= 2+window.pageXOffset)
{
 swapThis(cursorpath, 'imgA')
 degree = Math.round(Math.random()*45-22.5);//OK!
}
}
else if (document.all)
{
if (document.all.pointers.style.pixelLeft >= document.body.offsetWidth-fwd-30+document.body.scrollLeft)
  {
  swapThis(floaterb, 'imgA')
  degree=Math.round(Math.random()*45+157.5);
  }
if (document.all.pointers.style.pixelTop >= document.body.offsetHeight-fht-10+document.body.scrollTop)
{
degree=Math.round(Math.random()*45-112.5);
}
if (document.all.pointers.style.pixelTop <= 2+document.body.scrollTop)
{
degree = Math.round(Math.random()*45+67.5);//OK!
}
if (document.all.pointers.style.pixelLeft <= 2+document.body.scrollLeft)
{
 swapThis(cursorpath, 'imgA')
 degree = Math.round(Math.random()*45-22.5);//OK!
}
}
setTimeout('edges()',100);
}

function swapThis(imgSwap,imgName)
{
 document [imgName].src = imgSwap;
}  

function starteffect()
{
Curve();
MoveRandom();// onUnload="opener.gO()"
edges();
}

if (document.all||document.layers)
{
window.onload=starteffect;
}
