/**
  * Get all elements by class name
  *
  * param classname The classname search elements belong to
  * param node The node to start searching from (can be null)
  *
  * return List of elements that have the specified classname
  */
function getElementsByClassName(classname, node)
	{
	// Has no node been supplied ?
    if(!node)
    	{
    	// Use the body node
    	node = document.getElementsByTagName("body")[0];
    	}

	// Define the list of matching elements
	var matchingElements = [];

	// Define regular expression to match the classname
	var re = new RegExp('\\b' + classname + '\\b');

	// Get all elements within the start node
	var els = node.getElementsByTagName("*");

	// Loop through the elements
    for(var i=0,j=els.length; i<j; i++)
    	{
    	// Does this element match the required classname ?
    	if(re.test(els[i].className))
    		{
    		// Add the element to our matching elements list
    		matchingElements.push(els[i]);
    		}
    	}

	return matchingElements;
    }

/**
  * Enable any buttons with a class of "javascriptRequired" so that they are visible
  * [i.e. Clears any display="none" set in the CSS]
  */
function EnableJavaScriptButtons()
	{
	// Get all elements with a class of "javascriptRequired"
	elementList = getElementsByClassName("javascriptRequired");

	// Loop through all found elements
	for (var elementIndex=0;
		 elementIndex < elementList.length;
		 ++elementIndex)
	    {
	    // Get the classname for this object
	    var className = new String(elementList[elementIndex].className);

	    // Remove the javascriptRequired class
	    var reg = new RegExp("javascriptRequired");
	    className = className.replace(reg,"");

	    // Enable visibility of this element
	    elementList[elementIndex].className = className;
		}
	}