var typesearch = '';
                function newtype(type)
                {
                if(type == 'news')
                {
                $('.type-news').css('font-weight','bold');
                $('.type-web').css('font-weight','normal');
                $('.type-orther').css('font-weight','normal');
                $('.type-music').css('font-weight','normal');
                typesearch = '&type=news';
                }
                else if(type == 'web')
                {
                $('.type-web').css('font-weight','bold');
                $('.type-news').css('font-weight','normal');
                $('.type-orther').css('font-weight','normal');
                $('.type-music').css('font-weight','normal');
                typesearch = '';
                }
                else if(type == 'music')
                {
                $('.type-music').css('font-weight','bold');
                $('.type-web').css('font-weight','normal');
                $('.type-news').css('font-weight','normal');
                $('.type-orther').css('font-weight','normal');
                typesearch = '&type=music';
                }
                else if(type == 'tagmusic')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Интересы');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'tagmusic';
                    }
                 else if(type == 'tagvideo')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Интересы');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'tagvideo';
                    }
                 else if(type == 'tagbook')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Интересы');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'tagbook';
                    }
                 else if(type == 'taggame')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Интересы');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'taggame';
                    }
                    else if(type == 'tagtele')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Интересы');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'tagtele';
                    }
                     else if(type == 'tag')
                    {
                        $('.type-orther').css('font-weight','bold');
                        $('.type-orther').html('Теги');
                        $('.type-web').css('font-weight','normal');
                        $('.type-news').css('font-weight','normal');
                        $('.type-music').css('font-weight','normal');
                        typesearch = 'tag';
                    }
                }

                function urlencode( str ) {
    var histogram = {}, tmp_arr = [];
    var ret = str.toString();

    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };

    // The histogram is identical to the one in urldecode.
    histogram["'"]   = '%27';
    histogram['(']   = '%28';
    histogram[')']   = '%29';
    histogram['*']   = '%2A';
    histogram['~']   = '%7E';
    histogram['!']   = '%21';
    histogram['<']   = '%3C';
    histogram['<']   = '%3E';
    histogram['%20'] = '+';

    // Begin with encodeURIComponent, which most resembles PHP's encoding functions
    ret = encodeURIComponent(ret);

    for (search in histogram) {
        replace = histogram[search];
        ret = replacer(search, replace, ret) // Custom replace. No regexing
    }

    // Uppercase for full PHP compatibility
    return ret.replace(/(\%([a-z0-9]{2}))/g, function(full, m1, m2) {
        return "%"+m2.toUpperCase();
    });

    return ret;
}  
function confirmDelete() {
    if (confirm("Вы подтверждаете удаление?")) {
        return true;
    } else {
        return false;
    }
}
function location_url(url)
{
if(loc == 1)
{
location.href=url;
}
else
{
loc = 1;
}
}
function delete_blog_post(id)
{
if(confirmDelete())
{
$.get("http://beta.tooby.ru/blog/support&ajax=1&del="+id, function(data) {
  $("#post_"+id).hide();
});
}
loc = 0;
}