function ImagePreview(previewname,itemsselectable)
{
	this.items=itemsselectable;
	this.name=previewname;
	this.selectedIndex=(Math.floor(Math.random()*this.items.getLength()));
	this.listeners=new Array();
}
function imagepreview_addActionListener(listener){
	this.listeners[this.listeners.length]="action";
	this.listeners[this.listeners.length]=listener;
}
function imagepreview_fireActionPerformed(){
	for(var i=0;i<this.listeners.length;i+=2)
		if(this.listeners[i]=="action")
			eval(""+this.listeners[i+1]+".actionPerformed(\""+this.name+"\")");
}
function imagepreview_getHtml(){
	var pHtml="<table class=gBorder cellspacing=0 cellpadding=4><tr><td colspan=2 "+
	"style='background-color: "+LIGHT_COLOR+"; color:white; padding:2px;'>"+
	"&nbsp; <b>Featured Art!</b></td></tr>"+
	"<tr><td><img id=preview border=1 width=100 height=100 style='cursor:pointer;' "+
	"src='"+tPath+this.items.getElementAt(this.selectedIndex).thumbnail+"' "+
	"class=gBorder title='Click to view this item' "+
	"onclick='top."+this.name+".fireActionPerformed()'></td><td>"+
	"<textarea id='previewText' style='border:none; background-color:transparent; "+
	"width:220px; height:80px;' class='pViewer' readonly='readonly'>";
	var item=this.items.getElementAt(this.selectedIndex);
	pHtml+="\n"+item.label+"\nEdition #: "+item.edition+
	"\n$"+ShoppingCart.fix(item.price,"soft")+
	"</textarea><br><span style='font: normal 7pt Arial,sans-serif; color:"+
	DARK_COLOR+";'>To view all - go to my Sculptures Page!</span></td>"+
	"</tr></table>";
	return pHtml;
}
function imagepreview_showRandom(){
	if(!ge("preview"))return;
	this.selectedIndex=(Math.floor(Math.random()*this.items.getLength()));
	var item = this.items.getElementAt(this.selectedIndex);
	var source=tPath+item.thumbnail;
	ge("preview").src=source;
	ge("previewText").value="\n"+item.label+"\nEdition #: "+item.edition+
	"\n$"+ShoppingCart.fix(item.price,"soft");
}
ImagePreview.prototype.addActionListener=imagepreview_addActionListener;
ImagePreview.prototype.fireActionPerformed=imagepreview_fireActionPerformed;
ImagePreview.prototype.getHtml=imagepreview_getHtml;
ImagePreview.prototype.showRandom=imagepreview_showRandom;