/***/
function Thumbs(containerId, imageId) {
	var b = document.getElementsByTagName('body')[0]
	this.container = document.getElementById(containerId)
	this.bigImageId = imageId
	this.thumbnails = [];
}
Thumbs.prototype.init = function() {
	
}
Thumbs.prototype.add = function(obj) {
	if( this.thumbnails.push != 'undefined' ) {
		this.thumbnails.push(obj)
	}
}
Thumbs.prototype.showTitle = function(id, pressedElement) {
	var ele = this.getElementById(id);
	var htmlTitle;
	htmlTitle = document.getElementById('ThumbsTitle')
	var oldText =''
	if(htmlTitle && pressedElement) {
		pressedElement.oldText = htmlTitle.firstChild.nodeValue
	}
	if(htmlTitle) {
		this.container.removeChild(htmlTitle)
	}
	htmlTitle = document.createElement('p');
	htmlTitle.setAttribute('id','ThumbsTitle');
	this.container.appendChild(htmlTitle);
	
	pressedElement.onmouseout = function() {
		if(this.oldText) {
			htmlTitle.firstChild.nodeValue = this.oldText
		} else {
		
		}
	}
	if( ele.title ) {
		var txt = document.createTextNode(ele.title);
		htmlTitle.appendChild(txt);
	}
}
Thumbs.prototype.showThumbnail = function(id, pressedElement) {
	this.bigImage = document.getElementById(this.bigImageId)
	var ele = this.getElementById(id);
	
	var childs = pressedElement.parentNode.childNodes;
	for( var x = 0; x < childs.length; x++ ) {
		var cl = childs[x].getAttribute('class')
		if(cl == 'active') {
			childs[x].setAttribute('class', '');
		}
		
	}
	pressedElement.setAttribute('class', 'active');
	if(ele.title) {
	pressedElement.oldText = ele.title
	}
	if(ele.path) {
		this.bigImage.src = ele.path
	}
}
Thumbs.prototype.getElementById = function(id) {
	var ret = false;
	for(var x = 0; x < this.thumbnails.length; x++) {
		if(this.thumbnails[x].id == id) {
			ret = this.thumbnails[x];
			break;
		}
	}
	return ret;
}