/*
Floating Menu script- based on original design by Roy Whittle (http://www.javascript-fx.com/)
Heavily Altered, and re-writen by Denis Pointer (http://designs.drummersdomain.com/)
*/
var menuBottom=-132, logoBottom=-132;
var expDays = 1;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
var menuPosition = getCookie("menupos");
if (!menuPosition) 
{
	menuPosition = "bottom"; 
}
setCookie("menupos", menuPosition, exp);
if (menuPosition=="bottom")
{
	var menuOffset=menuBottom;
	var logoOffset=0;
}else
{
	var menuOffset=0;
	var logoOffset=logoBottom;
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";

function ChangePos(newpos)
{
	if (newpos!="top" && newpos!="bottom")
	{
		newpos="bottom";
	}
	if (newpos!=menuPosition)
	{
		if (newpos=="top")
		{
			menuOffset=0;
			logoOffset=logoBottom;
			//Make Room on top of Page, remove room from bottom of page
		}else if (newpos=="bottom")
		{
			menuOffset=menuBottom;
			logoOffset=0;
			//Make Room on bottom of Page, remove room from top of page
		}
	}

	menuPosition=newpos;
	setCookie("menupos", menuPosition, exp);
	MakeFloat();
}


function FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
	el.init=false;
	el.flt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx);this.cy += (pY + this.sy - this.cy);
		if(!this.init)
		{
			this.init=true;
			this.cx = pX+this.sx;
			this.cy = pY+this.sy;
		}
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.flt()", 0);
	}
	return el;
}

function MakeFloat()
{
	FloatDiv("floatmenu", 0, menuOffset).flt();
	FloatDiv("floatlogo", 0, logoOffset).flt();
}
