/**
                          "tax the rich"
			            by jason van anden

               found at http://tax.cf.huffingtonpost.com

                               and/or

                  http://www.smileproject.com/tax

		   you can contact jason at jason@smileproject.com
				   or visit www.smileproject.com


        (c) copyright 2006 Jason Van Anden. All rights reserved.
*/

    function blurb (src, pause, speed, count){
        this.setProperties(src, pause, speed, count);
        this.b_count = 0;
    };

    blurb.prototype = new BaseSequence();
    blurb.prototype.constructor = new BaseSequence;
    blurb.superclass = BaseSequence.prototype;

    blurb.prototype.setProperties = function(src, pause, speed, count){

		blurb.superclass.setProperties.call(this, src, pause, speed, count);

        var blrb   = "left or right";
        var rnd_num = 1;

		this.return_mode = MODE_TAX;

        if (blurbs != undefined) {

			rnd_num = this.get_random_number(blurbs.length);

            try {
                blrb = getNodeValue(blurbs[rnd_num], 't');
                
                if (blrb == "oil tycoon"){
		    if (this.b_count < 15) rnd_num = this.get_random_number(blurbs.length);
		    this.b_count = 0;
                }
                
                this.b_count += 1;
                
            } catch(e) {
			    // for position only
			}
		}
        else {

			rnd_num = this.get_random_number(12);

			switch(rnd_num){
				case 1:  blrb = "outsourced";     break;
				case 2:  blrb = "uninsured";      break;
				case 3:  blrb = "bubble burst";   break;
				case 4:  blrb = "middle class";   break;
				case 5:  blrb = "over your head"; break;
				case 6:  blrb = "got kids";       break;
				case 7:  blrb = "single";         break;
				case 8:  blrb = "rent or own";    break;
				case 9:  blrb = "unrich";         break;
				case 10: blrb = "oil tycoon";     break;
				case 11: blrb = "feeling blue";   break;
				case 12: blrb = "red in the face";break;
				default:                          break;
			}
	    }

	this.name = "blurb " + rnd_num;
	this.prog = "blurb('" + blrb + "')";
	this.def_prog = this.prog;
	this.alt_prog = this.prog;

	
	
	if (blrb == "oil tycoon") {
		this.return_mode = MODE_NORMAL;
		this.eye_seq = 100;
		this.count *= 2;
	}
	else if (blrb == "red in the face") {
		this.eye_seq = 1001;
	}
	else {
		this.eye_seq = this.get_random_number(25);
	}

	return this;
    };

    blurb.prototype.mouse_over = function(){
		return;
	}

    blurb.prototype.actout = function actout(){

        if (this.first_time) {
			this.first_time = false;
		}
        else {
            blurb.superclass.actout.call(this); // this takes care of count down, etc...

			switch (this.eye_seq){

				case 1: // countdown eye sequence

					switch(this.count){
						case 5: this.prog = "eyes('5','5')"; break;
						case 4: this.prog = "eyes('4','4')"; break;
						case 3: this.prog = "eyes('3','3')"; break;
						case 2: this.prog = "eyes('2','2')"; break;
						case 1: this.prog = "eyes('1','1')"; break;
						case 0: this.prog = "eyes('0','0')"; break;
					}

					break;

			    case 2: // tears
					if ((this.count == 5) || (this.count == 2)) {this.prog = "flash_eyes(';', ';', 150)";}
					break;

				case 3: // wink
					if (this.count == 2) this.prog = "wink();";
					break;

			    case 4: // mr. bill
				    if ((this.count <= 2) && (this.count >=1)) this.prog = "mouth('o')";
					break;

			    case 5: // doh
				    if ((this.count <=4) && (this.count>=2)) this.prog = "antsy()";
					break;

				case 6: // dollar dollar bill yo
				    if (this.count ==4) this.prog = "flash_eyes('$', '$', 100)";
					break;

				//case 1001: // red in the face
				//    if (this.count == 5) this.prog = "change_style('red')";
				//    break;

				default:
					if (this.get_random_number(5)==1) this.prog = "blink()";
				    break;
			}

            // if ((this.count % 3) == 0) {this.prog = "shake_head_left()";}
            // else if ((this.count % 2) == 0) {this.prog = "shake_head_middle()";}
            // else {this.prog = "shake_head_right()";}

	    }

        return(this.prog);
    }

