//
// This log keeps track of SDR activations.   Add a new one to the top
// by copying and pasting the previous entry.
//
// Set the first field of the Activation to one of the following:
//
// 'T' = Telco issue
// 'W' = Weather issue
// 'O' = Other issue
//
var Text = '';
var Activations = new Array;
//
// Add new entries below here but above any existing entries:
//
<div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
      google.load("gdata", "1.x", { packages : ["blogger"] });
    </script>
    <script type="text/javascript">
      function _run() {
        /*
        * Retrieve a list of blog posts
        */
        
        // Obtain a reference to the 'content' div
        var content = document.getElementById('content');
        
        // Create the blogger service object
        var bloggerService =
            new google.gdata.blogger.BloggerService('com.appspot.interactivesampler');
        
        // The ID included in this URI can be retrieved from the
        // <link rel="service.post"> element in the Blog's HTML source
        var feedUri = 'http://blog.simsware.com/feeds/posts/default';
        
        // A callback method invoked getBlogPostFeed() returns data
        var handleBlogPostFeed = function(postsFeedRoot) {
          var posts = postsFeedRoot.feed.getEntries();
          
          // This variable will buffer HTML output until function completes
          var html = '';
          
        
          
          // Display blog posts
          var blogEntries = 8;
          var showNum = posts.length;
          if (showNum > blogEntries) showNum = blogEntries;
          for (var i = 0; i < showNum; i++) {
            post = posts[i];


            var postTitle = post.getTitle().getText();
              var postDate = post.getPublished().getValue().getDate();
            var postURL = post.getHtmlLink().getHref();
            var showDate = (postDate.getMonth() + 1) + '/' + postDate.getDate() + '/'+ postDate.getFullYear();

           html += '<div class="CommonSidebarContentItem">';
           html += '<b>' + showDate + '</b><br><a href="' + postURL + '" target="_new" style="text-decoration:none;color:black;">';
           html += postTitle + '</a><\/div>';

          }
          
          // Write out buffered HTML, and clear the "Loading..." message
          content.innerHTML = html;
        };
        
        var handleError = function(error) {
          content.innerHTML = '<pre>' + error + '</pre>';
        };
        
        bloggerService.getBlogPostFeed(feedUri, handleBlogPostFeed, handleError);
        
      }
      google.setOnLoadCallback(_run);
    </script>
    <div id="content" style="width:100%; class="CommonSidebarContentItem">Loading...</div>
</div>


Activations.push(new Activation('T','April 2011'));
Activations.push(new Activation('T','March 2011'));
Activations.push(new Activation('T','March 2011'));
Activations.push(new Activation('T','June 2010'));
Activations.push(new Activation('T','June 2010'));
Activations.push(new Activation('W','May 2010'));
Activations.push(new Activation('T','July 2009'));
Activations.push(new Activation('W','July 2009'));
Activations.push(new Activation('T','June 2009'));
Activations.push(new Activation('T','February 2009'));
Activations.push(new Activation('T','November 2008'));
Activations.push(new Activation('O','September 2008'));
Activations.push(new Activation('W','September 2008'));
Activations.push(new Activation('T','July 2008'));
Activations.push(new Activation('T','July 2008'));
Activations.push(new Activation('T','June 2008'));
Activations.push(new Activation('T','April 2008'));
Activations.push(new Activation('T','November 2007'));
Activations.push(new Activation('T','October 2007'));
Activations.push(new Activation('W','October 2007'));
Activations.push(new Activation('T','August 2007'));
Activations.push(new Activation('T','August 2007'));
Activations.push(new Activation('O','April 2007'));
Activations.push(new Activation('T','March 2007'));
Activations.push(new Activation('T','April 2006'));
Activations.push(new Activation('T','February 2006'));
Activations.push(new Activation('W','September 2005'));
Activations.push(new Activation('W','September 2005'));
Activations.push(new Activation('W','August 2005'));
Activations.push(new Activation('T','October 2004'));
Activations.push(new Activation('W','September 2004'));

var ActivateWeather = 0;
var ActivateTelco = 0;
var ActivateOther = 0;
var percWeather = 0;
var percTelco = 0;
var percOther = 0;
for (var i=0; i < Activations.length; i++)
{
        var thisActivation = Activations[i];
        if (thisActivation.Type == 'W')
        {
           ActivateWeather++;
        }
        else if (thisActivation.Type == 'T')
        {
           ActivateTelco++;
        }
        else
        {
           ActivateOther++;
        }
}
//
var ActivateTotal = ActivateWeather + ActivateTelco + ActivateOther;
percWeather = Math.round(ActivateWeather / ActivateTotal * 100);
percTelco = Math.round(ActivateTelco / ActivateTotal * 100);
percOther = Math.round(ActivateOther / ActivateTotal * 100);
//

document.write('<br><center><font size=+1 face=arial><b>SIMS Disaster Recovery Activation Summary</b></font><br><font size=2>(February 2004 to Present)</font></center><p>');

document.write('<table align="center" border="1" bgcolor="#D2D2D2" rules=none cellpadding="8">');
document.write('<tr><td align=right>Weather Related (Hurricanes, Tornado, Winter Storms, etc):</td><td align=right><b>'+ActivateWeather+'</b></td><td align=right>('+percWeather+'%)</td></tr>');
document.write('<tr><td align=right>Telco Related (Line Cuts, Routing, 800# Issues):</td><td align=right><b>'+ActivateTelco+'</b></td><td align=right>('+percTelco+'%)</td></tr>');
document.write('<tr><td align=right>Other Issues (Power, Fire, Other):</td><td align=right><b>'+ActivateOther+'</b></td><td align=right>('+percOther+'%)</td></tr>');
document.write('<tr><td align=right><b>Total Activations:</b></td><td align=right style="border-top: 1px gray solid;"><b>'+ActivateTotal+'</b></td></tr>');
document.write('</table>');


function Activation(activationType, activationDate)
{
        this['Type'] = activationType;
        this['Date'] = activationDate;
        return this;
}

