jQuery(function(){
$("a.link").toggle(function(){
    ids=$(this).attr("class").split(/\s+/)[0];
  
$("#"+ids).slideUp("slow");

$(this).html("&#8595; <b>Показать</b>")
$(this).parent().parent().parent().find(".bt_l").hide();
$(this).parent().parent().parent().find(".bt_r").hide();

},
function(){
    ids=$(this).attr("class").split(/\s+/)[0];
$("#"+ids).slideDown("slow");
$(this).html("&#8593; <b>Свернуть</b>")
$(this).parent().parent().parent().find(".bt_l").show();
$(this).parent().parent().parent().find(".bt_r").show();
}

)

$("#win1").click(function(){
    if($(this).hasClass("asr")){
        return false;
    $(".blockzi li").find("a").css("position","static");
    }
    else{
    $(this).addClass("asr");
    $("#win2").removeClass("asr");
    $(".win-2open").css("display","none");
    $(".win-1open").css("display","block");
   $(".blockzi li").find("a").css("position","static");
    }
    
})

$("#win2").click(function(){
      if($(this).hasClass("asr")){
        return false;
        $(".blockzi li").find("a").css("position","static");
    }
    else{
    $(this).addClass("asr");
    $("#win1").removeClass("asr")
    $(".win-2open").css("display","block");
    $(".win-1open").css("display","none");
     $(".blockzi li").find("a").css("position","static");
    
    }
})


$("a.ext_link").click( function(){
      ids=$(this).attr("class").split(/\s+/)[0];
    //window.alert($("#"+ids).css('display'));
    if (  $("#"+ids).css('display')!='none' ) {
       $(this).html(''+$(this).parent().find('.show').html());
       $("#"+ids).slideUp("slow");
    }
    else {
       $(this).html(''+$(this).parent().find('.hide').html());
       $("#"+ids).slideDown("slow");
    }
    //$("#"+ids).toggle("slow");
  }
)

/*$("a.ext_link").click( function(){
      ids=$(this).attr("class").split(/\s+/)[0];
    //window.alert($("#"+ids).css('display'));
    if ( $("#"+ids).css('display')!='none' )
      $(this).html(''+$(this).parent().find('.show').html());
    else
      $(this).html(''+$(this).parent().find('.hide').html());
    $("#"+ids).toggle("slow");
  }
)
/*
/*$("a.ext_link").toggle( function(){
      ids=$(this).attr("class").split(/\s+/)[0];
    $("#"+ids).hide("slow");
    $(this).html(''+$(this).parent().find('.show').html());
},
function(){
    ids=$(this).attr("class").split(/\s+/)[0];
    $("#"+ids).show("slow");
    $(this).html(''+$(this).parent().find('.hide').html());
}
)*/



})
