var bewegcon;
var altpo = 0;
var y = 0;
var normal = 10;

function bottleimage() {
	bewegcon = new getEl('bottle');
	bottleposition();
}

function getEl(name){
  if (document.getElementById)  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  } else if (document.all)  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  } else if (document.layers) {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function bottleposition() {

	if (window.innerHeight) {	
		y = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		y = document.documentElement.scrollTop;
	} else if (document.body) {
		y = document.body.scrollTop;
	}
	
	if (y > normal) {
		if (y != altpo) {
		Position.prepare();
  		var coordinates = Position.cumulativeOffset($('footer'))[1];
			if ((y+643) > coordinates ) {
				bewegcon.style.marginTop = (coordinates-643) + "px";
			} else {
			 	y = ((y - altpo) * 0.1) + altpo;
				bewegcon.style.marginTop = y - normal + 20 + "px";
			}
		}
	} else {
		bewegcon.style.marginTop = 20 + "px";
	}
			
		
	altpo = y;
		
	var temp = setTimeout('bottleposition()');
}
