    // -------------------------------------------------
    // javascript lib
    //
    // some helpers from prototype libary and other
    // wise guys, thanks for that!
    //
    // by:      Joachim Wendenburg, kgde@wendenburg.de
    // date:    25.03.2007
    //
    // mod:
    // item:
    //
    // -------------------------------------------------
    
    // helper to create array from arguments
    // thanks to molily@gmx.de
    //
    function $A (iterable) {
        var result = [];
        for (var i = 0; i < iterable.length; i++) {
            result.push(iterable[i]);
        }
        return result;
    }
    
    // get elements by tag and class name 
    //
    function $cm (el, class_name) {
    
        var curr_class, all_obj, ret_obj = [], temp;
        
        all_obj =   document.getElementsByTagName(el);    
        for (i = 0; i < all_obj.length; i++) {
    
            // no match at all
            //
            if(all_obj[i].className.indexOf (class_name) == -1) continue;
            
            // in case we have more then one class
            //        
            temp =   "," + all_obj[i].className.split(" ").join(",") + ",";
            if (temp.indexOf("," + class_name + ",") == -1) continue;
                
            ret_obj[ret_obj.length] =   all_obj[i];
        }
        return ret_obj;
    }    
    
    // helps to stay inside the scope
    // taken from prototype lib - thanks guys!
    //
    Function.prototype.bind = function () {

        var method  =  this;
        var args    =  $A(arguments);
        var object  =  args.shift();
        
        var wrapper =  function () {
            return method.apply(object, args);
        }
        return wrapper;    
    }  
    
    Function.prototype.bindAsEventListener = function (object) {
    
        var method  = this;
        var wrapper = function (event) {
            method.call(object, event || window.event);
        }
        return wrapper;
    }  
    
    // shortcut for document.getElementById 
    // taken from prototype lib - thanks guys!
    //    
    function $() {
    
        var elements = new Array();        
        for (var i = 0; i < arguments.length; i++) {
        
            var element = arguments[i];
            if (typeof element == 'string') element = document.getElementById(element);
            if (arguments.length == 1)      return element;
            elements.push(element);
        }            
        return elements;
    }
    
    
    