﻿function CMSImage(IDnode, fileName, width, height)
{
	this.urlTrigger = '/Images/';
	this.pageExtension = '.aspx';
	this.IDnode = IDnode;
	this.fileName = fileName;
	this.width = width;
	this.height = height;
};

CMSImage.prototype.getBySize = function(width, height, canCrop, canEnlarge)
{
	//
	if(!width) width = this.width;
	if(!height) height = this.height;
	if(canCrop == null) canCrop = false;
	if(canCrop == null) canCrop = false;
	//
	return env.applicationPath + this.urlTrigger + width.toString() + 'x' + height.toString() + '/' +
		this.IDnode.toString() + '/' + this.fileName + this.pageExtension +
		'?canCrop=' + ((canCrop)?'true':'false') + '&canEnlarge=' + ((canEnlarge)?'true':'false');
};
