DivDlgParam = MakeDlgParam (600, 480)
DocDlgParam = MakeDlgParam (400, 320)

if (window.screen.height == 600)
{
  DivInfDlgParam = MakeDlgParam (730, 490)
  DivInfEditHeight = 280
}
else
{
  DivInfDlgParam = MakeDlgParam (730, 600)
  DivInfEditHeight = 390
}

// ==============================================
//  Действия с документами подразделений
// ==============================================

function DivDocAdd (IdDiv, IdPart, IdSpr, IdType)
{
  window.open ("/admin/dlg/docs.asp?Act=Add&IdPart=" + IdPart + "&IdType=" + IdType + "&IdItem=" + IdDiv + "&IdSpr=" + IdSpr, "", DocDlgParam)
}

function DivDocEdit (IdDoc, IdPart, IdSpr)
{
  window.open ("/admin/dlg/docs.asp?Act=Edit&IdPart=" + IdPart + "&IdSpr=" + IdSpr + "&IdDoc=" + IdDoc, "", DocDlgParam)
}

function DivDocDel (IdDoc, IdPart, IdType, Id, newsPage)
{
  if (window.confirm ("Видалити документ ?"))
    window.location = "/_divdocact.asp?Act=DivDocDel&Id=" + Id + "&IdDoc=" + IdDoc + "&IdPart=" + IdPart + "&IdType=" + IdType + "&newsPage=" + newsPage
}

function DivDocUp (IdDoc, IdPart, IdType, Id, newsPage)
{
  window.location = "/_divdocact.asp?Act=DivDocUp&Id=" + Id + "&IdDoc=" + IdDoc  + "&IdPart=" + IdPart + "&IdType=" + IdType + "&newsPage=" + newsPage
}

function DivDocDown (IdDoc, IdPart, IdType, Id, newsPage)
{
  window.location = "/_divdocact.asp?Act=DivDocDown&Id=" + Id + "&IdDoc=" + IdDoc + "&IdPart=" + IdPart + "&IdType=" + IdType + "&newsPage=" + newsPage
}

function AdmDivDocWrite (IdDoc, IdPart, IdType, Id, newsPage, IdSpr)
{
  document.write ("<SPAN>")
  document.write ("<A HREF='JavaScript:DivDocEdit(" + IdDoc + "," + IdPart + "," + IdSpr + ")'><IMG SRC='/images/edit.gif' WIDTH=12 HEIGHT=12 BORDER=0></A> ")
  document.write ("<A HREF='JavaScript:DivDocDel(" + IdDoc + "," + IdPart + "," + IdType + "," + Id + "," + newsPage + ")'><IMG SRC='/images/del.gif' WIDTH=12 HEIGHT=12 BORDER=0></A> ")
  document.write ("<A HREF='JavaScript:DivDocUp(" + IdDoc + "," + IdPart + "," + IdType + "," + Id + "," + newsPage + ")'><IMG SRC='/images/up.gif' WIDTH=12 HEIGHT=12 BORDER=0></A>")
  document.write ("<A HREF='JavaScript:DivDocDown(" + IdDoc + "," + IdPart + "," + IdType + "," + Id + "," + newsPage + ")'><IMG SRC='/images/down.gif' WIDTH=12 HEIGHT=12 BORDER=0></A> ")
  document.write ("</SPAN>")
}
