$(document).ready(function(){

 // $(".hdtext p").hide("fast");
  $(".hdtext p").css("display","none");
  $(".hdtext u").css("cursor","pointer");
  $(".hdtext u.blockHide").css("display","none");
  $("#chet_uinf").css("display","none");

  $("u.blockShow").click(
  function(){
    $(this).next("p.block").show("fast");
    $(this).hide("fast");
    $(this).next("p.block").next("u.blockHide").show("fast");
   }
  );

  $("u.blockHide").click(
  function(){
    $(this).prev("p.block").hide("fast");
    $(this).hide("fast");
    $(this).prev("p.block").prev("u.blockShow").show("fast");
   }
  );

  $(".blocks span").click(function(){
    $(this).next("p").slideToggle("slow").siblings("p:visible").slideUp("slow");
    $(this).toggleClass("active");
    $(this).siblings("span").removeClass("active");
  });

  i=0;
  $("#chet").click(
  function(){
    if (i==0) {
      $("#chet_uinf").show("fast");
      i=1;
    } else {
      $("#chet_uinf").hide();
      i=0;
    }
   }
  );
    	for(var i = 0; i < $("H3").length; i++) {
           $("H3:eq("+i+")").replaceWith("<div class=blkTitleH3Container><div class=blkTitleH3Left></div><div class=blkTitleH3Bg><h3>" + $("H3:eq("+i+")").text() + "</h3></div><div class=blkTitleH3Right></div></div>");
}

  $("#showBasket").click(function(){
      $('.containerPlus').mb_open("/basket.php?hash={rand_md5}");
      $('.containerPlus').mb_centerOnWindow(true);
  });

  $("DIV#blockElement").hover(
    function () {
        $(this).children(".d2").fadeOut(200);
    },
    function () {
        $(this).children(".d2").fadeIn(200);
    }
  );

    var arrayUri = new Array(
    '/tractors.html',
    '/navesnoe_oborudovanie.html',
    '/protivopozharnoe_oborudovanie.html',
    '/pricepnoe_oborudovanie.html'
    );

    $("DIV#blockElement").click(function () {
      ind = $("DIV#blockElement").index(this);
      document.location.href=arrayUri[ind];
    });

});

