///////////////////////////////////////////////////////////////////////////////
//
//  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();
    this.resourceArray[this.resourceArray.length]= "assets/logo_name.png";
    this.resourceArray[this.resourceArray.length]= "assets/silverlightbackgroundlight.jpg";

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

PageGenerator.prototype.getPageString = function(pageNumber, isThumbnail)
{
  var retStr = "";
  if (pageNumber < 0)
  {
    return retStr;
  }
  retStr =  "<Canvas Background='#FFFFFFFF\' Height='570' Width='420'>";
   retStr += "  <Image Canvas.Left='10' Width='410' Height='570' Source='assets/page"+getTwoDigitInt(pageNumber)+".jpg'>";
		//retStr += "<Image.RenderTransform><TransformGroup><ScaleTransform ScaleX='1' ScaleY='1'/><SkewTransform AngleX='0' AngleY='0'/><RotateTransform Angle='0'/><TranslateTransform X='0' Y='0'/></TransformGroup></Image.RenderTransform>";
 
retStr += "  </Image>";
  
  if ((pageNumber % 2) == 1) {
      retStr += "  <Path Data='M 420,570 h -420 v -570 h 420' Stroke='White' StrokeThickness='15'/>";
  } else {
      retStr += "  <Path Data='M 0,0 h 420 v 570 h -420' Stroke='White' StrokeThickness='15'/>";
  }

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