var textArray = new Array("<div class='popupHeading'>Revenue</div><div class='popupContent'>This is the sum of all sales reported for all operating divisions for the most recent fiscal year.</div>","<div class='popupHeading'>Research and Development Expense</div><div class='popupContent'>This is the total research and development expense as reported on the income statement for the most recent fiscal year.</div>","<div class='popupHeading'>EPS</div><div class='popupContent'>This is the Adjusted Income Available to Common Stockholders for the most recent fiscal year plus Discontinued Operations, Extraordinary Items, and Cumulative Effect of Accounting Changes for the same period divided by the most recent fiscal year's Diluted Weighted Average Shares Outstanding.</div>","<div class='popupHeading'>Dividend Per Share</div><div class='popupContent'>This is the Dividend Per Share amount paid by the company for the most recent fiscal year.</div>","<div class='popupHeading'>5-Year Revenue Growth Rate</div><div class='popupContent'>The Five Year Revenue Growth Rate is the annual compounded growth rate of Revenues over the last 5 years.</div>","<div class='popupHeading'>EPS</div><div class='popupContent'>This growth rate is the compound annual growth rate of Earnings Per Share Excluding Extraordinary Items and Discontinued Operations over the last 5 years. NOTE: If the value for either the most recent year or the oldest year is zero or negative, that year is ignored. If a 5 year growth rate cannot be calculated, a 4 year growth rate is used instead. If less than 4 years are available, a 'NA' (Not Available) code will be used.</div>","<div class='popupHeading'>5-Year Average Dividend</div><div class='popupContent'>This growth rate is the compound annual growth rate of cash dividends per common share of stock over the last 5 years. NOTE: If the value for either the most recent year or the oldest year is zero or negative, that year is ignored. If a 5 year growth rate cannot be calculated, a 4 year growth rate is used instead. If less than 4 years are available, a 'NA' (Not Available) code will be used.</div>","<div class='popupHeading'>Gross Margin</div><div class='popupContent'>This value measures the percent of revenue left after paying all direct production expenses. It is calculated as the trailing 12 months Total Revenue minus the trailing 12 months Cost of Goods Sold divided by the trailing 12 months Total Revenue and multiplied by 100.</div>","<div class='popupHeading'>Operating Margin</div><div class='popupContent'>This value measures the percent of revenues remaining after paying all operating expenses. It is calculated as the trailing 12 months Operating Income divided by the trailing 12 months Total Revenue, multiplied by 100. Operating Income is defined as Total Revenue minus Total Operating Expenses.</div>","<div class='popupHeading'>Profit Margin</div><div class='popupContent'>Also known as Return on Sales, this value is the Income After Taxes for the trailing twelve months divided by Total Revenue for the same period and is expressed as a percentage.</div>","<div class='popupHeading'>5-Year Average Dividend</div><div class='popupContent'>This value is the average of the dividend yield over the last 60 months.</div>","<div class='popupHeading'>Dividend Yield</div><div class='popupContent'>This value is the current percentage dividend yield based on the present cash dividend rate. It is calculated as the Indicated Annual Dividend divided by the current Price, multiplied by 100.</div>","<div class='popupHeading'>Dividends Per Share</div><div class='popupContent'>This is the sum of the Cash Dividends per share paid to common stockholders during the last trailing twelve month period.</div>","<div class='popupHeading'>Dividend Change %</div><div class='popupContent'>This is the percent change in annual Dividends Per Share as compared to the same period one year ago. It is calculated as the Dividends Per Share for the most recent fiscal year minus the Dividends Per Share for the same period one year ago divided by the annual Dividends Per Share one year ago, multiplied by 100.</div>","<div class='popupHeading'>Quick Ratio</div><div class='popupContent'>Total current assets excluding inventory/Current Liabilities.</div>","<div class='popupHeading'>Current Ratio</div><div class='popupContent'>This is the ratio of Total Current Assets for the most recent interim period divided by Total Current Liabilities for the same period.</div>","<div class='popupHeading'>LT Debt/Equity</div><div class='popupContent'>Long term debt divided by Shareholder's Equity multiplied by 100.</div>","<div class='popupHeading'>Total Debt/Equity</div><div class='popupContent'>Total debt divided by Shareholder's Equity multiplied by 100.</div>","<div class='popupHeading'>Recent Price</div><div class='popupContent'>This is the Closing or Last Bid Price. It is also referred to as the Current Price. </div>","<div class='popupHeading'>52 Week High</div><div class='popupContent'>This is the date of the highest Price the stock traded at in the last 12 months.</div>","<div class='popupHeading'>52 Week Low</div><div class='popupContent'>This is the date of the lowest Price the stock traded at in the last 12 months.</div>","<div class='popupHeading'>Average Volume</div><div class='popupContent'>This is the monthly average of the cumulative trading volume during the last three months.</div>","<div class='popupHeading'>P/E</div><div class='popupContent'>This ratio is calculated by dividing the current Price by the sum of the Diluted Earnings Per Share including discontinued operations AFTER Extraordinary Items and Accounting Changes over the last four interim periods.</div>","<div class='popupHeading'>Price/Sales</div><div class='popupContent'>This is the current Price divided by the Sales Per Share for the trailing twelve months. If there is a preliminary earnings announcement for an interim period that has recently ended, the revenue (sales) values from this announcement will be used in calculating the trailing twelve month revenue per share.</div>","<div class='popupHeading'>Price/Book</div><div class='popupContent'>This is the Current Price divided by the latest interim period Book Value Per Share.</div>","<div class='popupHeading'>Dividends Per Share</div><div class='popupContent'>This is the sum of the Cash Dividends per share paid to common stockholders during the last trailing twelve month period.</div>","<div class='popupHeading'>Book Value</div><div class='popupContent'>This is defined as the Common Shareholder's Equity divided by the Shares Outstanding at the end of the most recent interim period.  Book Value is the Total Shareholder's Equity minus Preferred Stock and Redeemable Preferred Stock.</div>","<div class='popupHeading'>EPS</div><div class='popupContent'>This is the Adjusted Income Available to Common Stockholders for the trailing twelve months plus Discontinued Operations, Extraordinary Items, and Cumulative Effect of Accounting Changes for the same period divided by the trailing twelve month Diluted Weighted Average Shares Outstanding</div>","<div class='popupHeading'>Revenue/Share</div><div class='popupContent'>This value is the trailing twelve month Total Revenue divided by the Average Diluted Shares Outstanding for the trailing twelve months.</div>","<div class='popupHeading'>Market capitalization</div><div class='popupContent'>This value is calculated by multiplying the current Price by the current number of Shares Outstanding.</div>","<div class='popupHeading'>Shares Outstanding</div><div class='popupContent'>These are the Diluted Weighted Average Shares Outstanding for the most recent interim period as reflected in the Income Statement.</div>","<div class='popupHeading'>Asset Turnover</div><div class='popupContent'>This value is calculated as the Total Revenues for the trailing twelve months divided by the Average Total Assets. The Average Total Assets is defined as the Total Assets for the 5 most recent quarters divided by 5.</div>","<div class='popupHeading'>Inventory Turnover</div><div class='popupContent'>This value measures how quickly the Inventory is sold. It is defined as Cost of Goods Sold for the trailing twelve months divided by Average Inventory. Average Inventory is calculated by adding the Inventory for the 5 most recent quarters and dividing by 5. </div>","<div class='popupHeading'>Return on Assets</div><div class='popupContent'>This value is the Income After Taxes for the trailing twelve months divided by the Average Total Assets, expressed as a percentage. Average Total Assets is calculated by adding the Total Assets for the 5 most recent quarters and dividing by 5.</div>" );


