/**
 * @author werner
 */

var Highlight = Class.create({
	
	allowHighlight: false,
	
	highlightStart: function(id) {
		if (this.allowHighlight) {
			el = $(id);
			if (el) {
				el.className=el.className+' imgtxthlbox-highlightbox-highlight';
				for (var i=0; i<el.childNodes.length; i++) {
					if (el.childNodes[i] && el.childNodes[i].className.toLowerCase().match('imgtxthlbox')) {
						el.childNodes[i].className=el.childNodes[i].className+' '+el.childNodes[i].className+'-highlight';
					}
				}
			}
		}
	},
	
	highlightStop: function(id) {
		if (this.allowHighlight) {
			el = $(id);
			if (el) {
				el.className='imgtxthlbox-highlightbox';	
				for (var i=0; i<el.childNodes.length; i++) {
					if (el.childNodes[i] && el.childNodes[i].className.toLowerCase().match('imgtxthlbox')) {
						el.childNodes[i].className=el.childNodes[i].className.substring(0,el.childNodes[i].className.lastIndexOf(' '));
						//el.childNodes[i].className.replace((' '+el.childNodes[i].className+'-highlight'),'');
					}
				}
			}
		}
	}
});


//function initHighlight() { wsHighlight = new Highlight(); }
//Event.observe(window, 'load', initHighlight, false);
//window.addEvent('load',function () {wsHighlight=new Highlight();});
