$(document).ready(function()
    {
        $('textarea#comment_block[@readonly]').click ( function ()
            {
                alert ('Please Login to post a comment.');
            });

        $('textarea#comment_block').not( $('textarea#comment_block[@readonly]') ).focus ( function ()
            {
                if ( $('textarea#comment_block').val () == 'Enter comment here &raquo;' || $('textarea#comment_block').val () == 'Enter comment here »' )
                {
                    $('textarea#comment_block').val ('');
                }
            }).blur ( function ()
            {
                if ( $('textarea#comment_block').val () == '' || $('textarea#comment_block').val () == 'Enter comment here &raquo;' )
                {
                    $('textarea#comment_block').val ('Enter comment here »');
                }
            });

        $('div.star_readonly').click ( function () {
            alert ('Please login to rate this item');
            });

        $('form#frm_rate_me').submit ( function ()
        {
            var rating = $('input[@name=star_r]').val();
            $('input[@name=rating]').val( rating );

            if ( $('input[@name=rating]').val() == '' )
            {
                alert ('Please select a rating');
                return false;
            }
        });

        $('input#comment_submit').click( function ()
            {
                if ( $('textarea#comment_block').val () == 'Enter comment here &raquo;' || $('textarea#comment_block').val () == 'Enter comment here »' )
                {
                    alert ( '{COMMENT_REQUIRED}' );
                    return false;
                }

            });

        $('div#other_comments').hide();

        $('a#other_comment').click ( function ()
            {
                $('div#other_comments').toggle();
                return false;
            });
    });
