// JavaScript Document
function theAlbum(targetImage){
	this.targetImage=document.getElementById(targetImage);
	this.content=new Array();
	this.SelectedIcon="";
}

theAlbum.prototype.addButton=function(idName,imgTarget,imgTitle,imgDesc){
	var btnFrame=idName;
	btnFrame=btnFrame.replace(/ico/g,"thumb");
	
	var bImage=document.getElementById(btnFrame);
	this.content[idName]=Array(bImage.src,imgTitle,imgDesc);
	el=this;
	
	bImage.onmouseover=function(){el.mHover(this);}
	bImage.onmouseout=function(){el.mOut(this);}
	bImage.onclick=function(){el.mClick(this,imgTarget,imgTitle,imgDesc);}
}

theAlbum.prototype.mHover=function(el){
	if(this.SelectedIcon==el.id){return;}
	el.className="thumbImage-hover";
}

theAlbum.prototype.mOut=function(el){
	if(this.SelectedIcon==el.id){return;}
	el.className="thumbImage";
}

theAlbum.prototype.mClick=function(el,imgTarget,imgTitle,imgDesc){
	if(this.SelectedIcon==el.id){return;}
	
	blockTarget=imgTarget;
	
	cAuthor=blockTarget.replace(/img/g,'author');
	cContent=blockTarget.replace(/img/g,'imgcontent');
	
	document.getElementById(cAuthor).innerHTML=imgTitle;
	document.getElementById(cContent).innerHTML=imgDesc;
	
	document.getElementById(this.SelectedIcon).className="thumbImage";
	el.className="thumbImage-selected";
	var imgName=el.id;
	
	imgName=imgName.replace(/thumb/g,"ico");
	
	this.SelectedIcon=el.id;
	document.getElementById(imgTarget).src=document.images[imgName].src;
}