function isEmpty(str){
  strRE = new RegExp();
  strRE.compile('^[\s ]*$', 'gi' ); 
  return strRE.test( str.value );
} 