var dropdowncontent={
 	delaybeforehide: 10, //set delay in milliseconds before content box disappears onMouseout (1000=1 sec)
	disableanchorlink: true, //when user clicks on anchor link, should it be disabled?
	ajaxloadingmsg: "Loading content. Please wait...", 
	ajaxbustcache: true, //Bust cache when fetching pages?

	getposOffset:function(what, offsettype)	{
		return (what.offsetParent)? what[offsettype]+this.getposOffset(what.offsetParent, offsettype) : what[offsettype]
	},
	isContained:function(m, e) {
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e)){
			if(anchorobj.id.length>10) { 
        var i = anchorobj.id.substr(10,anchorobj.id.length);
			} else {
				i=0
			}
			if(anchorobj.offsetWidth>50) {
  		  var horizontaloffset=50//calculate user added horizontal offset
			} else {
				var horizontaloffset=anchorobj.offsetWidth;
			}
			if(anchorobj.offsetHeight>-47) {
				var verticaloffset=-35
			} else {
				var verticaloffset=(subobj.dropposition)? +(anchorobj.offsetHeight) : 0;
			}
			subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
			subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"
			//alert(anchorobj.offsetHeight)
			subobj.style.clip=(subobj.dropposition[1]=="top")? "rect(auto auto auto 0)" : "rect(0 auto 0 0)" //hide drop down box initially via clipping
			subobj.style.visibility="visible"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined") //clear timer that hides drop down box?
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
		ChangeText(i)
	},

	curveincrement:function(percent){
		return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime //get time animation has run
		if (elapsed<obj.glidetime){ //if time run is less than specified length
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			obj.style.clip=(direction=="down")? "rect(0 auto "+currentclip+" 0)" : "rect("+currentclip+" auto auto 0)"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
		else{ //if animation finished
			obj.style.clip="rect(0 auto auto 0)"
		}
	},
	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.left=subobj.style.top=0
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.delaybeforehide)
		}
	},
 init:function(anchoridA, pos, glidetime)
 {
	 	for(var i =0; i<anchoridA.length;i++)
		{
			var anchorid = anchoridA[i];
			
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		subobj.style.left=subobj.style.top=0
		anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e);}
		anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
		if (this.disableanchorlink) anchorobj.onclick=function(){}
		subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
		}
 }
}
function ChangeText(i) 
{
			
			if(document.getElementById("popupContent")!=null && document.getElementById("popupContent")!='undefined')
			{
			document.getElementById("popupContent").innerHTML = textArray[i-1];
			}
}