$(document).ready(function(){
     $('#slide_this').orbit({
         animation: 'fade',                  // fade, horizontal-slide, vertical-slide, horizontal-push
     animationSpeed: 1000,                // how fast animtions are
     timer: true, 			 // true or false to have the timer
     advanceSpeed: 6000, 		 // if timer is enabled, time between transitions 
     pauseOnHover: true, 		 // if you hover pauses the slider
     startClockOnMouseOut: true, 	 // if clock should start on MouseOut
     startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
     directionalNav: false, 		 // manual advancing directional navs
     captions: true, 			 // do you want captions?
     captionAnimation: 'fade', 		 // fade, slideOpen, none
     captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
     bullets: true,			 // true or false to activate the bullet navigation
     bulletThumbs: false,		 // thumbnails for the bullets
     bulletThumbLocation: '',		 // location from this file where thumbs will be
     afterSlideChange: function(){}
     });
     
     jqueryslidemenu.buildmenu("myslidemenu", arrowimages, 2);
     
//      $('.jcenter').each(function(){
//         
//         img_h=$(this).find('a').find('img').height();
//         pos=(48-img_h)/2;
//         $(this).find('a').find('img').css('top',pos);
//         $(this).find('a').find('img').css('position','relative');
//         $(this).find('a').find('img').css('margin-left','5px');
//     });





$('#vk_comments').hide();
$('#fb_comments').hide();


$('.fb_btn').click(function(){
    
    
    
    $('.fb_btn').removeClass('selected_tab');
    $('.fb_btn').removeClass('tab');
    $('.fb_btn').not(this).addClass('tab');
    $(this).addClass('selected_tab');
   
    
});

$('#cms_comm').click(function(){
    $('.cm_ajax_list').show();
    $('.cmm_heading').show();
    $('#addcommentlink').show();
    $('#fb_comments').hide();
    $('#vk_comments').hide();
    
});

$('#vk_comm').click(function(){

    $('#vk_comments').show();
    
    $('.cm_ajax_list').hide();
    $('.cmm_heading').hide();
    $('#addcommentlink').hide();
    $('#fb_comments').hide();
    
});

$('#fb_comm').click(function(){

    $('#fb_comments').show();
    
    $('.cm_ajax_list').hide();
    $('.cmm_heading').hide();
    $('#addcommentlink').hide();
    $('#vk_comments').hide();
    
});



});

function del_item(id, title){
    if (confirm('Вы действительно хотите удалить компанию '+title+'?')){
        location.replace("/catalog/moderation/reject"+id+".html");
    }
}

function addcompany(){
    var id=$("#cats option:selected").val();
    location.replace("/catalog/"+id+"/add.html");
}
