/* Javascript by Daniel Cohen Gindi (c) danielgindi@gmail.com 054-5655765 */
/* Version: 2009-01-01 */

function createFloatDiv(id, sx, sy){
    //var el = $find(id);
    var el = document.getElementById(id);
  var px = document.layers ? "" : "px";

  el.cx = el.sx = sx;
  el.cy = el.sy = sy;
  
  el.resetPos=function(x,y){this.style.left=x+px;this.style.top=y+px;};
  
	el.float=function()
	{
		var pX = (this.sx >= 0) ? 0 : getWindowClientWidth();
    var pY = getPageYOffset()-200;
		if(this.sy<0) pY += getWindowClientHeight();
		this.cx += (pX + this.sx - this.cx)/8;
		this.cy += (pY + this.sy - this.cy)/8;
		this.resetPos(this.cx,this.cy);
    setTimeout(function(){el.float();}, 40);
  }
  return el;
}