///////////////////////////////////////////////////////////////////////////////
//
//  pageGenerator.js
//
// 
// © 2007 Microsoft Corporation. All Rights Reserved.
//
// This file is licensed as part of the Silverlight 1.0 SDK, for details look here: http://go.microsoft.com/fwlink/?LinkID=89144&clcid=0x409
//
///////////////////////////////////////////////////////////////////////////////

// Controls the content for each page and the set of resources required by them
PageGenerator = function() {  
    this.resourceArray = new Array();    
    for (var i=0; i < mediaInfoArray.length; i++)
    {
        this.resourceArray[this.resourceArray.length] = mediaInfoArray[i].placeholderImage;        
    }    
}

PageGenerator.prototype.getPageString = function(pageNumber, isThumbnail)
{
  var retStr = "";
  if (pageNumber < 0)  
    return retStr;  
  retStr =  "<Canvas>";      
  retStr += "  <Image Canvas.Left='150' Height='570' Width='570' Opacity='0.9' Source='" + this.resourceArray[pageNumber] + "'/>";    
  //
  var title = "";
  if (pageNumber < mediaInfoArray.length)        
    title = mediaInfoArray[pageNumber].title;        
  //    
  retStr += "  <TextBlock Width='400' TextWrapping='Wrap' Canvas.Left='240' Canvas.Top='40' Text='" + title + "' FontSize='35' Foreground='Yellow' Opacity='1'/>";      
  retStr += "  <Path x:Name='ThumbBorder_" + pageNumber + "' Data='M 840,570 h -840 v -570 h 840 v 570' Stroke='White' StrokeThickness='15'/>";
  //retStr += "  <Path Data='M 0,0 h 420 v 570 h -420' Stroke='White' StrokeThickness='15'/>";      
  retStr += "</Canvas>";
  return retStr;
}