public static function showImage( $resource, $type = IMAGETYPE_PNG, $quality = 100, $sendHeader = TRUE )
	{
		switch( $type )
		{
			case IMAGETYPE_GIF:
				if( $sendHeader )
					header( "Content-type: image/gif" );
				ImageGIF( $resource );
				break;
			case IMAGETYPE_JPEG:
				if( $sendHeader )
					header( "Content-type: image/jpeg" );
				ImageJPEG( $resource, "", $quality );
				break;
			case IMAGETYPE_PNG:
				if( $sendHeader )
					header( "Content-type: image/png" );
				ImagePNG( $resource );
				break;
			default:
				throw new InvalidArgumentException( 'Invalid Image Type' );
		}
	}