// paintings.js

function Paintings(thumbNail, fullSize, name, size, price, sold)
{
 this.thumbNail = thumbNail;
 this.fullSize = fullSize;
 this.name = name;
 this.size = size;
 this.price = price;
 this.sold = sold;
 
 return this;
}

var currentImage = 0;


function outputPaintings()
{
	var paintingTable = "";
//	document.write("test");
	
	for (var i = 0; i<5; i++)
	{
		paintingTable += "<tr>";
		for (var j=0; j<3; j++)
		{
			paintingTable += "<td width=\"66\" onmouseover class=\"effect\" onclick=\"return switchImage("+((i*3)+j)+");\"><img src=\""+aPaintingWork[((i*3)+j)].thumbNail+"\" width=\"63\" height=\"60\" border=\"2\"></td>";
		}
		
		paintingTable += "</tr>";
		
	}
	
	return paintingTable;
	
}



function switchImage(id) 
{
	if (id > 14)
		id = 14;
		
	if (id < 0)
		id = 0;	

	document.getElementById("largeImage").src = aPaintingWork[id].fullSize;
	currentImage = id;
	
	document.getElementById("imageName").innerText = aPaintingWork[id].name;
	document.getElementById("imageSize").innerText = aPaintingWork[id].size;
	document.getElementById("imagePrice").innerText = aPaintingWork[id].price;
	
}


