function PrintArtist(id)
{
	this.m_id			= id;
	this.m_worksList	= new PrintWorksList();

	this.M_addWork	= function(id,body,img)
	{
		this.m_worksList.M_add(id,body,img);
		return this;
	}

}

function PrintWork(id,body,img)
{
	this.m_id	= id;
	this.m_body	= body;
	this.m_img	= img;
}

function PrintWorksList()
{
	this.m_bodyDiv		= getObj('printBody');
	this.m_imgDivLink	= getObj('mainImageDivLink');
	this.m_img			= getObj('mainImage');
	this.m_list			= new Array();
	this.m_selectedWork	= null;

	this.M_add  = function(id,body,img)
	{
		this.m_list[id] = new PrintWork(id,body,img);
	} 

	this.M_show = function(id)
	{
		this.m_selectedWork = this.m_list[id];
		if (this.m_selectedWork)
		{
			// set text in body
			$("#printBody").html(this.m_selectedWork.m_body);
			// set image
			$("#mainImage").attr("src", this.m_selectedWork.m_img);
			// set enlarge link
			$("#linkEnlarge").unbind( "click" ); // remove previous click
			$("#linkEnlarge").click(  RQDelegate(this, this.M_enlargePhotoStart) ).css("cursor","pointer");
		}	
	}
	
	this.M_enlargePhotoStart = function()
	{
		if (this.m_selectedWork)
		{
			// Hide thumbs
			$("div.columnThumbs").hide();
			// hide the enlarge link
			$("#linkEnlarge").hide( );
			$("#linkReduce").show( );
			$("#linkReduce").unbind( "click" ); // remove previous click
			$("#linkReduce").click(  RQDelegate(this, this.M_enlargePhotoStop) ).css("cursor","pointer");
			// Change style of column
			$("#mainImage").hide().attr("src", this.m_selectedWork.m_img).width(350).css("cursor", "pointer").click( RQDelegate(this, this.M_enlargePhotoStop) ).show();
		}
	}

	this.M_enlargePhotoStop = function()
	{
		if (this.m_selectedWork)
		{
			$("#mainImage").hide().unbind("click").css("cursor", "default").attr("src", this.m_selectedWork.m_img).width(276).show();
			$("#linkEnlarge").show();
			$("#linkReduce").hide( );
			$("div.columnThumbs").show();
		}
	}
	
}


function sChangePrintWork(artistId, workId)
{
	var artist = myPrintArtistsArray[artistId];
	if (artist)
		artist.m_worksList.M_show(workId);
}

// ============================================================
myPrintArtistsArray = new Array();
