<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Stock Quote"
        directory_title="Stock Quote"
        title_url="http://www.stockmarketstudio.com"          
        description="Quotes, News, and Charts for your 5 stocks of your choice. Courtesy of StockMarketStudio.com"
        author="Diagramics Software Corporation"
        author_email="a124@usa.com"
        author_affiliation="Diagramics Software Corporation"
        author_location="Vancouver, BC, Canada"
        author_photo="http://igoogle.stockmarketstudio.com/author_photo.png"
        author_link="http://www.diagramics.com"
        author_aboutme="Diagramics is a leading provider of online imaging solutions"
        author_quote="proud developer of 'XpressCharts' financial charting solution for OptionsXpress.com"
        screenshot="http://igoogle.stockmarketstudio.com/StockQuote/Sceenshot.png"
        thumbnail="http://igoogle.stockmarketstudio.com/StockQuote/thumbnail.png"
        category="finance"
        width="300"
        height="294">
<Require feature="finance"/>
<Require feature="settitle"/>
</ModulePrefs>

<UserPref name="s0" display_name="Symbol 1" default_value="MSFT" required="true" />
<UserPref name="s1" display_name="Symbol 2" default_value="GOOG" required="false" />
<UserPref name="s2" display_name="Symbol 3" default_value="AMZN" required="false" />
<UserPref name="s3" display_name="Symbol 4" default_value="YHOO" required="false" />
<UserPref name="s4" display_name="Symbol 5" default_value="AAPL" required="false" />

<Content type="html">

