if( document.addEventListener ) document.addEventListener( 'DOMContentLoaded', cmxform, false );

function cmxform(){
  // Hide forms
  $j( 'form.cmxform' ).hide().end();
  
  // Не чіпати лейбли під парентом з класом .nocmx.
  $j( 'form.cmxform' ).find( 'li .nocmx label').addClass('nocmx');

  // Processing
  $j( 'form.cmxform' ).find( 'li label' ).not( '.nocmx' ).each( function( i ){
    var labelContent = this.innerHTML;
	var style1 = document.defaultView.getComputedStyle( this, '' );
    var labelWidth = 0;
	if (typeof style1 == 'object' && style1 != null) {
		labelWidth = style1.getPropertyValue( 'width' );
	}
    var labelSpan = document.createElement( 'span' );
        labelSpan.style.display = 'block';
        labelSpan.style.width = labelWidth;
        labelSpan.innerHTML = labelContent;
    this.style.display = '-moz-inline-box';
    this.innerHTML = "";
    this.appendChild( labelSpan );
  } ).end();
  
  $j( 'form.cmxform' ).find( 'li span[class=signs]' ).not( '.nocmx' ).each( function( i ){ this.style.display = '-moz-inline-box'; } ).end();
  // Show forms
  $j( 'form.cmxform' ).show().end();
  return;
}
