	
	//define variable
	var div_y = 0;
	var distance = 0;
	
	function floatButton() {
		var ny;
		//set y position
		var y = document.body.clientHeight - document.all.topButton.offsetHeight -5;
		
		//set da float
		if (document.all) {
			ny = y+document.body.scrollTop;  
			distance=ny-div_y;
			if(div_y!=ny){
				div_y+=(distance/30);
			}
			document.all.topButton.style.pixelTop = div_y;	
		}
		else if (document.layers) {
			ny = y+window.pageYOffset;  
			distance=ny-div_y;
			if(div_y!=ny){
				div_y+=(distance/30);
			}
			document.topButton.top = div_y;
		}
		
		else if (document.getElementById) {
			ny = y+document.body.scrollTop;  
			distance=ny-div_y;
			if(div_y!=ny){
				div_y+=(distance/30);
			}
			document.getElementById('topButton').style.top = div_y;	
			}
	
	}
	
	//if is IE
	if(navigator.appName == "Microsoft Internet Explorer"){
		floatButton_ie();
	}
	//if not
	else{
		setInterval ("floatButton()");
	}
	/*if (document.all){
		window.onscroll = floatButton;
	}*/
	/*else if(document.getElementById){
		setInterval ('floatButton()');
	}*/
function initButton() {

	//set x position
	if (document.all) {
		document.all.topButton.style.pixelLeft = document.body.clientWidth - document.all.topButton.offsetWidth;
		document.all.topButton.style.visibility = 'visible';
	}
	else if (document.layers) {
		document.topButton.left = window.innerWidth - document.topButton.clip.width - 15;
		document.topButton.visibility = 'show';
	}
	else if (document.getElementById) {
		document.getElementById('topButton').style.left = (window.innerWidth - 45) + 'px';
		document.getElementById('topButton').style.visibility = 'visible';
	}
}

	function floatButton_ie() {
		
		var ny;
		//set y position
		var y = document.body.clientHeight - document.all.topButton.offsetHeight;
		
		if (document.all) {
			ny = y+document.body.scrollTop;  
			distance=ny-div_y;
			if(div_y!=ny){
				div_y+=(distance/30);
			}
			document.all.topButton.style.pixelTop = div_y;	
		}
		else if (document.getElementById) {
			ny = y+document.body.scrollTop;  
			distance=ny-div_y;
			if(div_y!=ny){
				div_y+=(distance/30);
			}
			document.getElementById('topButton').style.top = div_y;	
	   }
   		setInterval ("floatButton_ie()");
	}
	
