	if( document.addEventListener )
	
document.addEventListener( 'DOMContentLoaded', shopform, false);

function shopform(){
  // Hide the form while we re-adjust the markup so the user doesn't see things changing
  $( 'form.shopform' ).hide().end();
  // Processing
  // Find all labels within form.shopform which are descendants of an li element NOTE: changed from find('li/label') as this wasn't selecting elements
  $( 'form.shopform' ).find( 'li>label' ).not( '.nojquery' ).each( function( i ){
	//alert(this.id);
    var labelContent = this.innerHTML;
    var labelWidth = document.defaultView.getComputedStyle( this, '' ).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 = null;
    this.appendChild( labelSpan );
  } ).end();

  // Show forms
  $( 'form.shopform' ).show().end();
}


