$(document).ready(function(){
    
    //Show hover over color on all tables with .stripeme
    $("tr").hover(
        function () {
            $(this).toggleClass('hover');
        },
        function () {
            $(this).removeClass('hover');
        }
    );

    //show striping on all tables
    $("tr:odd").addClass('altrow');

    //Remove "Flash Messages" after specified time
    setTimeout(function() {
        $("#flashMessage").fadeOut("200")
    }, 1000);

    //initialize the calendar pop-ups
    $('.datepicker').datepicker({ dateFormat: 'yy-mm-dd'});

    //initialize WYSISYG editor
    $('.wymeditor').wymeditor(); //end the wysiwyg

    //fades out and swaps out default message in textbox when clicked on
    $('.textbox_default').each(function() {
        var default_value = this.value;
        $(this).css('color', '#cccccc'); // this could be in the style sheet instead
        $(this).focus(function() {
            if(this.value == default_value) {
                this.value = '';
                $(this).css('color', '#333');
            }
        });
        $(this).blur(function() {
            if(this.value == '') {
                $(this).css('color', '#cccccc');
                this.value = default_value;
            }
        });
    });
    

})
