$(document).ready( function(){

    // Form submit buttons manipulation
    $(":submit, :button").addClass("form-button");
    
    $(".form-button").css({
        'border': '2px solid #ccc',
        'padding': '4px 8px',
        'margin': '15px 10px 0 0',
        'cursor': 'pointer',
        'color': '#111'
    }).hover( function(){
        $(this).css({
            'background': '#C1D72E'
        });
    }, function(){
        $(this).css({
            'background': '#f0f0f0'
        });    
    });
    

    // Calendar tablet manipulation
    
    var isCalendar = 0;
    
    if ( $(".d4contentTable").length && $(".d4contentTable").find("th") ) {
        isCalendar = 1;
    } 
    
    if (isCalendar == 1) {
        
        // Common table styling
        $(".d4contentTable, .d4contentTable td").css({
            'borderCollapse': 'collapse',
            'padding': '0'
        });
        
        // Set the first row purple 
        $(".d4contentTable th").css({
            'background': '#9D3C9A',
            'fontSize': '12px',
            'padding': '5px 7px',
            'fontWeight': 'normal',
            'color': '#fff'
        });
        
        // Set the second row
        $(".d4contentTable tr:eq(1) a").css({
            'fontSize': '12px',
            'padding': '6px 0',
            'color': '#ffffff',            
            'display': 'block',
            'textAlign': 'center',
            'backgroundColor': '#B875B2'
        }).hover( function(){
            $(this).css({
                'color': '#111'
            });
        },
        function(){
            $(this).css({
                'color': '#fff'
            });
        });
        
        // Set the third row
        $(".d4contentTable tr:eq(2) a").css({
            'fontSize': '18px',
            'padding': '4px 10px 5px',
            'color': '#111111',            
            'display': 'block',
            'textAlign': 'center',
            'backgroundColor': '#D4D4D4'        
        }).hover( function(){
            $(this).css({
                'backgroundColor': '#c1d72e'
            });
        },
        function(){
            $(this).css({
                'backgroundColor': '#D4D4D4'
            });
        });
        
    }

});

