﻿
﻿
var currentSymbol="";var currentType="stock";var quoteTimeout;function ShowQuote(obj,symbol,isTwitPic){var par=obj;var totalOffsetLeft=obj.offsetLeft;var totalOffsetTop=obj.offsetTop;for(i=0;i<10;i++){if(par.offsetParent){par=(par.offsetParent);totalOffsetLeft+=par.offsetLeft;totalOffsetTop+=par.offsetTop;}}
var theWindowHeight=0;var theWindowWidth=1000;if(window.innerHeight){theWindowHeight=window.innerHeight-0;theWindowWidth=window.innerWidth-0;}
if(document.body.clientHeight){theWindowHeight=document.body.clientHeight-0;theWindowWidth=document.body.clientWidth-0;}
if(document.documentElement.clientHeight){theWindowHeight=document.documentElement.clientHeight-0;theWindowWidth=document.documentElement.clientWidth-0;}
var theWindowYOffset=0;var theWindowXOffset=0;if(window.pageYOffset){theWindowYOffset=window.pageYOffset-0;theWindowXOffset=window.pageXOffset-0;}
if(document.documentElement.scrollTop){theWindowYOffset=document.documentElement.scrollTop-0;theWindowXOffset=document.documentElement.scrollLeft-0;}
var absoluteBottom=theWindowYOffset+theWindowHeight;var absoluteRight=theWindowXOffset+theWindowWidth;var rLeft=(totalOffsetLeft+obj.offsetWidth)-95;var rRight=rLeft+450;var BoxHeight=265;var rTop=totalOffsetTop+20;var rBottom=rTop+BoxHeight;var thisType="stock";if(isTwitPic){rTop-=120
rBottom=rTop+650;thisType="img";}
if(rBottom>absoluteBottom){rTop=(rTop-BoxHeight);}
if(rRight>absoluteRight){rLeft=(rLeft-(rRight-absoluteRight))-170;}
var objMini=document.getElementById("divMiniQuote");objMini.style.display="";objMini.style.left=rLeft+"px";objMini.style.top=rTop+"px";if(currentSymbol!=symbol||currentType!=thisType||(objMini.innerHTML).indexOf("Loading")!=-1){if(isTwitPic){objMini.innerHTML="<div style='padding:15px;'>Loading Image...</div>"
quoteTimeout=setTimeout("GetTwitImage('"+symbol+"')",750);currentType="img";}
else{objMini.innerHTML="<div style='padding:15px;'>Loading Chart...</div>"
quoteTimeout=setTimeout("GetChart('"+symbol.toUpperCase()+"')",750);currentType="stock";}}
else{clearTimeout(quoteTimeout);}}
function GetChart(symbol){currentSymbol=symbol;clearTimeout(quoteTimeout);var objMini=document.getElementById("divMiniQuote");objMini.innerHTML=GetChartHTML(currentSymbol);}
function GetTwitImage(symbol){currentSymbol=symbol;clearTimeout(quoteTimeout);var objMini=document.getElementById("divMiniQuote");objMini.innerHTML=GetTwitPicHTML(currentSymbol);}
function HideQuote(){clearTimeout(quoteTimeout);var objMini=document.getElementById("divMiniQuote");objMini.style.display="none";}
function GetChartHTML(symbol){var html=''
html+='<iframe scrolling="no" width="265" height="225" '
html+='src="QM-Stock-Chart.aspx?scale=5d&symbol='+symbol+'&w=262&h=197&simple=1" '
html+='frameborder="0"></iframe>'
return html;}
function GetTwitPicHTML(twitPicID){var html=''
html+='<img '
html+='src="'+twitPicID+'" width="350" height="350" '
html+=' />'
return html;}
