///////////////////////////////////////////////////////////////////////////////
//
//  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(numPages) {
    this.numPages = numPages;
    this.resourceArray = new Array();

    for (var i=5; i<=this.numPages; i++){
        this.resourceArray[this.resourceArray.length] = "assets/page" + getTwoDigitInt(i) + ".jpg";
    }
}

PageGenerator.prototype.getPageString = function(pageNumber, isThumbnail)
{
  var retStr = "";
  if (pageNumber < 0)
  {
    return retStr;
  }
  retStr =  "<Canvas>";
  retStr += "  <Image Height='507' Width='500' Source='assets/page"+getTwoDigitInt(pageNumber)+".jpg'/>";
  
  if ((pageNumber % 2) == 1) {
      retStr += "  <Path Data='M 500,507 h -500 v -507 h 500' Stroke='White' StrokeThickness='15'/>";
  } else {
      retStr += "  <Path Data='M 0,0 h 500 v 507 h -500' Stroke='White' StrokeThickness='15'/>";
  }

  retStr += "</Canvas>";
  return retStr;
}
