function Cart(cartRows) {
	this.cartRows = cartRows;
}
Cart.prototype.cartRows = function(cartRows) {
	this.cartRows = cartRows;
}

Cart.prototype.getCartRows = function(){
	return this.cartRows;
}

Cart.prototype.getNumberOfItems = function(){
	var count = 0;
	
	if(this.cartRows == null || typeof(this.cartRows) == 'undefined' || this.cartRows.length == 0)
	{
		count = 0;
	}
	else
	{
		var count = 0;
		
		for(var i = 0; i < this.cartRows.length; i++)
		{
			var cartRow = this.cartRows[i];
			count += parseInt(cartRow.getQuantity());
		}
	}
	
	return count;
}

function CartRow(rowid, shopitemid, size, quantity, rowtotal, fabric) {
	this.rowid = rowid;
	this.shopitemid = shopitemid;
	this.size = size;
	this.quantity = quantity;
	this.rowtotal = rowtotal;
	this.fabric = fabric;
}

CartRow.prototype.rowid = function(rowid) {
	this.rowid = rowid;
}

CartRow.prototype.getRowid = function(){
	return this.rowid;
}

CartRow.prototype.shopitemid = function(shopitemid) {
	this.shopitemid = shopitemid;
}

CartRow.prototype.getShopitemid = function(){
	return this.shopitemid;
}

CartRow.prototype.size = function(size) {
	this.size = size;
}

CartRow.prototype.getSize = function(){
	return this.size;
}

CartRow.prototype.quantity = function(quantity) {
	this.quantity = quantity;
}

CartRow.prototype.getQuantity = function(){
	return this.quantity;
}

CartRow.prototype.rowtotal = function(rowtotal) {
	this.rowtotal = rowtotal;
}

CartRow.prototype.getRowtotal = function(){
	return this.rowtotal;
}

CartRow.prototype.fabric = function(fabric) {
	this.fabric = fabric;
}

CartRow.prototype.getFabric = function(){
	return this.fabric;
}


function Category(name, ids) {
	this.name = name;
	this.ids = ids;
}
Category.prototype.name = function(name) {
	this.name = name;
}

Category.prototype.getName = function(){
	return this.name;
}
Category.prototype.ids = function(ids) {
	this.ids = ids;
}

Category.prototype.getIds = function(){
	return this.ids;
}

	
function Fabrics(name, ids) {
	this.name = name;
	this.ids = ids;
}
Fabrics.prototype.name = function(name) {
	this.name = name;
}

Fabrics.prototype.getName = function(){
	return this.name;
}
Fabrics.prototype.ids = function(ids) {
	this.ids = ids;
}

Fabrics.prototype.getIds = function(){
	return this.ids;
}


function ShopItem(id, name, shortdescription, description, price, sizes, fabricdescription, careinstructions, productiondescription, fabricset, numberofimages) {
	this.id = id;
	this.name = name;
	this.shortdescription = shortdescription;
	this.description = description;
	this.price = price;
	this.sizes = sizes;
	this.fabricdescription = fabricdescription;
	this.careinstructions = careinstructions;
	this.productiondescription = productiondescription;
	this.fabricset = fabricset;
	this.numberofimages = numberofimages;
}
	
ShopItem.prototype.id = function(id) {
	this.id = id;
}

ShopItem.prototype.getId = function(){
	return this.id;
}

ShopItem.prototype.name = function(name) {
	this.name = name;
}

ShopItem.prototype.getName = function(){
	return this.name;
}

ShopItem.prototype.Shortdescription = function(shortdescription) {
	this.shortdescription = shortdescription;
}

ShopItem.prototype.getShortdescription = function(){
	return this.shortdescription;
}

ShopItem.prototype.description = function(description) {
	this.description = description;
}

ShopItem.prototype.getDescription = function(){
	return this.description;
}

ShopItem.prototype.price = function(price) {
	this.price = price;
}

ShopItem.prototype.getPrice = function(){
	return this.price;
}

ShopItem.prototype.sizes = function(sizes) {
	this.sizes = sizes;
}

ShopItem.prototype.getSizes = function(){
	return this.sizes;
}

ShopItem.prototype.fabricdescription = function(fabricdescription) {
	this.fabricdescription = fabricdescription;
}

ShopItem.prototype.getFabricdescription = function(){
	return this.fabricdescription;
}

ShopItem.prototype.careinstructions = function(careinstructions) {
	this.careinstructions = careinstructions;
}

ShopItem.prototype.getCareinstructions = function(){
	return this.careinstructions;
}

ShopItem.prototype.productiondescription = function(productiondescription) {
	this.productiondescription = productiondescription;
}

ShopItem.prototype.getProductiondescription = function(){
	return this.productiondescription;
}

ShopItem.prototype.fabricset = function(fabricset) {
	this.fabricset = fabricset;
}

ShopItem.prototype.getFabricset = function(){
	return this.fabricset;
}

ShopItem.prototype.numberofimages = function(numberofimages) {
	this.numberofimages = numberofimages;
}

ShopItem.prototype.getNumberofimages = function(){
	return this.numberofimages;
}

