	var ns6 = (!document.all && document.getElementById);
	var ie4 = (document.all);
	var ns4 = (document.layers);
	var NS  = document.layers;
	var MZ  = (!document.all && document.getElementById);
	var whichIt = null;
	var timer_x;
	function StartFloating(PanelName, topMargin , rightMargin, panelWidth, IntervalTime)
	{
		var FloatPanel;
		FloatPanel = Browser.ObjRef(PanelName);
		FloatPanel.isFloatPanel = true;
		FloatPanel.topMargin = topMargin;
		FloatPanel.xtopMargin = topMargin;
		FloatPanel.rightMargin = rightMargin;
		FloatPanel.panelWidth = panelWidth
		FloatPanel.slideTime = 500;
		FloatPanel.isDropDrag = false;
		timer_x = setInterval("FloatingLayerMain('" + PanelName + "')",IntervalTime);
	}

	function FloatingLayerMain(PanelName)
	{
		this.PanelName = PanelName;

		this.FloatPanel = Browser.ObjRef(PanelName);
		//begin : stepfirst edit 970820 for mvc height
		var top_y = document.body.scrollTop;
		var now_y = this.FloatPanel.xtopMargin - top_y;
		if(now_y<260) now_y = 260;
		this.FloatPanel.topMargin = now_y;
		//-end

		if ( this.FloatPanel.isDropDrag )
			return;
		if (ns4)
		{
			this.currentY  = Browser.StyleRef(PanelName).top;
			this.FloatPanel.left = document.body.offsetWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth;
			this.scrollTop = window.pageYOffset;
			mainTrigger();
		}
		else if(ns6)
		{
			this.currentY = parseInt(this.FloatPanel.style.top);
			this.FloatPanel.style.left = (document.body.offsetWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth) + "px";
			this.scrollTop = scrollY;
			mainTrigger();
		}
		else if(ie4)
		{
			this.currentY  = this.FloatPanel.style.pixelTop;
			this.FloatPanel.style.pixelLeft = document.body.clientWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth;
			this.scrollTop = document.body.scrollTop;
			mainTrigger();
		}
	}

	function mainTrigger()
	{
		var newTargetY = this.scrollTop + this.FloatPanel.topMargin;
		if ( this.currentY != newTargetY)
		{
			if ( newTargetY != this.targetY )
			{
				this.targetY = newTargetY;
				floatStart();
			}
			animator();
		}
	}

	function floatStart()
	{
		var now = new Date();
		this.A = this.targetY - this.currentY;
		this.B = Math.PI / ( 2 * this.FloatPanel.slideTime );
		this.C = now.getTime();
		if (Math.abs(this.A) > this.findHt)
		{
			this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
			this.A = this.A > 0 ? this.findHt : -this.findHt;
		}
		else
		{
			this.D = this.currentY;
		}
	}

	function animator()
	{
		var now = new Date()
		var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D
		newY = Math.round(newY);
		if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY ))
		{
			if ( ie4 )
			{
				this.FloatPanel.style.pixelTop = newY;
				this.FloatPanel.style.pixelLeft = document.body.clientWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth;
			}
			if ( ns4 )
			{
				this.FloatPanel.top = newY;
				this.FloatPanel.left = document.body.offsetWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth;
			}
			if ( ns6 )
			{
				this.FloatPanel.style.top = newY + "px";
				this.FloatPanel.style.left = (document.body.offsetWidth-this.FloatPanel.rightMargin-this.FloatPanel.panelWidth) + "px";
			}
		}
	}

	function checkFocus(x,y)
	{
	        stalkerx = Browser.ObjRef("floater").pageX;
	        stalkery = Browser.ObjRef("floater").pageY;
	        stalkerwidth = Browser.ObjRef("floater").clip.width;
	        stalkerheight = Browser.ObjRef("floater").clip.height;
	        return ( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight)))
	}

	function grabIt(e)
	{
		if(ie4)
		{
			whichIt = event.srcElement;
			while ( !whichIt.isFloatPanel )
			{
				whichIt = whichIt.parentElement;
				if (whichIt == null)
				{
					return true;
				}
			}
			whichIt.isDropDrag = true;
			whichIt.style.pixelLeft = whichIt.offsetLeft;
			whichIt.style.pixelTop = whichIt.offsetTop;
			currentX = (event.clientX + document.body.scrollLeft);
	   		currentY = (event.clientY + document.body.scrollTop);
		}
		else
		{
	        	window.captureEvents(Event.MOUSEMOVE);
	        	if( checkFocus (e.pageX,e.pageY) )
	        	{
	                	whichIt = Browser.ObjRef("floater");
		                StalkerTouchedX = e.pageX-Browser.ObjRef("floater").pageX;
		                StalkerTouchedY = e.pageY-Browser.ObjRef("floater").pageY;
	        	}
	        }
	        if ( whichIt )
		 	document.onmousemove = moveIt;
		return true;
	}

	function moveIt(e)
	{
		if (whichIt == null)
		{
			return false;
		}
		if(ie4)
		{
			newX = (event.clientX + document.body.scrollLeft);
			newY = (event.clientY + document.body.scrollTop);
			distanceX = (newX - currentX);
			distanceY = (newY - currentY);
			currentX  = newX;
			currentY = newY;
			whichIt.style.pixelLeft += distanceX;
			whichIt.style.pixelTop += distanceY;
			if(whichIt.style.pixelTop < document.body.scrollTop)
				whichIt.style.pixelTop = document.body.scrollTop;
			if(whichIt.style.pixelLeft < document.body.scrollLeft)
				whichIt.style.pixelLeft = document.body.scrollLeft;
			if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20)
				whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
			if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5)
				whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
			whichIt.topMargin = whichIt.style.pixelTop-document.body.scrollTop;
			whichIt.rightMargin = document.body.offsetWidth-whichIt.style.pixelLeft-whichIt.panelWidth - 16;
			event.returnValue = false;
		}
		else
		{
			whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
	        	if(whichIt.left < 0+self.pageXOffset)
	        		whichIt.left = 0+self.pageXOffset;
	        	if(whichIt.top < 0+self.pageYOffset)
	        		whichIt.top = 0+self.pageYOffset;
	        	if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17))
	        		whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
	        	if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17))
	        		whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
	        	return false;
		}
		return false;
	}

	function dropIt(e)
	{
		if ( !whichIt )
			return true;
		whichIt.isDropDrag = false;
		whichIt = null;
	 	document.onmousemove = null;
		if(ns4||ns6)
			window.releaseEvents (Event.MOUSEMOVE);
		return true;
	}

	if(ns4||ns6) {
		window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
		window.onmousedown = grabIt;
	 	window.onmousemove = moveIt;
		window.onmouseup = dropIt;
	}

	if(ie4)
	{
		document.onmousedown = grabIt;
		document.onmouseup = dropIt;
	}
