function Book(target, title, shortTitle, desc, bookId, imageFileExtension, isOnline, shortDesc,
                spreadsWithAudio, spreadsWithAudio2,spreadNavigatorText, rightToLeft, pageObjects, width, height, rectoLo, versoLo, backCoverImage,
                coverWidth, coverHeight, preRotationAngleX, instructions) {
	this.target = target;
	this.title = title;
	this.shortTitle = shortTitle;
	this.desc = desc;
	this.bookId = bookId;
	this.imageFileExtension = imageFileExtension;
	this.isOnline = isOnline;
	this.shortDesc = shortDesc;
	this.spreadsWithAudio = spreadsWithAudio;
	this.spreadsWithAudio2 = spreadsWithAudio2;
	this.spreadNavigatorText = spreadNavigatorText;
	this.rightToLeft = rightToLeft;
	this.pageObjects = pageObjects;
	this.width = width;
	this.height = height;
	this.rectoLo = rectoLo;
	this.versoLo = versoLo;
	this.backCoverImage = backCoverImage;
	this.coverWidth = coverWidth;
	this.coverHeight = coverHeight;
	this.preRotationAngleX = returnRotation(preRotationAngleX);
    this.instructions = instructions;
	
	this.xaml = null;
	this.clickHandler = null;
	
	this.bookText = new Array();
	this.bookText2 = new Array();
	
	this.mouseDownX = -1;
    this.mouseDownY = -1;
	//this.xamlUrl = this.target.findName("itemXaml" + this.index.toString()).text;
	target.findName("MoveCanvas").addEventListener("mouseEnter", delegate(this, this.handleMouseEnter));
	target.findName("MoveCanvas").addEventListener("mouseLeave", delegate(this, this.handleMouseLeave));
	target.findName("MoveCanvas").addEventListener("mouseMove", delegate(this, this.handleMouseMove));
	target.findName("MoveCanvas").addEventListener("mouseLeftButtonUp", delegate(this, this.handleClick));
    target.findName("MoveCanvas").addEventListener("mouseLeftButtonDown", delegate(this, this.handleMouseDown));
}


Book.prototype.PageText = function(title, text)
    {
        this.title = title;
        this.text = text;
    }
    
Book.prototype.PageText2 = function(title, text)
    {
        this.title = title;
        this.text = text;
    }

Book.prototype.handleMouseEnter = function(sender, eventArgs) {

}

Book.prototype.handleMouseLeave = function(sender, eventArgs) {

}

Book.prototype.handleMouseMove = function(sender, eventArgs) {
    if (this.mouseDownX != -1 && this.mouseDownY != -1) {
        var sceneTranslate = sender.findName("sceneTranslate");
        sceneTranslate.X = eventArgs.getPosition(null).X - this.mouseDownX;
        sceneTranslate.Y = eventArgs.getPosition(null).Y - this.mouseDownY;
    }
}

Book.prototype.handleClick = function(sender, eventArgs) {	
	if (this.clickHandler != null) {
	    this.clickHandler(this);
	}	
}

Book.prototype.handleMouseDown = function(sender, eventArgs) {
    var sceneTranslate = sender.findName("sceneTranslate");
    this.mouseDownX = eventArgs.getPosition(null).X - sceneTranslate.X;
    this.mouseDownY = eventArgs.getPosition(null).Y - sceneTranslate.Y;
}

function getNewPageObjects(hasBackCover, pages)
{
    if(hasBackCover == true)
    {
        return ((pages * 2) + 2);
    }
    else
    {
        return ((pages * 2) - 2);
    }
}

