function addLoadEvent( eventHandler ) {
    
    // Save the current load handler
    
    var oldOnload = window.onload;
    
    // If no current load handler is defined, set the argument as the load handler.
    
    if( typeof window.onload != 'function' ) {
        window.onload = eventHandler;
    }
    
    // Otherwise, set a new load handler that invokes both the previous load 
    // handler and the argument load handler.
    
    else {
        window.onload = function() {
            oldOnload();
            eventHandler();
        }
    }
}

function getElementsByClass( searchClass, node, tag ) {
    var classElements = new Array();

    if( node == null ) {
        node = document;
    }

	if( tag == null ) {
		tag = '*';
    }
    
	var els = node.getElementsByTagName( tag );
	var elsLen = els.length;
	var pattern = new RegExp( '(^|\\s)' + searchClass + '(\\s|$)' );
	
	for( i = 0, j = 0; i < elsLen; i++ ) {
		if( pattern.test( els[i].className ) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	
	return classElements;
}