ShopItem.prototype.toString = function(){
	return 'ShopItem(ID: ' + this.id + ', NAME: ' + this.name + ', SHORT DESCRIPTION: ' + this.shortdescription + ', DESCRIPTION: ' + this.description + ', PRICE: ' + this.price + ', AVAILABLE SIZES: ' + this.sizes.length + 
		', FABRICDESCRIPTION: ' + this.fabricdescription + ', CARE INSTRUCTIONS: ' + this.careinstructions + ', PRODUCTION DESCRIPTION: ' + this.productiondescription + ', FABRICS SET: '  + this.fabricset + ', NUMBER OF IMAGES: ' + this.numberofimages + ')';
}

/*****************/
/*** NEWS ITEM ***/
/*****************/

function NewsItem(id, newsDate, title, photo, content) {
	this.id = id;
	this.newsDate = newsDate;
	this.title = title;
	this.photo = photo;
	this.content = content;
}
	
NewsItem.prototype.id = function(id) {
	this.id = id;
}

NewsItem.prototype.getId = function(){
	return this.id;
}

NewsItem.prototype.newsDate = function(newsDate) {
	this.newsDate = newsDate;
}

NewsItem.prototype.getNewsDate = function(){
	return this.newsDate;
}

NewsItem.prototype.title = function(title) {
	this.title = title;
}

NewsItem.prototype.getTitle = function(){
	return this.title;
}

NewsItem.prototype.photo = function(photo) {
	this.photo = photo;
}

NewsItem.prototype.getPhoto = function(){
	return this.photo;
}

NewsItem.prototype.content = function(content) {
	this.content = content;
}

NewsItem.prototype.getContent = function(){
	return this.content;
}


function StateObject(page, id){
	this.page = page;
	this.id = id;
}

StateObject.prototype.getPage = function(){
	return this.page;	
}

StateObject.prototype.setPage = function(page){
	this.page = page;
}

StateObject.prototype.getId = function(){
	return this.id;
}

StateObject.prototype.setId = function(id){
	this.id = id;
}

function Customer(currency, name, streetAddress, zipCode, city, country, phone){
	this.currency = currency;
	this.name = name
	this.streetAddress = streetAddress;
	this.zipCode = zipCode
	this.city = city;
	this.country = country
	this.phone = phone;
}

Customer.prototype.getCurrency = function(){
	return this.currency;	
}

Customer.prototype.setCurrency = function(currency){
	this.currency = currency;
}

Customer.prototype.getName = function(){
	return this.name;	
}

Customer.prototype.setName = function(name){
	this.name = name;
}

Customer.prototype.getStreetAddress = function(){
	return this.streetAddress;	
}

Customer.prototype.setStreetAddress = function(streetAddress){
	this.streetAddress = streetAddress;
}

Customer.prototype.getZipCode = function(){
	return this.zipCode;	
}

Customer.prototype.setZipCode = function(zipCode){
	this.zipCode = zipCode;
}

Customer.prototype.getCity = function(){
	return this.city;	
}

Customer.prototype.setCity = function(city){
	this.city = city;
}

Customer.prototype.getCountry = function(){
	return this.country;	
}

Customer.prototype.setCountry = function(country){
	this.country = country;
}

Customer.prototype.getPhone = function(){
	return this.phone;	
}

Customer.prototype.setPhone = function(phone){
	this.phone = phone;
}

/*******************/
/*** PHOTO ALBUM ***/
/*******************/

function PhotoAlbum(id, photographer, email, title, web, albumCover, imageType, albumSize, folderName)
{
	this.id = id;
	this.photographer = photographer;
	this.email = email;
	this.title = title;
	this.web = web;
	this.albumCover = albumCover;
	this.imageType = imageType;
	this.albumSize = albumSize;
	this.folderName = folderName;
}

PhotoAlbum.prototype.id = function(id) {
	this.id = id;
}

PhotoAlbum.prototype.getId = function(){
	return this.id;
}

PhotoAlbum.prototype.photographer = function(photographer) {
	this.photographer = photographer;
}

PhotoAlbum.prototype.getPhotographer = function(){
	return this.photographer;
}

PhotoAlbum.prototype.email = function(email) {
	this.email = email;
}

PhotoAlbum.prototype.getEmail = function(){
	return this.email;
}

PhotoAlbum.prototype.title = function(title) {
	this.title = title;
}

PhotoAlbum.prototype.getTitle = function(){
	return this.title;
}

PhotoAlbum.prototype.web = function(web) {
	this.web = web;
}

PhotoAlbum.prototype.getWeb = function(){
	return this.web;
}

PhotoAlbum.prototype.albumCover = function(albumCover) {
	this.albumCover = albumCover;
}

PhotoAlbum.prototype.getAlbumCover = function(){
	return this.albumCover;
}

PhotoAlbum.prototype.imageType = function(imageType) {
	this.imageType = imageType;
}

PhotoAlbum.prototype.getImageType = function(){
	return this.imageType;
}

PhotoAlbum.prototype.albumSize = function(albumSize) {
	this.albumSize = albumSize;
}

PhotoAlbum.prototype.getAlbumSize = function(){
	return this.albumSize;
}

PhotoAlbum.prototype.folderName = function(folderName) {
	this.folderName = folderName;
}

PhotoAlbum.prototype.getFolderName = function(){
	return this.folderName;
}

PhotoAlbum.prototype.toString = function(){
	return 'Id: ' + this.id + ', Photographer: ' + this.photographer + ', Email: ' + this.email + ', Title: ' + this.title + ', Web: ' + this.web + ', Album cover: ' + this.albumCover + ', Image type: ' + this.imageType + ', Album size: ' + this.albumSize + ', Folder: ' + this.folderName + '.';
}