<![CDATA[
<style type="text/css">
body{font-family:sans-serif;font-size:11px;}
.hdr{background-color:#E0E0E0;padding:2px;height:40px;}
.btn{border:1px solid steelblue;padding:2px;font-size:9px;background-color:white;top:0px;width:34px;margin-left:1px;margin-right:1px;position:absolute;cursor:pointer;}
.abs{position:absolute;top:0px;left:0px;}
.rel{position:relative;width:300px;overflow:hidden;}
.quote{left:39px;top:5px;font-size:12px;padding:2px;font-weight:bold;}
.news{background-color:#faf2de;}
.news A{color:#414141;}
.newsHdr{background-color:#99A9B9;color:#ffffff;width:300px;font-family:Verdana,Arial;font-size:12px;padding-left:4px;height:16px;position:relative;}
#gadget{height:290px;border:1px solid #c1c1c1;}
#adv{background-color:#99A9B9;color:#ffffff;font-family:Verdana,Arial;font-size:11px;padding-left:4px;height:16px;top:276px;left:200px;width:100px;cursor:pointer;}
#ads{width:300px;height:270px;border:1px solid #404040;background-color:#ffffff;top:20px;display:none;}
#img1{margin-left:46px;margin-top:4px;border:0px;width:240px;height:130px;}
</style>

<div id="gadget" class="rel">
<div class="hdr rel">
<div class="abs quote"><span id="SYM0">MSFT:</span> &nbsp;<span id="SYM0_l"></span>&nbsp;(<span id="SYM0_c"></span>) </div>
<div class="abs" style="left:132px;top:27px;color:#616161" >last trade:<span id="SYM0_lt"></span></div>
<a id="link1" href="http://www.stockmarketstudio.com/InteractiveCharts.aspx" target="_blank">
<img src='http://igoogle.stockmarketstudio.com/StockQuote/Chart.gif' 
style="position:absolute;left:4px;top:4px;border:0px;width:32px;height:32px;cursor:pointer;" 
title="click to view interactive chart with technical indicators" onclick="onView(this);" alt="click to view interactive chart with technical indicators"/></a>
</div>

<div class="rel">
<span class="btn" id="sc0" style="top:0px;" onclick="GetQuote(s0);">MSFT</span>
<span class="btn" id="sc1" style="top:20px;" onclick="GetQuote(s1);">GOOG</span>
<span class="btn" id="sc2" style="top:40px;" onclick="GetQuote(s2);">AMZN</span>
<span class="btn" id="sc3" style="top:60px;" onclick="GetQuote(s3);">YHOO</span>
<span class="btn" id="sc4" style="top:80px;" onclick="GetQuote(s4);">AAPL</span>
<a id="link2" href="http://www.stockmarketstudio.com/InteractiveCharts.aspx" target="_blank">
<img src='http://igoogle.stockmarketstudio.com/images/blank.gif' id='img1' title="click to view interactive chart with technical indicators" onclick="onView(this);" alt="click to view interactive chart with technical indicators"/>
</a></div>

<div class="news rel">
<div class="newsHdr">Recent News for <b><span id="sn">MSFT</span>:</b></div>
<div style="padding:4px;">
<a id="newsLink0" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank"><span id="news0">&nbsp;</span></a><br/>
<a id="newsLink1" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank"><span id="news1">&nbsp;</span></a><br/>
<a id="newsLink2" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank"><span id="news2">&nbsp;</span></a><br/>
<a id="newsLink3" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank"><span id="news3">&nbsp;</span></a><br/>
<a id="newsLink4" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank"><span id="news4">&nbsp;</span></a><br/>
</div>
<a id="moreNews" href="http://www.stockmarketstudio.com/Articles.aspx" target="_blank">
<img src='http://igoogle.stockmarketstudio.com/StockQuote/More.png' style="position:absolute;left:230px;top:1px;border:0px;width:40px;height:14px;" title="click for more stock market news" alt="click for more stock market news"/>
</a>
</div>

</div>

<script type="text/javascript">
var largeImgUrl="http://www.stockmarketstudio.com/InteractiveCharts.aspx";
var prefs=new _IG_Prefs();
var s0=prefs.getString("s0").toUpperCase();SetBtn("sc0",s0);
var s1=prefs.getString("s1").toUpperCase();SetBtn("sc1",s1);
var s2=prefs.getString("s2").toUpperCase();SetBtn("sc2",s2);
var s3=prefs.getString("s3").toUpperCase();SetBtn("sc3",s3);
var s4=prefs.getString("s4").toUpperCase();SetBtn("sc4",s4);
var lastS=s0;
GetQuote(s0);
function GetQuote(s)
{
  var ss=[s];//,s1,s2,s3,s4];
  var ss2={}; ss2[s]='SYM0';//ss2[s1]='SYM1';ss2[s2]='SYM2';ss2[s3]='SYM3';ss2[s4]='SYM4'
  var quote = new google.finance.Quote(); 
  quote.enableDomUpdates(ss2);
  quote.addListener(OnData);
  quote.getQuotes(ss);
  function OnData(d)
  {
    var s=d[google.finance.TICKER];
    GetChart(s,d);
  }
  SetSpan("SYM0",s+":");
  GetNews(s);
  _IG_SetTitle("Stock Quote ( "+s+" )");
   largeImgUrl="http://www.stockmarketstudio.com/InteractiveCharts.aspx?s="+s+"&t="+new Date().getTime();
  _gel("link1").href=largeImgUrl;
  _gel("link2").href=largeImgUrl;
}
function GetChart(s,d)
{
  lastS=s;
  var url="http://imgserver.diagramics.com/ImgServer.ashx?cmd=112&w=240&h=130&s="+s+"&t=GoogleGadget_250x170&du=1m&cs=SummerTime";
  url+="&last="+d[google.finance.LAST];
  _gel("img1").src=url;
}
function SetBtn(id,s)
{
  s=s.toUpperCase();
  var b=_gel(id);
  b.title="Show "+s;
  b.firstChild.data=s;
}
function SetLink(id,txt,link){var a=_gel(id);a.href=link;var c=a.firstChild;c.firstChild.data=txt;}
function SetSpan(id,txt){var c=_gel(id).firstChild;c.data=txt;}
function GetNews(s)
{
  SetSpan("sn",s);
  var url="http://finance.google.com/finance?morenews=5&rating=1&output=rss&q=";
  _IG_FetchFeedAsJSON(url+s,
     function(fd)
     {
    if(fd==null)return;
    for(var i=0;i<5;i++)
        {
          var e=(i<fd.Entry.length)?fd.Entry[i]:null;
          if(!e)continue;
          var s1=e.Title;
          if(s1.length>45)s1=s1.substr(0,45)+" ...";
          SetLink("newsLink"+i,s1,e.Link);
//          SetSpan("news"+i,s1);
        };
        SetNews(s);
     },5,false);
}
function onView(img)
{
  var href=img.parentElement;
  href.href=largeImgUrl;
}
function SetNews(s)
{
  var url="http://www.stockmarketstudio.com/Articles.aspx?s="+s;
  _gel("moreNews").href=url;
}
</script> 

]]> 
</Content>
</Module>