	/**
	 * Class TechDivision.Accordion
	 * This class extends scriptacolous.Accordion to do more things onClick 
	 *
	 * @author Johann Zelger <j.zelger@techdivision.com>
	 */
	// check for scriptacolous libraries
	if(typeof Accordion == 'undefined') {
		throw("td.library.js requires including script.aculo.us' accordion.js library");
	}
	
	TechDivision.Accordion = Class.create(Accordion, {

		/**
		 * Extend clickHandler to do Pointings and Redirects on given id strings
		 * of the clicked element
		 * 
		 * @param Object e
		 * @return void
		 */
		clickHandler: function(e) {
	        var el = e.element();
	        if (el.tagName == 'SMALL') el = el.parentNode;
	        if (el.tagName == 'IMG') el = el.parentNode.parentNode;
	        if(el.hasClassName(this.options.toggleClass) && !this.isAnimating) {
	            this.expand(el);
	            if (el.id) {
		            var functionCall = el.id.split("#####");
		            var functionName = functionCall[0];
		            var functionParam = functionCall[1];
		            this[functionName](functionParam);
	            }
	        }
	    },
	    
	    /**
		 * Point on flashmap by given paramString
		 * 
		 * @param string pointStr
		 * @return void
		 */
	    point: function(pointStr) {
	    	if (pointStr) {
	    		MM_controlShockwave('map','',pointStr);
	    	}
	    },
	    
	    /**
		 * Redirects the user to the ex.karto_id
		 * 
		 * @param string redirectStr
		 * @return void
		 */
	    redirect: function(redirectStr) {
	    	if (redirectStr) {
	    		var params = redirectStr.split(":::");
	    		var url = params[0];
	    		var karto = params[1];
	    		var redirectNow = function() {
	    			var x=window.confirm("Sie werden nun auf "+karto+" weitergeleitet.");
		    		if (x) window.location = url;
	    		}
	    		window.setTimeout(redirectNow, 1000);
	    	}
	    }
	});
