if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', cmxform, false );

/*
function cmxform(){
  // Hide forms
  $( 'form.cmxform' ).hide().end(); // hides the form
  
  // Processing
  $( 'form.cmxform' ).find( 'li/label' ).not( '.nocmx' ).each( function( i ){ // selects all labels inside of list items in the form#cmxform
    var labelContent = this.innerHTML; // set var to the innerHTML of the label
    var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' ); // set a var to access the width of the label
    var labelSpan = document.createElement( 'span' ); // create a span
        labelSpan.style.display = 'block'; // set the span display style to block
        labelSpan.style.width = labelWidth; // set the width style equal to the same width as the label width style set in the stylesheet
        labelSpan.innerHTML = labelContent; // put what was inside the label inside the span
    this.style.display = '-moz-inline-box'; // add the moz inline box style to the label display
    this.innerHTML = null; // delete what is in the label now
    this.appendChild( labelSpan ); // now put the span and its contents inside the label
  } ).end();
  
  // Show forms
  $( 'form.cmxform' ).show().end(); // show the form
}
*/

function cmxform () {
	$$('form.cmxform li label').each(function(input) {
		var labelContent = input.innerHTML;
		var labelWidth = input.getStyle('width');
		var labelspan = document.createElement('span');
		labelspan.style.display = 'block';
		labelspan.style.width = labelWidth;
		labelspan.innerHTML = labelContent;
		input.style.display='-moz-inline-box';
		input.innerHTML = null;
		input.appendChild( labelspan );
	})
}