 $('.top-menu-l').ready(function(){
        jQuery("ul#menu-top li>a:first", this).css('border-left','none').css('padding-left','19px');
        jQuery("ul#menu-top li>a:last", this).css('border-right','none').css('padding-right','19px');
        $('.top-menu-l ul#menu-top>li').hover(
            function(){
                jQuery("ul", this).width(jQuery("a", this).width()+38).css('position', 'absolute').show();
            },
            function(){
                 jQuery("ul", this).hide();
            }
        )
    }
)
$('.news').ready(function(){
    if (!$('body').hasClass('single')){
        jQuery(".news-item:first", this).css('border-top','none').css('padding-top','2px').css('background','url(/wp-content/themes/aiesec/images/n1.gif) 100% 0 no-repeat');
        $('.news-item:first *').css('color','#E1E1E1');
        jQuery(".news-item:last", this).css('border-bottom','none').css('padding-bottom','2px').css('background','url(/wp-content/themes/aiesec/images/n2.gif) 100% 100% no-repeat');
    }
})

$('document').ready(function(){
    $("#nav-above").appendTo($(".news"));  
})

/*блок ajax загрузки новостей*/

if ($.browser.msie && $.browser.version == 6) {

}else{
$('#nav-above').ready(function(){    
    $('#nav-above .nav-previous a').attr('href',"javascript:get_post('"+$('#nav-above .nav-previous a').attr('href')+"')");
    $('#nav-above .nav-next a').attr('href',"javascript:get_post('"+$('#nav-above .nav-next a').attr('href')+"')");
})

function change_post(links,img,content){    
      $('#for_thumbnail').html(img);
      $('.post').html(content);      
      $('#nav-above').replaceWith(links);
      $('#nav-above img').hide();
      $('#nav-above .nav-previous a').attr('href',"javascript:get_post('"+$('#nav-above .nav-previous a').attr('href')+"')");
      $('#nav-above .nav-next a').attr('href',"javascript:get_post('"+$('#nav-above .nav-next a').attr('href')+"')");    
}

function get_post(path){    
    var img = -1;
    var content = -1;
    var links = -1;
    $('#nav-above img').show();
    $.get('/?path='+path+'&img', {},
    function(data){
        img = data;        
        if (links!= -1&&img!= -1&&content!= -1){
                change_post(links,img,content);
            }
    });
     $.get('/?path='+path+'&content', {},
        function(data2){
            content = data2;
            if (links!= -1&&img!= -1&&content!= -1){
                change_post(links,img,content);
            }
        });
    $.get('/?path='+path+'&links', {},
        function(data3){
            links = data3;
            if (links!= -1&&img!= -1&&content!= -1){
                change_post(links,img,content);
            }
        });
}

}
/*блок ajax загрузки новостей*/


