function floatingBox(c,b,a){this.targetX=-250;this.targetY=10;this.interval=50;this.menu=c;this.index=a;this.options=b;this.hasInner=typeof(window.innerWidth)=="number";this.hasElement=document.documentElement&&document.documentElement.clientWidth;this.move=function(){jQuery(this.menu).css("left",this.nextX+"px").css("top",this.nextY+"px")};this.computeShifts=function(){var d=document.documentElement;this.shiftX=this.hasInner?pageXOffset:this.hasElement?d.scrollLeft:document.body.scrollLeft;if(this.targetX<0){if(this.hasElement&&this.hasInner){this.shiftX+=d.clientWidth>window.innerWidth?window.innerWidth:d.clientWidth}else{this.shiftX+=this.hasElement?d.clientWidth:this.hasInner?window.innerWidth:document.body.clientWidth}}this.shiftY=this.hasInner?pageYOffset:this.hasElement?d.scrollTop:document.body.scrollTop;if(this.targetY<0){if(this.hasElement&&this.hasInner){this.shiftY+=d.clientHeight>window.innerHeight?window.innerHeight:d.clientHeight}else{this.shiftY+=this.hasElement?document.documentElement.clientHeight:this.hasInner?window.innerHeight:document.body.clientHeight}}};this.doFloat=function(){var e,d;this.computeShifts();e=(this.shiftX+this.targetX-this.nextX)*0.07;if(Math.abs(e)<0.5){e=this.shiftX+this.targetX-this.nextX}d=(this.shiftY+this.targetY-this.nextY)*0.07;if(Math.abs(d)<0.5){d=this.shiftY+this.targetY-this.nextY}if(Math.abs(e)>0||Math.abs(d)>0){this.nextX+=e;this.nextY+=d;this.move()}setTimeout("funcFloating["+this.index+"].func()",this.interval)};this.initSecondary=function(){this.computeShifts();this.nextX=this.shiftX+this.targetX;this.nextY=this.shiftY+this.targetY;this.move()};this.position=function(e,d){if(typeof(e)=="number"){this.targetX=e}else{if(typeof(e)=="string"){switch(e){case"left":this.targetX=5;break;case"right":this.targetX=-((jQuery(this.menu).outerWidth())+5);break}}}if(typeof(d)=="number"){this.targetY=d}else{if(typeof(d)=="string"){switch(d){case"top":this.targetY=5;break;case"bottom":this.targetY=-((jQuery(this.menu).outerHeight()+5));break}}}};this.init=function(){jQuery(this.menu).css("position","absolute");if(typeof(this.options)=="object"){for(var d in this.options){switch(d){case"targetX":case"targetY":if(typeof(this.options[d])=="number"){this[d]=this.options[d]}else{if(typeof(this.options[d])=="string"){switch(this.options[d]){case"top":this.targetY=5;break;case"bottom":this.targetY=-((jQuery(this.menu).outerHeight()+5));break;case"left":this.targetX=5;break;case"right":this.targetX=-((jQuery(this.menu).outerWidth())+5);break}}}break;default:this[d]=this.options[d]}}}this.initSecondary();this.doFloat()}}var funcFloating={};jQuery.fn.floating=function(a){return jQuery(this).each(function(d){var b=0;for(var c in funcFloating){b=parseInt(c)}funcFloating[b+1]={};funcFloating[b+1].box=this;funcFloating[b+1].obj=new floatingBox(this,a,(b+1));funcFloating[b+1].func=function(){funcFloating[b+1].obj.doFloat()};if(document.layers){funcFloating[b+1].obj.init()}else{funcFloating[b+1].obj.init();funcFloating[b+1].obj.initSecondary()}})};jQuery.fn.floatingPosition=function(b,a){return jQuery(this).each(function(d){for(var c in funcFloating){if(funcFloating[c].box==this){funcFloating[c].obj.position(b,a)}}})};
