function slidethumbsdown(){
	if(currentmargin<0){
		if(! $('.thumbs .overflow').hasClass('animated')){
				 $('.thumbs .overflow').addClass('animated');
				 currentmargin=currentmargin+oneitem;
				  $('.thumbs .overflow').animate({
    'margin-top': '+='+oneitem
  }, 800, function() {
  	 $('.thumbs .overflow').removeClass('animated');
  });
				 }	
	} else {
		if(! $('.thumbs .overflow').hasClass('animated')){
			currentmargin=minmargin;
				 $('.thumbs .overflow').addClass('animated');
				 $('.thumbs .overflow').animate({
    'margin-top': minmargin
  }, 800, function() {
  	 $('.thumbs .overflow').removeClass('animated');
  });
				 
				}
		
	}
}
function slidethumbsup(){

	if(currentmargin>minmargin){
			if(! $('.thumbs .overflow').hasClass('animated')){
				 $('.thumbs .overflow').addClass('animated');
		currentmargin=currentmargin-oneitem;
		 $('.thumbs .overflow').animate({
    'margin-top': '-='+oneitem
  }, 800, function() {
  	 $('.thumbs .overflow').removeClass('animated');
  });
  }
	} else {
			if(! $('.thumbs .overflow').hasClass('animated')){
				 $('.thumbs .overflow').addClass('animated');
		currentmargin=0;
		$('.thumbs .overflow').animate({
    'margin-top': 0
  }, 800, function() {
  	 $('.thumbs .overflow').removeClass('animated');
  });
	}}
}
function setactiveslide(num){
	$('.pics-slide .thumbs .tmb').each(function() {
	 $(this).removeClass('active');
	
	});
	 $('.pics-slide .thumbs .tmb'+num).addClass('active'); 
}
$(document).ready(function() {
	window.minimum=0;
	$('.all-tabs .hiddencat').each(function() {
	var minheight=$(this).height();
	if(minheight>window.minimum) window.minimum=minheight;
	  
	});
	$('.all-tabs .hiddencat').css('min-height',(parseInt(window.minimum)+5)+"px");
	
	window.minimumhome=0;
		$('.tours .tour-cont').each(function() {
	var minheight=$(this).height();
	if(minheight>window.minimumhome) window.minimumhome=minheight;
	  
	});
	$('.tours .tour-cont').css('min-height',parseInt(window.minimumhome)+5+"px");
	 $(".tabs .heading span").corner("top 3px");
	 $('.formo input,.textwidget .formo textarea').focus(function(){
     if($(this).val()==$(this).attr("title")) $(this).attr("value","");
    }).focusout(function(){
       if($(this).attr("value")=='') $(this).attr("value",$(this).attr("title"));
    });
	$(".pics-slide .thumbs .tmb").hover(
  function () {
  	if(!$(".pics-slide .thumbs").hasClass('animated')){
  		$(this).addClass('hover');
  		$(".pics-slide .thumbs").addClass('animated');
  		$(".pics-slide .thumbs").addClass('mover');
    var active=$(this).attr("role");
    setactiveslide(active);
    $('.imgslides').css('z-index','3');
    $('.imgslides.slide'+active).css('z-index','999');
    $(".pics-slide .thumbs").removeClass('mover');
    $('.imgslides.slide'+active).animate({
    top: 0
  }, 800, function() {
  	 $(".pics-slide .thumbs").removeClass('animated');
  	 $(this).removeClass('hover');
     $('.imgslides').each(function() {
       if(!$(this).hasClass('slide'+active))
       		$(this).css('top','300px');
     });
  });
 
  }
  }, 
  function () {
  
  }
);

	$('.topmenu ul ul').each(function() {
	  $(this).wrap('<div class="dropmenu">')
	});
	$('.topmenu .en,.topmenu .ru').click(function() {
 var href=$(this).find('a').attr("href");
 window.location=href;
});
	$('.sidemenu ul li:first').css('border','none');
	window.sizes=new Array;
	window.sizes[0]=24;
	window.sizes[1]=16;
	window.sizes[2]=11;
	window.sizes[3]=32;
	window.counter=0;
	$('.linkgroup.tags a').each(function() {
	$(this).css('font-size',window.sizes[window.counter%4]+"px");
	window.counter++;
	});
});
$(window).ready(function() {
	$('.fbpage').css('visibility','visible');
});
function settab(num){
	$('.tabs .heading span').each(function() {
	  $(this).removeClass('active');
	});
	$('.tabs .heading .tab'+num).addClass('active');
	$('.tabs .hiddencat').css('display','none');
	$('.tabs .hiddencat.cat'+num).css('display','block');
}


