
	/* 
	Heavily modified by Torben Rohde, Subsero A/S (19/5-2008) 
	Do not reused for other projects, this script is customized for the Sonofon product guide
	*/
	/***********************************************
	* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
	* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
	* This notice must stay intact for legal use.
	* Visit http://www.dynamicdrive.com/ for full source code
	***********************************************/

	var startX = -1; //set x offset of bar in pixels
	var startY = -1; //set y offset of bar in pixels
	
	function iecompattest()
	{
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

	function positionComparisonSelection()
	{
		var isNetscape = (navigator.appName.indexOf("Netscape") != -1) || window.opera;

		startX = $("comparisonSelectionFloater").viewportOffset()[0];
		//startY = $("filterInterface").getHeight() + $("filterInterface").cumulativeOffset()[1] + positionerPixelMarginToFilterInterface;
		startY = $("filterInterface").cumulativeOffset()[1];		

		function prepareElement(id)
		{
			var elem = document.getElementById(id);
			elem.style.visibility="visible"
			
			if (document.layers)
			{
				elem.style = elem;
			}

			elem.setPosition = function(x,y)
				{
					this.style.left = x + "px";
					this.style.top = y + "px";
				};
           
            
			elem.x = startX;
			elem.y = startY;
           
			return elem;
		}
	    var test = 0;
		window.stayTopLeft = function()
		{
			
			//REMOVED - page top offset is set explicitly by the surrounding page (this solution runs in an iframe)
			var pY = null;
			if (isNetscape)
			{
				pY = pageYOffset +10;
			}
			else
			{
				pY = iecompattest().scrollTop +10;
			}		
			

			if (pY > startY)
			{
				ftlObj.y += (pY - ftlObj.y) / positionerSmoothness;
			}
			else
			{
				ftlObj.y += (startY - ftlObj.y) / positionerSmoothness;
			}		
           
			ftlObj.setPosition(ftlObj.x, ftlObj.y);
			setTimeout("stayTopLeft()", positionerUpdateIntervalMsec);
		}
			
		ftlObj = prepareElement("comparisonSelectionFloater");		
		stayTopLeft();
		
		
	    
	    
		
		
		
	}
