function AddBidDocs(n,t,i,r,u){if(n!=undefined&&n[t]!=undefined){elsd=n[t];for(var f=0;f<elsd.length;f++)cdb!=3||r&&elsd[f]._ds_scope!="public"&&elsd[f]._ds_scope!="private"?cdb==2&&(elsd[f].container=i,_docs.push(elsd[f])):(elsd[f]._ds_scope!="private"||strStartsWith(elsd[f].url,"DataHandler.ashx")||(elsd[f].url=r?'javascript:alert("Приватні документи доступні для перегляду тільки учаснику, який їх завантажував, та організатору аукціону")':"DataHandler.ashx?CommandName=GetBidDoc&id="+idForm+"&id_bid="+n.id+"&id_doc="+(u?elsd[f].id:elsd[f]._ds_id)),elsd[f].container=i,_docs.push(elsd[f]))}}function get_all_bid_doc(n,t,i){return _docs=[],AddBidDocs(n,"documents","documents",t,i),_docs}function get_bid_doc(n){var t,i;let r="",u=!1;for(t=0;t<bids.length;t++)if(bids[t].id==n){r=bids[t];break}if(full_data.bids!=undefined)for(i=0;i<full_data.bids.length;i++)if(full_data.bids[i].id==n){own_bid_award=full_data.bids[i];u=!0;break}_docs=[];AddBidDocs(r,"documents","documents",!(isOwn||u||user_type==4005&&!1));bid_doc_list=get_bid_doc_list();showDocList("bid_doc",bid_doc_list,"bid",n,_docs)}function showDocList(n,t,i,r,u){Need_dgFileList&&($("#dgFileList").dialog({resizable:!1,height:400,width:700,modal:!0,autoOpen:!1,buttons:{"Закрити":function(){dialog_close=undefined;$(this).dialog("close")}}}),Need_dgFileList=!1);$("#pn_doc_list").html("");u.length>0?((_pn_doc_place=$("#pn_doc_list")).append(get_document_container(n)),ShowDocumentsRecords(n,_pn_doc_place,t,i,r,u,!0),$("#pn_doc_list_empty").hide()):$("#pn_doc_list_empty").show();cdb==3&&$(".deleted_document",$("#dgFileList")).show().click(function(){exp_documents_list=t;exp_documentOf=i;exp_relatedItem=r;jQuery.post("DataHandler.ashx?CN="+vCN+"&CommandName=jGetDocumentsHistory","&id="+(exp_documentOf=="milestone"?id_contract:idForm)+"&documentOf="+i+"&relatedItem="+r,HandleDocsHistory)});$("#dgFileList").modal("show")}function get_bid_doc_list(){return bid_doc_list=tenderType=="renewables"?"bid_renewables":cdb==3&&tenderType=="timber"?"bid_timber":tenderType.includes("smallPrivatization")?"smallPrivatization_bid":tenderType.includes("largePrivatization")?"largePrivatization_bid":tenderType.includes("legitimatePropertyLease")?"legitimatePropertyLease_bid":tenderType.includes("landSell")||tenderType.includes("landRental")?"landRental_bid":tenderType.includes("landArrested")?"landArrested_bid":tenderType.includes("bankRuptcy")?"bankRuptcy_bid":tenderType.includes("basicSell")?"basicSell_bid":tenderType.includes("simpleSell")?"simpleSell_bid":tenderType.includes("nonperformingLoans")?"nonperformingLoans_bid":tenderType.includes("alienation")?"alienation_bid":tenderType.includes("commercialSell")?"commercialSell_bid":tenderType.includes("regulationsPropertyLease")?"regulationsPropertyLease_bid":tenderType.includes("commercialPropertyLease")?"commercialPropertyLease_bid":tenderType.includes("railwayCargo")?"bid_railwayCargo":tenderType.includes("dgf")?"bid_dgf":cdb==3&&tenderType=="nadra"?"bid_nadra":tenderType=="rent"?can_doc_on_award?"bid_other_on_award":"bid_rent":cdb==2?PMT=="appraisal.insider"||is_privatization?"bid_ssp":"bid_cdb2":can_doc_on_award?PMT=="dgfFinancialAssets"||PMT=="dgfInsider"?"bid_financial_on_award":"bid_other_on_award":"bid_financial"}var _docs=[],can_doc_on_award=!1,can_protocol=!1