/* javascript */
/* �������� ��� �������� ������ float �������*/
function setEqualHeight(columns)
 {
 var tallestcolumn = 0;
 columns.each(
    function()
     {
     currentHeight = jQuery(this).height();
     if(currentHeight > tallestcolumn) { tallestcolumn  = currentHeight; }
     }
 );
 columns.height(tallestcolumn);
 }

jQuery(document).ready(function() {
 setEqualHeight(jQuery(".halfblocks  .content"));
 setEqualHeight(jQuery(".block .col"));
});
/* /�������� ��� �������� ������ float �������*/


/* �������� ��� ������� ����������*/
function hmenu1() {
  jQuery(this).children('ul').slideToggle(300);
}

function keyblocktoggle() {
  jQuery(this).siblings('ul').slideToggle();
}

jQuery(document).ready(function() {
  jQuery('#footer .main-menu>ul>li').hover(hmenu1);
  jQuery('#footer .main-menu>ul>li>ul').hide();
  jQuery('#keywords ul').hide();
  jQuery('#keywords .btitle').click(keyblocktoggle);
});


/* /�������� ��� ������� ����������*/


/* �������� ��� accord*/
var openedaccord;

jQuery(document).ready(function() {
  jQuery('#accord .btitle').click(mapacord);
  jQuery('#accord .btitle').next('p').hide();
  openedaccord=jQuery('#accord .bheader').next('p').show();
});

function mapacord () {
  jQuery(openedaccord).slideUp();
  openedaccord=(jQuery(this).next('p'));
  jQuery(openedaccord).slideDown();
}


/* /�������� ��� accord*/

var oldnabor;

jQuery(document).ready(function() {
  jQuery('#left .btitle').click(blockslide);
  jQuery('#right .btitle').click(blockslide);
  jQuery('#right .closed').each(function (n) {jQuery(this).attr('oldh',jQuery(this).height()).css({height: '1px', paddingTop: '11px'})});
  oldnabor=jQuery('#right .accord1:first').animate({height: (jQuery('#right .accord1:first').attr('oldh')), paddingTop: '30px'},'fast').toggleClass('closed');
});



function blockslide() {
  var nabor=jQuery(this).parent('.content');
  if (jQuery(nabor).is('.closed')) {
    if (jQuery(nabor).is('.accord1')) {jQuery(oldnabor).attr('oldh',jQuery(oldnabor).height()); jQuery(oldnabor).animate({height: '1px', paddingTop: '11px'},'slow').toggleClass('closed');  oldnabor=jQuery(nabor).animate({height: (jQuery(nabor).attr('oldh')), paddingTop: '30px'},'slow').toggleClass('closed');
    } else {
        jQuery(nabor).animate({height: (jQuery(nabor).attr('oldh')), paddingTop: '30px'},'slow').toggleClass('closed');
    }
}
else {
  if (jQuery(nabor).is('.accord1')) {return} else {
  jQuery(nabor).attr('oldh',jQuery(nabor).height());
  jQuery(nabor).animate({height: '1px', paddingTop: '11px'},'slow').toggleClass('closed');}
  }

}




/* �������� ��� tab*/
jQuery(document).ready(function() {
    jQuery(".tabs a.tab1").click(acttab1);
    jQuery(".tabs a.tab2").click(acttab2);
    jQuery(".tabs a.tab3").click(acttab3);
	jQuery(".tabs a.tab4").click(acttab4);
    jQuery("div.tab2").hide();
    jQuery("div.tab3").hide();
	jQuery("div.tab4").hide();

    jQuery(".tabsf a.tabf1").click(acttabf1);
    jQuery(".tabsf a.tabf2").click(acttabf2);
    jQuery(".tabsf a.tabf3").click(acttabf3);
	jQuery(".tabsf a.tabf4").click(acttabf4);
    jQuery("div.tabf2").hide();
    jQuery("div.tabf3").hide();
	jQuery("div.tabf4").hide();
});

function acttab1() {
    jQuery("div.tab1").show();
    jQuery("div.tab2").hide();
    jQuery("div.tab3").hide();
	jQuery("div.tab4").hide();
    return(false);
}

function acttab2() {
    jQuery("div.tab2").show();
    jQuery("div.tab1").hide();
    jQuery("div.tab3").hide();
	jQuery("div.tab4").hide();
    return(false);
}

function acttab3() {
    jQuery("div.tab3").show();
    jQuery("div.tab1").hide();
    jQuery("div.tab2").hide();
	jQuery("div.tab4").hide();
    return(false);
}
function acttab4() {
    jQuery("div.tab4").show();
    jQuery("div.tab1").hide();
    jQuery("div.tab2").hide();
	jQuery("div.tab3").hide();
    return(false);
}

function acttabf1() {
    jQuery("div.tabf1").show();
    jQuery("div.tabf2").hide();
    jQuery("div.tabf3").hide();
	jQuery("div.tabf4").hide();
    return(false);
}

function acttabf2() {
    jQuery("div.tabf2").show();
    jQuery("div.tabf1").hide();
    jQuery("div.tabf3").hide();
	jQuery("div.tabf4").hide();
    return(false);
}

function acttabf3() {
    jQuery("div.tabf3").show();
    jQuery("div.tabf1").hide();
    jQuery("div.tabf2").hide();
	jQuery("div.tabf4").hide();
    return(false);
}
function acttabf4() {
    jQuery("div.tabf4").show();
    jQuery("div.tabf1").hide();
    jQuery("div.tabf2").hide();
	jQuery("div.tabf3").hide();
    return(false);
}
/* /�������� ��� tab*/



