$(document).ready(function(){

    $(".panel-search-label input").focus(function(){
        if($(this).parent().hasClass("input-placeholding")) {
            $(this).parent().removeClass("input-placeholding");
        }
    });
    $(".panel-search-label input").blur(function(){
        if(!$(this).parent().hasClass("input-placeholding")) {
            $(this).parent().addClass("input-placeholding");
        }
    });

    if ($('#categories .catNumData').html()) {
        $("#categories .catNumData").each(function(){
            $(this).html($(this).html().replace(/\[/g, '('));
            $(this).html($(this).html().replace(/\]/g, ')'));
        });
    }

});

function comrate(url){
    $.get(url, function(data) {
        var user_rep = $('.repHistory span', data).text();
        user_rep = parseInt(user_rep);
        if (user_rep > 9) {
        }
        else {
            $('.a-bad').attr('onclick', '');
            $('.a-bad').click(function(event) {
                event.preventDefault;
                alert('Your reputation level is too low to do this action');
            });
        }
    });
};

function chrep(url){
    $.get(url, function(data) {
        var user_rep = $('.repHistory span', data).text();
        user_rep = parseInt(user_rep);
        if (user_rep > 9) {
        }
        else {
            $('.minus-rep').attr('onclick', '');
            $('.minus-rep').attr('href', '#');
            $('.minus-rep').remove();
            $('.minus-rep').click(function(event) {
                event.preventDefault;
                alert('Your reputation level is too low to do this action');
            });
        }
    });
};
