function isSet( mixed ) {
  return ( typeof( mixed ) != 'undefined' && !isNull( mixed ) );
}
function isNull( mixed ) {
  return ( mixed == null );
}
function isInstance( mixed, aConstructor ) {
  return ( typeof( mixed ) == 'object' && isSet( mixed.constructor ) && mixed.constructor == aConstructor );
}

function toString() {
  var obj = arguments[ 0 ];
  var include_fnct = ( arguments[ 1 ] );
  var excludes = {};
  if ( arguments.length > 2 )
    for( var i=2; i<arguments.length; i++ )
      excludes[ arguments[ i ] ] = true;
  var rv = '[ ';
  for( var i in obj ) {
    if ( ( typeof obj[ i ] == 'function' ) ? include_fnct : typeof excludes[ i ] == 'undefined' )
      rv += i + ': ' + obj[ i ] + ', ';
  }
  if ( rv.length > 2 )
    rv = rv.substr( 0, rv.length - 2 );
  rv += ' ]';
  return rv;
}

if ( typeof( String.prototype.trim ) == 'undefined' )
  String.prototype.trim = function() {
      return this.replace( /^\s+/, '' ).replace( /\s+$/, '' );
  }

/**
  @param  superConstructor  function  la fonction de la super classe
  @note   ne pas oublier de faire appel au constructeur de la super-classe
    this.constructor.call( this );
    // ou si on doit passer le paramètre value
    this.constructor.call( this, value );
*/
Function.prototype.extend = function( superConstructor ) {
	if ( typeof( superConstructor ) == "function" ) {
		this.prototype = superConstructor.prototype;
		this.prototype.constructor = superConstructor;
	}
	return this.prototype;
}