<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Indian Premier League" scrolling="true" width="350" height="400"
             author="Jinu George"
             author_email="jgeorge.feedback+ipl@googlemail.com"
             author_link="http://raakshaseeyam.blogspot.com" 
             description="IPL 2009 Live score and points table"
             screenshot="http://jinuvgeorge.googlepages.com/ipl.png"
             thumbnail="http://jinuvgeorge.googlepages.com/ipl.png">
<Require feature="analytics" />
  <Require feature="tabs" />
</ModulePrefs>
<Content type="html"><![CDATA[
<style type="text/css">
  
body {
font-family:verdana;
font-size:14px;
}

thead {
font-size:14px;
border: 1px solid blue;
padding:5px;
color:white;
background-color:blue;
}
td {
font-size:12px;
border: 1px solid blue;
color: blue;
padding: 5px;
}
</style> 
<script>
  _IG_Analytics("UA-2560293-5", "/IPL");
</script>
  <script>
      var tabs = new _IG_Tabs(__MODULE_ID__, "");

    function init() {
    
     tabs.addTab("Live matches", "live", getLive);

    tabs.addTab("Points Table", "points", getPoints);
    //tabs.addTab("News", "news", getNews);

}
  
function getPoints () {
_IG_FetchContent('http://content.cricinfo.com/ipl2009/engine/series/374163.html?view=pointstable', function (responseText) 
{
var table = responseText.split('Table3"');
var t = table[1].split('<table');
var f = t[0].split('</table>"');
var html = '<table style=border-collapse:collapse'+f[0]+'</table>';

_gel('points').innerHTML = html;
});

}

function getLive () {
var url = "http://feeds.feedburner.com/CricbuzzFeed";
             
            _IG_FetchXmlContent(url, function (response) {
         if (response == null || typeof(response) != "object" || response.firstChild == null) {
           _gel("live").innerHTML = "<i>Invalid data.</i>";
           return;
        }	

     var objNodeList = response.getElementsByTagName("item"); 

var items =[];     
for (var i = 0; i < 10; ++i) {
       var xmlItem = objNodeList.item(i);
       var item = {};
       var added = false;
       for (var j = 0; j < xmlItem.childNodes.length; ++j) {
         var child = xmlItem.childNodes.item(j);
         if (child.childNodes.length > 0) { // (4) pull out the text for the children of the main tag
           var name = child.nodeName;
           var value = child.childNodes[0].nodeValue;
           item[name] = value;
           
              }
}

items.push(item);

}

var html = "";


    //html+=  items[i]["content"];
 for(i=0;i<3;++i) {
    var url= items[i]["link"];
    var title=items[i]["title"];
  var story = items[i]["description"]; 

  html += '<table><tr><td style="text-align:center; background-color:blue"><a href="'+url+'" target="_blank" style="color:white">'+title+'</a></td></tr><tr><td>'+story+'</td></tr></table>';

}
    //html += "</div>"
    //alert(html);
    _gel('live').innerHTML = html; 
        
       		 
	 });	  
}
    
    
_IG_RegisterOnloadHandler(init);
</script>  
  
<div id="content" ></div>
  <div id="ad">
    <script type="text/javascript"><!--
google_ad_client = "pub-7199283646323733";
/* 468x15, created 4/18/09 */
google_ad_slot = "1309253301";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
  </div>
  <div id ="live"></div>
  <div id="points"></div>
</div>  




]]></Content>
</Module>













