/*
Script by RoBorg
RoBorg@geniusbug.com
http://javascript.geniusbug.com
Please do not remove or edit this message
*/


/*
myName = new floater('myDivID', Position, Width, Height, Vertical Margin, Horizontal Margin);
For Width & Height, use -1 for automatic.
Positions: 
__________
|1   2   3|
|         |
|8   9   4|   <-- The page
|         |
|7___6___5|

*/


function initFloaters()
{
	allFloaters = new Array();

	floater1 = new floater('floater1Div', 5, -1, -1, 30, 30);
}


function floater(div, position, width, height, hMargin, vMargin)
{
	this.div = new divObject(div, 'document.');
	this.div.activate();
	this.div.show();
	if(width == -1) width = this.div.width;
	if(height == -1) height = this.div.height;
	this.position = position;
	this.width = width;
	this.height = height;
	this.hMargin = hMargin;
	this.vMargin = vMargin;

	this.doFloat = doFloat;
	this.idNo = allFloaters.length;
	allFloaters[allFloaters.length] = this;
	this.floatTimer = setInterval("allFloaters[" + this.idNo + "].doFloat()", 50);
}


function doFloat()
{
	browserVars.updateVars();

	var w = browserVars.width - this.width;
	var h = browserVars.height - this.height;

	if(this.position == 1){ var xPos = this.hMargin; var yPos = this.vMargin; }
	if(this.position == 2){ var xPos = w/2; var yPos = this.vMargin; }
	if(this.position == 3){ var xPos = w - this.hMargin; var yPos = this.vMargin; }
	if(this.position == 4){ var xPos = w - this.hMargin; var yPos = h/2; }
	if(this.position == 5){ var xPos = w - this.hMargin; var yPos = h - this.vMargin; }
	if(this.position == 6){ var xPos = w/2; var yPos = h - this.vMargin; }
	if(this.position == 7){ var xPos = this.hMargin; var yPos = h - this.vMargin; }
	if(this.position == 8){ var xPos = this.hMargin; var yPos = h/2; }
if(this.position == 9){ var xPos = w/2; var yPos = h/2; }

	if((isNaN(xPos)) || (isNaN(yPos))) return;

	this.div.moveTo(browserVars.scrollLeft + xPos, browserVars.scrollTop + yPos);
}



