//--------------------------------------------
        // Variables
        var charsParsed = 0;
        var currentMessage = 0;
        var newLineChar = "%";
        var emDashChar = "_";
        var buffMessage = "";
        var messages = [{
        messageTarget: "#messageType",
        fullMessage: "The #rafaddyinspired sound of early%bird ticket pricing. #cheapcheap%%",
        keyDelays: [// T,   h,   e,  __ 
                    4000, 200, 100, 150,
                    //#,    r,  a,   f,  a,  d,  d,  y,  i,   n,  s,  p,  i,  r,  e,  d,  __
                    500, 200, 20, 100, 90, 60, 70, 80, 90, 100, 70, 90, 80, 70, 90, 80, 150,
                    //s,  o,  u,  n,  d,  __
                    100, 50, 80, 70, 90, 110,
                    //o,  f,  __
                    100, 80, 150,
                    //e,  a,  r,  l,  y,   %
                    100, 80, 70, 80, 70, 150,
                    //b,  i,  r,  d,  __
                    100, 80, 60, 70, 150,
                    //t,  i,  c,  k,  e,  t,  __
                    100, 80, 80, 80, 80, 80, 150,
                    //p,  r,  i,  c,  i,  n,  g,  .,  __
                    100, 80, 80, 80, 80, 80, 80, 70, 100,
                    //#,    c,  h,  e,  a,  p,   c,  h,  e,  a,  p,   %,    %
                    1000, 205, 80, 90, 80, 90, 700, 80, 70, 80, 80, 1500, 500]
        }, {
        messageTarget: "#submessageType",
        fullMessage: "Get your tickets for the show before February 24th and save.",
        keyDelays: [//G,  e,  t, __
                    800, 80, 60, 80,
                    //y,  o,  u,  r, __ 
                    100, 90, 75, 90, 80,
                    //t, i,  c,  k,  e,  t,  s, __
                    50, 90, 95, 70, 90, 50, 40, 80,
                    //f,  o,  r, __
                    100, 95, 98, 70,
                    //t,  h,   e,  __
                    90, 110, 100, 150,
                    //s, h,  o,  w,  __
                    75, 90, 90, 90, 150,
                    //b,  e,  f,  o,  r,  e, __ 
                    100, 90, 75, 70, 80, 90, 80,
                    //F, e,  b,  r,  u,  a,  r,  y,  __
                    75, 90, 80, 90, 90, 90, 90, 90, 150,
                    //2,  4,   t,  h, __
                    125, 90, 100, 80, 110,
                    //a, n,  d,  __
                    75, 90, 70, 110,
                    //s,  a,  v,  e,  .
                    100, 70, 90, 80, 90 ]}];

        //--------------------------------------------
        // Methods
        function typeMessage(charPosition) {

            // The character parsed
            charsParsed++;
            
            // Check if we are new line
            if (messages[currentMessage].fullMessage.charAt(charPosition) == newLineChar) {
                // Add a break instead of the character
                buffMessage = buffMessage + "<br/>";

            } else if (messages[currentMessage].fullMessage.charAt(charPosition) == emDashChar) {
                // Add a break instead of the character
                buffMessage = buffMessage + "&mdash;";

            // Not on a new line, or em dash, just add the character
            } else {
                // Add the new character to the buffered message
                buffMessage = buffMessage + messages[currentMessage].fullMessage.charAt(charPosition);
            }
            
            // Replace the HTML inside the messageTypeContainer with our new buffer
            $(messages[currentMessage].messageTarget).html(buffMessage);

            // If we are not done typing the message
            if (charsParsed < messages[currentMessage].fullMessage.length) {
                
                // Type the next Character
                delayNextCharacter(charPosition + 1);
                
            } else {
                // Increment our current message
                currentMessage++;
                // Reset our characters parsed
                charsParsed = 0;
                // Reset the buffered Message
                buffMessage = "";

                // Update the cursor size
                $("#messageCursor").addClass("subtype");
                
                // Do we have another message to display?
                if (currentMessage <= messages.length) delayNextCharacter(0);
            }
        }

        function delayNextCharacter(charPosition) {
            // Set a timer until next character is typed
            setTimeout("typeMessage(" + charPosition + ")", messages[currentMessage].keyDelays[charPosition]); //100 + (Math.random() * 100 - 50));
        }

        function blink(isHidden) {

            // Turn off or on the cursor
            if (isHidden) $('#messageCursor').hide();
            else $('#messageCursor').show();

            // Should we show or hide next time
            isHidden = (isHidden) ? false : true;
            
            // Blink again after delay
            setTimeout("blink(" + isHidden + ")", 500);
        }
        
        
        // Document Ready Handler
        $(document).ready(function() {
            // Init the typing function (starting at char 0)
            delayNextCharacter(0);
            // Blink the cursor
            blink(false);
        });
