
		var remoteWindow = null;
		function launchMarketTracker(n,u,w,h) 
		{
			remoteWindow = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=yes,scrollbars=no');
			if (remoteWindow != null) 
			{
 				if (remoteWindow.opener == null)
  						remoteWindow.opener = self;
						
  				window.name = 'jpmwin';
  				remoteWindow.location.href = u;
 			}
		}

		var timeOut        = null;
		var portfolioWidth = 0;
				
		function delayHidePortofolio()
		{
			timeOut = setTimeout("hidePortofolio();", 400);
		}
		
		function resetDelay()
		{
			if(timeOut != null)
				clearTimeout(timeOut);
		}
		
		function checkPortofolio()
		{
			if(document.getElementById("portfolioShadow").style.display == "block")
				delayHidePortofolio();
		}

		function showPortofolio()
		{
			
			var portfolioShadowBox = document.getElementById("portfolioShadow");
			
			if(portfolioShadowBox == null)
				return;
			portfolioShadowBox.style.top =  getElementOffsetPosition("boxReference", "top")+ 10+ "px";
			portfolioShadowBox.style.display = "block";
			portfolioShadowBox.style.visibility = "hidden";	
			
			if(yfiie || yfisaf)
				portfolioShadowBox.style.left = getElementOffsetPosition("boxReference", "left") - this.portfolioWidth  + "px";
			else
				portfolioShadowBox.style.left = getElementOffsetPosition("boxReference", "left") - this.portfolioWidth - (document.getElementById("yfportfolio").offsetWidth - document.getElementById("yfportfolio").clientWidth)+ 6 + "px";
				
			portfolioShadowBox.style.visibility = "visible";	
			
			
		}

		function hidePortofolio()
		{
			var portofolioBox = document.getElementById("portfolioShadow");
			if(portofolioBox == null)
				return;
				
			portofolioBox.style.display = "none";
		}
		

		function setPortfolioBehavior()
		{
			var portfolioShadowBox = document.getElementById("portfolioShadow");
			var portfolioBox       = document.getElementById("yfportfolio");
			this.portfolioWidth    = portfolioBox.clientWidth;
			
			if(parseInt(portfolioShadowBox.clientHeight) > 350)
			{
				portfolioBox.style.height = "350px";
				if( !yfiie )
					portfolioBox.style.overflow = "-moz-scrollbars-vertical";
				
				if(yfisaf)
				{
					portfolioBox.style.overflow = "auto";
					
				}
			}
			
			portfolioShadowBox.style.position = "absolute";
			portfolioShadowBox.style.display = "none";
			
		}
		

		function getElementOffsetPosition(elementId, offsetType)
		{
			//offsetType -> top or left
			offsetType = offsetType.toLowerCase();
			var element = document.getElementById(elementId);
			
			if(element == null)
				return -1;
				
			var totalOffset = null;
			
			switch(offsetType)
			{
				case "left" :
					totalOffset = element.offsetLeft; break;
				case "top"  :
				  	totalOffset = element.offsetTop; break;
			}
			
			var parentElement = element.offsetParent;
			while(parentElement != null)
			{
				switch(offsetType)
				{
					case "left" :
						totalOffset += parentElement.offsetLeft; break;
					case "top"  :
						totalOffset += parentElement.offsetTop; break;
				}
				
				parentElement = parentElement.offsetParent;
			}
			
			return totalOffset;
		}
		


