var GBP_to_USD = 1.56;

function Dress(name, material, colors, startprice) {
	this.name = name;
	this.getID = function() {
		return this.name.toLowerCase();
	}
	this.material = material;
	this.colors = colors;
	this.startprice = startprice;
	this.getPrice = function(age) {		
		return (age-1) * 5 + startprice;
	}

	this.getUSprice = function(age) {
		return Math.ceil((this.getPrice(age) * GBP_to_USD)/5)*5;
	}
}

var noDress = 0;
var pernilla = 1;
var stina = 2;
var alinda = 3;
var anna = 4;
var klara = 5;
var catrin = 6;
var lamia = 7;
var mia = 8;
var lisa = 9;
var helena = 10;
var lily = 11;
var esther = 12;
var claudine = 13;
var beatrice = 14;

var dresses = new Array(
	new Dress("-", "-", "-", 0),
	new Dress("Pernilla", "Silk dupion with organza border", "Ivory&Special", 85),
	new Dress("Stina", "Silk taffeta", "Ivory&Special", 95),
	new Dress("Alinda", "Duchesse satin", "Ivory&Special", 95),
	new Dress("Anna", "Silk dupion", "Ivory&Special", 85),
	new Dress("Klara", "Silk organza", "Ivory (Ivory or a coloured ribbon)&Special", 90),
	new Dress("Catrin", "Silk organza with satin ribbons", "Ivory (Ivory or a coloured ribbon)&Special", 90),
	new Dress("Lamia", "Silk organza with satin border and beading", "Ivory (Ivory or a coloured ribbon and beads)&Special", 90),
	new Dress("Mia", "Silk Georgette", "Ivory&Special", 120),
	new Dress("Lisa", "Silk chiffon", "Ivory (Plain or with coloured edges)&Special", 120),
	new Dress("Helena", "Embroided Silk Georgette", "Ivory", 120, 190),
	new Dress("Lily", "Corded Lace on Satin", "Cream Lace on Cream Lining&Cream Lace on Pastel Lining", 120),
	new Dress("Esther", "Silk Organza with Embroided Dots", "Ivory&Special", 120),
	new Dress("Claudine", "Printed and Embroided Silk Organza", "Ivory with blue flowers", 120),
	new Dress("Beatrice", "Silk Organza with Embroided Dots", "Ivory&Special", 120)
);

// ---------------------------------------------------------------------
function writeColors(id) {
	var dressColors = dresses[id].colors.split("&");
	for (var i=0;i < dressColors.length;i++) {
		if (i > 0) document.write("<br>\n");
		document.write(dressColors[i]);
	}
}
