function trim(s) {
  while (s.substring(0,1) == ' ') {
    s = s.substring(1,s.length);
  }
  while (s.substring(s.length-1,s.length) == ' ') {
    s = s.substring(0,s.length-1);
  }
  return s;
}


/**
**/
function show( id ) {
	var e = document.getElementById(id);
	if( e == null )
		return false;

	e.style.display = 'block';
	return true;
}

/**
**/
function hide( id ) {
	var e = document.getElementById(id);
	if( e == null )
		return false;

	e.style.display = 'none';
	return true;
}

/**
**/
function displayToggle( id ) {
	var e = document.getElementById(id);
	if( e.style.display == 'none' )
		e.style.display = 'block';
	else
		e.style.display = 'none';
}


/**
 *  @param  string   callback
 *  @param  string   id
 *  @return boolean  true to trigger calling form, false to inhibit it.
**/
function actionConfirm( callback, id )
{
	if( confirm( label_areYouSure ) ) {
		if( callback == null || callback == '' || id == null || id == '' ) {
			return true;
		}
		if( eval(callback)(id) == true ) {
			return false;
		}
		return true;
	} else {
		return false;
	}
}

