	
function main() {
	this.topMargin = 180;
	if(Math.ceil(floatLayer.offsetTop) == this.topMargin) {
		this.topMargin = -260
	}
	this.constTime = new Date().getTime();
	this.slideTime = 1700;
	this.ns6 = (!document.all && document.getElementById); 
	this.ie4 = (document.all);
	this.ns4 = (document.layers);
	if(this.interval) {
		window.clearInterval(this.interval)
	}
	this.interval = window.setInterval("mainTrigger()", 50);	

}

 
function mainTrigger() { 
	if (this.ns4) { 
		this.currentY = document.floatLayer.top; 
		this.scrollTop = window.pageYOffset;
	}
	else if(this.ns6) {
		this.currentY = parseInt(document.getElementById('floatLayer').style.top); 
		this.scrollTop = scrollY;
	}
	else if(this.ie4) { 
		this.currentY = floatLayer.offsetTop;
		this.scrollTop = document.body.scrollTop; 
	} 
	var newTargetY = this.scrollTop + this.topMargin
	
	if(Math.ceil(this.currentY) == Math.ceil(newTargetY)) {
		window.clearInterval(this.interval)
	}

	if(this.currentY != newTargetY) {
		if (newTargetY != this.targetY) { 
			this.targetY = newTargetY
			floatStart(); 
		} 
		animator();
	} 
} 

function floatStart() { 
	this.posDiff = this.targetY - this.currentY 
	this.slideTime = Math.PI / (2 * this.slideTime) 
	if(Math.abs(this.posDiff) > this.findHt) { 
		this.posCurr = this.posDiff > 0 ? this.targetY - this.findHt : this.targetY + this.findHt 
		this.posDiff = this.posDiff > 0 ? this.findHt : -this.findHt 
	} 
	else { 
		this.posCurr = this.currentY 
	} 

} 

function animator() { 
	var now = new Date()
	var newY = this.posDiff * Math.sin(this.slideTime * (now.getTime() - this.constTime)) + this.posCurr;
	newY = Math.round(newY) 
	if((this.posDiff > 0 && newY > this.currentY ) || ( this.posDiff < 0 && newY < this.currentY )) { 
		if(this.ie4) { floatLayer.style.pixelTop = newY } 
		if(this.ns4) { document.floatLayer.top = newY }
		if(this.ns6) { document.getElementById('floatLayer').style.top = newY + "px" }
	} 
} 

function closeit() {
	if(this.interval) {
		window.clearInterval(this.interval)
	}
	this.topMargin = -250
	main();
}


