

    function chewy(objArt, index, behavior){
        this.setProperties(objArt, index, behavior);
        if (behavior == undefined) behavior = MODE_WAKEUP_QUICK;
        this.behavior_switch(behavior);
        return this;
    }

    chewy.prototype = new BaseBehaviors();
    chewy.prototype.constructor = new BaseBehaviors;
    chewy.superclass = BaseBehaviors.prototype;

    chewy.prototype.super_looper = function (){
       if (this.co.fini()) this.behavior_switch(this.co.behavior());
       this.output();
    };

    chewy.prototype.behavior_switch = function (behavior){

		switch (behavior){ // (MODE_NORMAL){ //

			case MODE_NORMAL:
				this.co = new normal(this, 1000, 100, 25);
				break;

			case MODE_WOOF:
				this.co =  new woof(this, 1000, 100, 500);
				break;

			case MODE_STAY:
				this.co =  new stay(this, 100, 100, 1000);
				break;

			case MODE_WOOFY:
				this.co =  new woofy(this, 1000, 100, 1000);
				break;

			case MODE_WOOFY_STAY:
				this.co =  new stay_woofy(this, 100, 100, 1000);
				break;

			case MODE_DOUBLE_TAKE:
				this.co =  new shake_head(this, 50, 100, 2);
				break;

			case MODE_SHAKE_HEAD:
				this.co =  new shake_head(this, 50, 100, 12);
				break;

			case MODE_WAKEUP_QUICK:
				this.co =  new wakeup(this, 1000, 100, 1);
				break;

			case MODE_WAKEUP:
				this.co =  new wakeup(this, 250, 100, 10);
				break;

			case MODE_TIRED:
				this.co = new tired(this, 2000, 0, 5);
				break;

			case MODE_SLEEP:
				this.co = new sleep(this, 1000, 0, 1000);
				break;

			case MODE_LOOK_AROUND:
				this.co = new look_around(this, 100, 25);
				break;

			case MODE_PSYCHED:
				this.co = new psyched(this, 200, 1, 10);
				break;

			case MODE_BALL_GET:
				this.co = new ball_get(this, 150, 100, 10);
				break;


			default:
				this.co = new BaseSequence(this, 1000, 100, 2);
				break;
	   }
    };

    chewy.prototype.md = function(posX, posY){

	    var retval = this.co.md(posX, posY)
	    // if (retval) if (window.top != window) window.open('http://www.smileproject.com/chewy/index.htm'); //, '', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=yes, scrollbars=yes, width=300, height=600');

	    return (retval);
    };


    chewy.prototype.start_face = function(){
        this.redraw (1, "         ");      //           //
        this.redraw (2, " %     % ");      //  %     %  //
        this.redraw (3, "% %***% %");      // % %***% % //
        this.redraw (4, "  *. .*  ");      //   *. .*   //
        this.redraw (5, "   *o*   ");      //    *o*    //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //           //
    };

    chewy.prototype.eyes_opened = function(){
        this.redraw (4, "  *. .*  ");
    };

    chewy.prototype.eyes_closed = function(){
        this.redraw (4, "  *_ _*  ");
    };

    chewy.prototype.ears_down = function(){
        this.redraw (1, "         ");      //           //
        this.redraw (2, " %     % ");      //  %     %  //
        this.redraw (3, "% %***% %");      // % %***% % //
    };

    chewy.prototype.look_normal = function(){
        this.redraw (4, "  *. .*  ");
    };

    chewy.prototype.nothing = function(){
        return;
    };

    chewy.prototype.wink_right = function(){
        this.redraw (4, "  *_ .*  ");
    };

    chewy.prototype.wink_left = function(){
        this.redraw (4, "  *. _*  ");
    };

    chewy.prototype.tounge_in = function(){
        this.redraw (6, "         ");

    };

    chewy.prototype.tounge_out = function(){
        this.redraw (6, "    U    ");
    };

    //&=====&

    chewy.prototype.sleep_bone_start = function(){
        this.redraw (1, "   &=&   ");      //    z    //
    };

    chewy.prototype.sleep_bone_middle = function(){
        this.redraw (1, "  &===&  ");      //    z    //
    };

    chewy.prototype.sleep_bone_left = function(){
        this.redraw (1, " &===&   ");
    };

    chewy.prototype.sleep_bone_wayleft = function(){
        this.redraw (1, "&===&    ");
    };

    chewy.prototype.sleep_bone_right = function(){
        this.redraw (1, "   &===& ");
    };

    chewy.prototype.sleep_bone_wayright = function(){
        this.redraw (1, "    &===&amp;");
    };

    chewy.prototype.sleep_z = function(){
        this.redraw (1, "    z    ");      //    z    //
    };

    chewy.prototype.sleep_z_z = function(){
        this.redraw (1, "   z-z   ");      //   z-z   //
    };

    chewy.prototype.sleep_z_z_z = function(){
        this.redraw (1, "  z-z-z  ");      //  z-z-z  //
    };

    chewy.prototype.sleep_z_z_z_z = function(){
        this.redraw (1, " z-z-z-z ");      // z-z-z-z //
    };

    chewy.prototype.sleep_z_z_z_z_z = function(){
        this.redraw (1, "z-z-z-z-z");      //z-z-z-z-z//
    };

    chewy.prototype.blink = function(){
        this.redraw (4, "  *_ _*  ");
        super_duper (this.index, "eyes_opened()", 100);
    };

    chewy.prototype.speak = function(msg, delay){

         var pad = 0;

         if (!(msg.length > 9) && (msg.length > 0)) {

            pad = parseInt((10 - msg.length)/2);

            if ((pad + msg.length) > 9) pad -= 1;

            for (i = 0; i < pad; i++){
                msg = "&nbsp;" + msg + "&nbsp;";
            }
         }

         if (msg.length > 0) {
             this.redraw (1, msg);             //  message! //

             this.redraw (2, "         ");     //           //
             this.redraw (3, "% %***% %");     // % %***% % //
             this.redraw (4, "  *'o'*  ");     //   *'o'*   //
             this.redraw (5, "    o    ");     //     o     //
             this.redraw (6, "         ");     //           //
             this.redraw (7, "         ");      //           //

             super_duper (this.index, "speak('')", delay);

         }
         else {
             this.start_face();
             this.ears_down();
         }
    };

    chewy.prototype.ears_back = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%   %% ");      // %%   %% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *. .*  ");      //  *. .*  //
        this.redraw (5, "   *o*   ");      //   *o*   //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "         ");      //           //

    };

    chewy.prototype.mouth_opened = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%   %% ");      // %%   %% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *.o.*  ");      //  *.o.*  //
        this.redraw (5, "   vwv   ");      //   vvv   //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "   ^~^   ");      //   ^^^   //
    };

    chewy.prototype.mouth_closed = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%   %% ");      // %%   %% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *.o.*  ");      //  *.o.*  //
        this.redraw (5, "   vwv   ");      //   vvv   //
        this.redraw (6, "   ^~^   ");      //   ^^^   //
        this.redraw (7, "         ");      //         //
    };


    chewy.prototype.mouth_opened_crazy = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%   %% ");      // %%   %% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *@o@*  ");      //  *.o.*  //
        this.redraw (5, "   vwv   ");      //   vvv   //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "   ^~^   ");      //   ^^^   //
    };

    chewy.prototype.mouth_closed_crazy = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%   %% ");      // %%   %% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *@o@*  ");      //  *.o.*  //
        this.redraw (5, "   vwv   ");      //   vvv   //
        this.redraw (6, "   ^~^   ");      //   ^^^   //
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.shake_head_middle = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, " %%% %%% ");      // %%% %%% //
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  *...*  ");      //  *...*  //
        this.redraw (5, "  *ooo*  ");      //  *ooo*  //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "         ");      //         //
    };


    chewy.prototype.shake_head_left = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, "%%  %%%  ");      // %%  %%  //
        this.redraw (3, "  %***%  ");      //   %***% //
        this.redraw (4, "  *.. *  ");      //   *.. * //
        this.redraw (5, "  *o*    ");      //   *o*   //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.shake_head_right = function(){
        this.redraw (1, "         ");      //         //
        this.redraw (2, "  %%  %%%");      //  %%  %%%//
        this.redraw (3, "  %***%  ");      //  %***%  //
        this.redraw (4, "  * ..*  ");      //  * ..*  //
        this.redraw (5, "    *o*  ");      //    *o*  //
        this.redraw (6, "         ");      //         //
        this.redraw (7, "         ");      //         //
    };


    chewy.prototype.interested = function(){
        this.redraw (1, "         ");      //           //
        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  *. .*  ");      //   *. .*   //
        this.redraw (5, "   *o*   ");      //    *o*    //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //         //
    };


    chewy.prototype.listen_right = function(){
        this.redraw (1, "  %      ");       //  %       //
        this.redraw (2, " %     % ");       // %     %  //
        this.redraw (3, "  %***% %");       //  %***% % //
        this.redraw (4, "  *. .*  ");       //  *. .*   //
                                            //   *o*    //
        this.redraw (6, "         ");       //          //
        this.redraw (7, "         ");      //         //

        super_duper(this.index, "ears_down()", 1000);
    };

    chewy.prototype.listen_left = function(){
        this.redraw (1, "      %  ");      //       %   //
        this.redraw (2, " %     % ");      //  %     %  //
        this.redraw (3, "% %***%  ");      // % %***%   //
        this.redraw (4, "  *. .*  ");      //   *. .*   //
                                           //    *o*    //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //         //

        super_duper (this.index, "ears_down()", 1000);
    };

    chewy.prototype.ears_up = function(){
                                           //           //
        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
                                           //   *. .*   //
                                           //    *o*    //
                                           //           //
    };

    chewy.prototype.sleeping = function(){
        this.redraw (1, "         ");      //           //
        this.redraw (2, "         ");      //           //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "% *_ _* %");      // % *_ _* % //
        this.redraw (5, "   *o*   ");      //    *o*    //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.sleepy = function(){
        this.redraw (1, "         ");      //           //
        this.redraw (2, " %     % ");      //  %     %  //
        this.redraw (3, "% %***% %");      // % %***% % //
        this.redraw (4, "  *; ;*  ");      //   *; ;*   //
        this.redraw (5, "   *o*   ");      //    *o*    //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.yawn = function(){

        this.redraw (1, "         ");      //           //
        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  **o**  ");      //   **o**   //
        this.redraw (5, "    0    ");      //     0     //
        this.redraw (6, "         ");      //           //
        this.redraw (7, "         ");      //         //

        super_duper (this.index, "sleepy()", 1500);
    };

    chewy.prototype.look_straight = function(){

        this.redraw (4, "  *. .*  ");      //   *. .*  //
        this.redraw (5, "   *o*   ");      //    *o*   //

    };

    chewy.prototype.look_fast = function (){    // this one is pretty funny!

        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  *...*  ");      //   *...*   //
        this.redraw (5, "   *o*   ");      //    *o*    //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.look_nw = function(){

        this.redraw (2, "         ");      //   %***%   //
        this.redraw (3, "  %***%  ");      // % *'' * % //
        this.redraw (4, "% *'' * %");      //   *o*     //
        this.redraw (5, "  *o*    ");      //           //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //

    };

    chewy.prototype.look_ne = function(){

        this.redraw (2, "         ");      //   %***%   //
        this.redraw (3, "  %***%  ");      // % * ''* % //
        this.redraw (4, "% * ''* %");      //     *o*   //
        this.redraw (5, "    *o*  ");      //           //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.look_n = function(){

        this.redraw (2, "         ");      //   %***%   //
        this.redraw (3, "  %***%  ");      // % *' '* % //
        this.redraw (4, "% *' '* %");      //    *o*    //
        this.redraw (5, "   *o*   ");      //           //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.look_s = function(){

        this.redraw (2, "  %   %  ");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  *. .*  ");      //   *,*,*   //
        this.redraw (5, "   *o*   ");       //    *o*   //
        this.redraw (6, "         ");

    };

    chewy.prototype.look_se = function(){

        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  * ..*  ");      //   * ..*   //
        this.redraw (5, "    *o*  ");      //     *o*   //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.look_sw = function(){

        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  *.. *  ");      //   *.. *   //
        this.redraw (5, "  *o*    ");      //   *o*     //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //'
    };

    chewy.prototype.look_w = function(){

        this.redraw (2, "   %   %%");      //   %   %% //
        this.redraw (3, "  %***%  ");      //  %***%   //
        this.redraw (4, "  *.. *  ");      //  *.. *   //
        this.redraw (5, "  *o*    ");      //  *o*     //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.look_e = function(){

        this.redraw (2, "%%   %   ");      // %%   %   //
        this.redraw (3, "  %***%  ");      //   %***%  //
        this.redraw (4, "  * ..*  ");      //   * ..*  //
        this.redraw (5, "    *o*  ");      //     *o*  //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.dazed_open = function(){
        this.redraw (1, "         ");
        this.redraw (2, "         ");
        this.redraw (3, "  %***%  ");
        this.redraw (4, " %*@ @*% ");
        this.redraw (5, "   *o*   ");
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };

    chewy.prototype.dazed_blink_open = function(){
        // this.redraw (1, "         ");
        this.redraw (4, "% *. .* %");
    };

    chewy.prototype.dazed_blink_closed = function(){
        // this.redraw (1, "         ");
        this.redraw (4, "% *_ _* %");
    };


    chewy.prototype.dazed_blink_crazed = function(){
        //this.redraw (1, "    ?    ");
        this.redraw (4, "% *@ @* %");
    };


    // unresolved!

    chewy.prototype.nose_tickle = function(){

        this.redraw (2, "         ");      // %%     %% //
        this.redraw (3, " %%***%% ");      //   %***%   //
        this.redraw (4, "  *   *  ");      //   *,*,*   //
        this.redraw (5, "   *ö*   ");       //    *o*   //
        this.redraw (6, "         ");
        this.redraw (7, "         ");      //         //
    };




    /**
    chewy.prototype.look_nw = function(){

        this.redraw (2, "%%     %%");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, "  o'' *  ");      //   *,*,*   //
        this.redraw (5, "   **    ");       //    *o*   //
        this.redraw (6, "         ");

    };

    chewy.prototype.look_xx = function(){

        this.redraw (2, "         ");      // %%     %% //
        this.redraw (3, "  %***%  ");      //   %***%   //
        this.redraw (4, " %*'o'*% ");      //   *,*,*   //
        this.redraw (5, "   *^*  ");       //    *o*   //

    };


    chewy.prototype.look_x = function(){

        this.redraw (2, "   *o*   ");      // %%     %% //
        this.redraw (3, "  *' '*  ");      //   %***%   //
        this.redraw (4, "  %***%  ");      //   *,*,*   //
        this.redraw (5, "  %   % ");       //    *o*   //
    };

    */
