// JavaScript Document

function addFloatNews(){
	this.windowHeight=document.documentElement.clientHeight
	}
addFloatNews.prototype={
	getContainer : function(containerId){
		var container=document.getElementById(containerId);
		return container
		},
	getData : function(containerId){
		this.selfObject=this
		this.contianer=this.getContainer(containerId)
		this.floatHeight=this.contianer.offsetHeight
		},
	setFloatPosition : function(){
		this.contianer.style.top=(this.windowHeight-this.floatHeight+document.documentElement.scrollTop)+'px';
		this.contianer.style.right=0;
		},
	addScrollEvent : function(){
		var selfObject=this.selfObject;
		DOS.addEvent(window,'scroll',function(){
			selfObject.contianer.style.top=(selfObject.windowHeight-selfObject.floatHeight+document.documentElement.scrollTop)+'px';
			})
		},
	addCloseEvent : function(){
		var selfObject=this.selfObject;
		var closeBtn=document.getElementById('closeBtn')
		DOS.addEvent(closeBtn,'click',function(){
			selfObject.contianer.style.display='none'
			})
		}
	}
var floatNews=new addFloatNews;

DOS.addOnload(function(){
	floatNews.getData('floatWindow')
	floatNews.setFloatPosition()
	floatNews.addScrollEvent()
	floatNews.addCloseEvent()
	})