
﻿
var currentSymbol="";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=105;var rTop=totalOffsetTop+20;var rBottom=rTop+BoxHeight;if(isTwitPic){rBottom=rTop+355;}
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){if(isTwitPic){objMini.innerHTML="<div style='padding:15px;'>Loading Image...</div>"
quoteTimeout=setTimeout("GetTwitImage('"+symbol+"')",750);}
else{objMini.innerHTML="<div style='padding:15px;'>Loading Chart...</div>"
quoteTimeout=setTimeout("GetChart('"+symbol.toUpperCase()+"')",750);}}
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='<div style="text-align:center;font-size:11pt;">'
html+='<b>'+symbol+' Chart</b> '
html+='</div><img src="http://ichart.finance.yahoo.com/t?s='+symbol+'=X" width="192" height="96" />'
return html;}
function GetTwitPicHTML(twitPicID){var html='<div style="text-align:center;font-size:11pt;">'
html+='<img '
html+='src="http://twitpic.com/show/large/'+twitPicID+'.jpg" '
html+=' />'
return html;}