if (!JS_NETLASH) { var JS_NETLASH = new Object(); }
JS_NETLASH.tlHandler =  {
	init : function() {
		if ($('.togglelist') !== null && $('.togglelist').length > 0) {
			$('.togglelist a').unbind('click', JS_NETLASH.tlHandler.handleClick);
			$('.togglelist a').bind('click', JS_NETLASH.tlHandler.handleClick);
		}
	},
	handleClick : function(evt) {
		evt.preventDefault();
		$(this).parent().toggleClass('selected');
	},
	buildIt : function(evt) {
		$('.togglelist').each(function(i) {
			var fieldId = $(this).attr('id').substring(3);
			var startFrom = $(this).attr('id').length;
			var arr = new Array();
			$(this).find('a').each(function(j) { 
				if ($(this).parent().hasClass('selected')) { arr.push($(this).parent().attr('id').substring(startFrom+1)); }
			});
			$('#' + fieldId).val(arr.join(','));
		});
	},
	_eoo : true
}
