SmallCoverMaxWidth = 140;

function ClientJpg (id, file, height, width) {
	this.id = id;
	this.file = file;
	this.width = width;
	this.height = height;
}
ClientJpg.prototype.getImgPath = function () {
	var imagePath = this.file;
	if (imagePath.toLowerCase ().match(/^url/) == null) {
		var dirPath =  "images/Client_Work/";
		if (clientThumbnailMode)
			dirPath += "thumbs/";
			imagePath = "\"" + dirPath + this.file + "\"";
	}
	return imagePath;
}
ClientJpg.prototype.getImgHtml = function () {
	var imagePath = this.getImgPath ();
	var img = "<img src=" + imagePath + " "
		+ "width=" + this.width + "px " 
		+ "height=" + this.height + "px>";
	return img;
}
ClientJpg.prototype.getImgWidthScaled = function (maxWidth) {
	var info = new Object ();
	info.width = this.width;
	info.height = this.height;
	if (info.width > maxWidth) {
		info.height = Math.floor (info.height * (maxWidth/info.width));
		info.width = maxWidth;
	}
	var imagePath = this.getImgPath ();
	info.html = "<img src=" + imagePath + " "  
		+ "width=" + info.width + "px " 
		+ "height=" + info.height + "px>";
	return info;
}
ClientJpg.prototype.getImgHeightScaled = function (maxHeight) {
	var info = new Object ();
	info.width = this.width;
	info.height = this.height;
	if (info.height > maxHeight) {
		info.width = Math.floor (info.width * (maxHeight/info.height));
		info.height = maxHeight;
	}
	var imagePath = this.getImgPath ();
	info.html = "<img src=" + imagePath + " "  
		+ "width=" + info.width + "px " 
		+ "height=" + info.height + "px>";
	return info;
}

function ClientJpgFromSelector (selector) {
	this.id = selector.attr("jpg_id");
	this.file = selector.attr("image_file");
	this.width = parseInt (selector.css ("width"));
	this.height = parseInt (selector.css ("height"));
}
ClientJpgFromSelector.prototype.getImgHtml = ClientJpg.prototype.getImgHtml;
ClientJpgFromSelector.prototype.getImgPath = ClientJpg.prototype.getImgPath;
ClientJpgFromSelector.prototype.getImgWidthScaled = ClientJpg.prototype.getImgWidthScaled;
ClientJpgFromSelector.prototype.getImgHeightScaled = ClientJpg.prototype.getImgHeightScaled;

function Client (clientRef, webTag, active, designCredit) {
	this.clientRef = clientRef;
	this.webTag = webTag;
	this.active = active;
	this.designCredit = designCredit;

}

