<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:opz="http://www.sta.gov.ua">
	<msxsl:script language="JScript" implements-prefix="opz"><![CDATA[
function ConvertDate(Indate)
{var strDate= Indate.item(0).text;
 if (strDate!="")
 return strDate.substr(0,2)+"."+strDate.substr(2,2)+"."+strDate.substr(4,4);
 else 
 return "";}


  function ExecRegExpr(node) {
     RegE=/\d{1,6}/;
     str=""+node.item(0).text;
     ret=RegE.exec(str);
     return ret[0];
      }

function translatePeriod(period_type,period_month,period_year)
       {outputString="";
        pTypeArray=new Array("","квартал","півріччя","9 місяців","рік");
        pMonthArray=new Array("","січень","лютий","березень","квітень","травень","червень",
        "липень","серпень","вересень","жовтень","листопад","грудень");
        ptVal=period_type.nextNode().text;
		if (ptVal=="")
			ptVal=0;
        pType=1*ptVal;
        pMonth=1*period_month.nextNode().text;
        pYear=1*period_year.nextNode().text;

        
        outputString+="звітний період:   <font color='maroon'>";
        
      switch (pType)
        {  
           case 1:
            outputString+="   "+pMonthArray[pMonth];
            
            break;
         
           case 2:
            outputString+="   "+pMonth/3 ;
            break;
			
			case 0:
			 outputString+="   "+pMonthArray[pMonth];
			break;
         }
		if (pType>0) 
			outputString+=pTypeArray[pType-1];
        outputString+="   "+pYear+"</font>";
        return outputString;        
       }]]></msxsl:script>
	<xsl:param name="reg"/>
	<xsl:param name="cSSCU"/>
	<xsl:param name="cDoc"/>
	<xsl:param name="cDocSub"/>
	<xsl:param name="cDocVer"/>
	<xsl:param name="pTypeLetter"/>
	<xsl:param name="WBegin"/>
	<xsl:param name="WEnd"/>
	<xsl:param name="sprType"/>
	<xsl:param name="isReestr"/>
	<xsl:param name="Tin"/>
	<xsl:param name="filter"/>
	<xsl:output method="html" version="4.0" encoding="windows-1251" indent="yes"/>
	<!-- Перегляд довідника документів-->
	<xsl:template match="/" mode="SPR_DOC">
		<div style="width:100%;text-align:right;border:0px solid navy;">
			<input value="Зберегти зміни" type="button" onclick="SaveSprDoc();"/>
		</div>
		<div style="border-style:groove;border-width:0;overflow:auto; position:absolute;left:0;    
			height:expression(document.body.clientHeight-this.getClientRects().item(0).top);
			width:expression(document.body.clientWidth);" id="MainTable">
			<ul style="font-weight:bold;" id="SprDoc">
				<li class="topLevelO" onclick="ListManage()">
					<input type="checkbox" id="Select" ondblclick="changeCheckStatus(this)" onclick="changeChildrenStatus(this)" title="Обрати всі документи"/>
					<span style="font-weight:bold;color:maroon">Документи податкової звітності</span>
					<xsl:variable name="GroupID">DPS</xsl:variable>
					<xsl:call-template name="docGroup">
						<xsl:with-param name="GroupID" select="$GroupID"/>
						<xsl:with-param name="pTypeLetter" select="$pTypeLetter"/>
					</xsl:call-template>
				</li>
				<li class="topLevelO" onclick="ListManage()">
					<input type="checkbox" id="Select" ondblclick="changeCheckStatus(this)" onclick="changeChildrenStatus(this)" title="Обрати всі документи"/>
					<span style="font-weight:bold;color:maroon">Документи Міністерства статистики</span>
					<xsl:variable name="GroupID">STAT</xsl:variable>
					<xsl:variable name="pLetter">S</xsl:variable>
					<xsl:call-template name="docGroup">
						<xsl:with-param name="GroupID" select="$GroupID"/>
						<xsl:with-param name="pTypeLetter" select="$pLetter"/>
					</xsl:call-template>
				</li>
				<li class="topLevelO" onclick="ListManage()">
					<input type="checkbox" id="Select" ondblclick="changeCheckStatus(this)" onclick="changeChildrenStatus(this)" title="Обрати всі документи"/>
					<span style="font-weight:bold;color:maroon">Документи Пенсійного фонду України</span>
					<xsl:variable name="GroupID">PFU</xsl:variable>
					<xsl:variable name="pLetter">E</xsl:variable>
					<xsl:call-template name="docGroup">
						<xsl:with-param name="GroupID" select="$GroupID"/>
						<xsl:with-param name="pTypeLetter" select="$pLetter"/>
					</xsl:call-template>
				</li>
			</ul>
		</div>
	</xsl:template>
	<!--Група документів-->
	<xsl:template name="docGroup">
		<xsl:param name="GroupID"/>
		<xsl:param name="pTypeLetter"/>
		<ul class="topLevelC" style="display:block;">
			<xsl:for-each select="//ROWSET/ALLGROUPS/GROUPSET[@id=$GroupID]/GROUP">
				<xsl:sort select="C_DOC"/>
				<xsl:variable name="grDoc">
					<xsl:value-of select="C_DOC"/>
				</xsl:variable>
				<li style="font-face:Courier New;color:navy;">
					<xsl:choose>
						<xsl:when test="count(//ROWSET/ROW[C_DOC=concat($pTypeLetter,$grDoc)])!=0">
							<xsl:attribute name="class">topLevelC</xsl:attribute>
							<xsl:attribute name="onclick">ListManage()</xsl:attribute>
						</xsl:when>
						<xsl:otherwise>
							<xsl:attribute name="class">lastDocLevel</xsl:attribute>
						</xsl:otherwise>
					</xsl:choose>
					<span style="font-weight:bold;color:maroon">
						<xsl:value-of select="C_DOC"/>
					</span>
					<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
					<xsl:value-of select="NAME"/>
					<ul>
						<xsl:for-each select="//ROWSET/ROW[substring(C_DOC,1,1)=$pTypeLetter ][ not (PARENT_DOC/PARENT_C_DOC) or PARENT_DOC/PARENT_C_DOC=''][C_DOC=concat($pTypeLetter,$grDoc) ]">
							<xsl:sort select="C_DOC"/>
							<xsl:sort select="C_DOC_SUB"/>
							<xsl:variable name="cDoc">
								<xsl:value-of select="C_DOC"/>
							</xsl:variable>
							<xsl:variable name="cDocSub">
								<xsl:value-of select="C_DOC_SUB"/>
							</xsl:variable>
							<li style="font-face:Courier New;color:navy;">
								<xsl:choose>
									<xsl:when test="count(//ROWSET/ROW/PARENT_DOC[PARENT_C_DOC=$cDoc and PARENT_C_DOC_SUB=$cDocSub ])!=0">
										<xsl:attribute name="class">topLevelC</xsl:attribute>
										<xsl:attribute name="onclick">ListManage()</xsl:attribute>
									</xsl:when>
									<xsl:otherwise>
										<xsl:attribute name="class">lastLevel</xsl:attribute>
									</xsl:otherwise>
								</xsl:choose>
								<input type="checkbox" id="Select" ondblclick="changeCheckStatus(this)" title="Обрати для роботи">
									<xsl:choose>
										<xsl:when test="//PERSONSET/ROW[C_DOC=$cDoc and C_DOC_SUB=$cDocSub]/SELECTED='true'">
											<xsl:attribute name="CHECKED">true</xsl:attribute>
										</xsl:when>
									</xsl:choose>
									<xsl:if test="count(//ROWSET/ROW/PARENT_DOC[PARENT_C_DOC=$cDoc and PARENT_C_DOC_SUB=$cDocSub ])!=0">
										<xsl:attribute name="onclick">changeChildrenStatus(this)</xsl:attribute>
									</xsl:if>
								</input>
								<span style="font-weight:bold;color:maroon" id="C_DOC">
									<xsl:value-of select="C_DOC"/>
								</span>
								<span style="font-weight:bold;color:maroon" id="C_DOC_SUB">
									<xsl:value-of select="C_DOC_SUB"/>
								</span>
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="NAME"/>
								<ul>
									<xsl:for-each select="//ROWSET/ROW[PARENT_DOC/PARENT_C_DOC=$cDoc and PARENT_DOC/PARENT_C_DOC_SUB=$cDocSub ]">
										<xsl:variable name="curCDoc" select="C_DOC"/>
										<xsl:variable name="curCDocSub" select="C_DOC_SUB"/>
										<li class="lastDocLevel" style="valign:top;">
											<input type="checkbox" id="Select" ondblclick="changeCheckStatus(this)" title="Обрати для роботи">
												<xsl:choose>
													<xsl:when test="//PERSONSET/ROW[C_DOC=$curCDoc and C_DOC_SUB=$curCDocSub]/SELECTED='true'">
														<xsl:attribute name="CHECKED">true</xsl:attribute>
													</xsl:when>
												</xsl:choose>
												<xsl:attribute name="C_DOC"><xsl:value-of select="$cDoc"/></xsl:attribute>
												<xsl:attribute name="C_DOC_SUB"><xsl:value-of select="$cDocSub"/></xsl:attribute>
											</input>
											<span style="font-weight:bold;color:maroon" id="C_DOC">
												<xsl:value-of select="C_DOC"/>
											</span>
											<span style="font-weight:bold;color:maroon" id="C_DOC_SUB">
												<xsl:value-of select="C_DOC_SUB"/>
											</span>
											<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
											<span style="color:navy;">
												<xsl:value-of select="NAME"/>
											</span>
										</li>
									</xsl:for-each>
								</ul>
							</li>
						</xsl:for-each>
					</ul>
				</li>
			</xsl:for-each>
		</ul>
	</xsl:template>
	<!--Перегляд довідника версій документів -->
	<xsl:template match="/" mode="SPR_VER">
		<xml id="AllDocs" src="spr_doc.xml"/>
		<xml id="AllDocTerms" src="spr_ver.xml"/>
		<div id="DivDoc" style="border:1px solid navy;">
			<select id="SDoc" onactivate="SDoc_fill()" onchange="TermTableFill()"/>
		</div>
		<div style="border-style:groove;border-width:0;overflow:auto; position:absolute;left:0;   top:expression:(document.getElementById('DivDoc').getClientRects().item(0).top+document.getElementById('DReg').clientHeight+3);
			height:expression(document.body.clientHeight-this.getClientRects().item(0).top);
			width:expression(document.body.clientWidth);" id="MainTable">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="TermTable">
				<thead>
					<tr style="position:relative; top: expression(document.getElementById('MainTable').scrollTop-1);">
						<th>Тип документа </th>
						<th>Підтип документа</th>
						<th>Номер версії документа</th>
						<th>Звітний період початку дії версії</th>
						<th>Звітний період закінчення дії версії</th>
						<th>Дата початку створення версії</th>
						<th>Дата закінчення створення версії</th>
						<th>Нормативний документ (набуття чинності)</th>
						<th>Нормативний документ (втрата чинності)</th>
					</tr>
				</thead>
				<tbody>
		</tbody>
			</table>
		</div>
	</xsl:template>
	<!--Перегляд термінів подачі документів -->
	<xsl:template match="/" mode="SPR_TERM">
		<xml id="AllDocs" src="spr_doc.xml"/>
		<xml id="AllDocTerms" src="spr_term.xml"/>
		<div id="DivDoc" style="border:1px solid navy;">
			<select id="SDoc" onactivate="SDoc_fill()" onchange="TermTableFill()"/>
		</div>
		<div style="border-style:groove;border-width:0;overflow:auto; position:absolute;left:0;   top:expression:(document.getElementById('DivDoc').getClientRects().item(0).top+document.getElementById('DReg').clientHeight+3);
			height:expression(document.body.clientHeight-this.getClientRects().item(0).top);
			width:expression(document.body.clientWidth);" id="MainTable">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="TermTable">
				<thead>
					<tr style="position:relative; top: expression(document.getElementById('MainTable').scrollTop-1);">
						<th>Тип документа </th>
						<th>Підтип документа</th>
						<th>Номер версії документа</th>
						<th>Термін подачі документа</th>
						<th>Звітний місяць</th>
						<th>Тип періоду</th>
						<th>Звітний рік</th>
					</tr>
				</thead>
				<tbody>
		</tbody>
			</table>
		</div>
	</xsl:template>
	<!--Перегляд довідника ДПІ -->
	<xsl:template match="/" mode="SPR_STI">
		<div id="DReg">
			<select onchange="ChangeView()" id="SReg">
				<xsl:for-each select="//ROW">
					<option>
						<xsl:choose>
							<xsl:when test="C_REG=$reg">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:when>
						</xsl:choose>
						<xsl:attribute name="value"><xsl:value-of select="C_REG"/></xsl:attribute>
						<xsl:value-of select="C_REG"/>
						<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
						<xsl:value-of select="NAME_REG"/>
					</option>
				</xsl:for-each>
			</select>
		</div>
		<div style="border-style:groove;border-width:0;overflow:auto; position:absolute;left:0; top:expression:(document.getElementById('DREg').getClientRects().item(0).top+document.getElementById('DReg').clientHeight+3);
			height:expression(document.body.clientHeight-this.getClientRects().item(0).top);
			width:expression(document.body.clientWidth);" id="StiTable">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="SetSti">
				<thead>
					<tr style="position:relative; top: expression(document.getElementById('StiTable').scrollTop-1);">
						<th>Код інспекції </th>
						<th>Код району </th>
						<th>Назва ДПІ</th>
						<th>Назва району</th>
						<th>Код ЄДРПОУ</th>
					</tr>
				</thead>
				<tbody>
					<xsl:for-each select="//ROW_STI">
						<xsl:sort order="ascending" select="C_STI" data-type="number"/>
						<xsl:sort order="ascending" select="C_RAJ" data-type="number"/>
						<tr>
							<xsl:attribute name="id"><xsl:value-of select="ancestor::*/C_REG"/></xsl:attribute>
							<xsl:attribute name="style"><xsl:choose><xsl:when test="ancestor::*/C_REG=$reg">display:block;</xsl:when><xsl:otherwise>display:none;</xsl:otherwise></xsl:choose>>
			   </xsl:attribute>
							<td align="right">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="C_STI"/>
							</td>
							<td align="right">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="C_RAJ"/>
							</td>
							<td align="left">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="NAME_STI"/>
							</td>
							<td align="left">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="NAME_RAJ"/>
							</td>
							<td align="left">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="TIN_STI"/>
							</td>
						</tr>
					</xsl:for-each>
				</tbody>
			</table>
		</div>
	</xsl:template>
	<!--Перегляд довідника управлінь статистики -->
	<xsl:template match="/" mode="SPR_SSCU">
		<div id="DReg">
			<select onchange="ChangeView()" id="SReg">
				<xsl:for-each select="//ROW">
					<option>
						<xsl:if test="C_REG=$cSSCU">
							<xsl:attribute name="SELECTED">true</xsl:attribute>
						</xsl:if>
						<xsl:choose>
							<xsl:when test="C_REG=$reg">
								<xsl:attribute name="selected">true</xsl:attribute>
							</xsl:when>
						</xsl:choose>
						<xsl:attribute name="value"><xsl:value-of select="C_REG"/></xsl:attribute>
						<xsl:value-of select="C_REG"/>
						<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
						<xsl:value-of select="NAME_REG"/>
					</option>
				</xsl:for-each>
			</select>
		</div>
		<div style="border-style:groove;border-width:0;overflow:auto; position:absolute;left:0; top:expression:(document.getElementById('DREg').getClientRects().item(0).top+document.getElementById('DReg').clientHeight+3);
			height:expression(document.body.clientHeight-this.getClientRects().item(0).top);
			width:expression(document.body.clientWidth-10);" id="StiTable">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="SetSti">
				<thead>
					<tr style="position:relative; top: expression(document.getElementById('StiTable').scrollTop-1);">
						<th>Код управління статистики</th>
						<th>Повний код </th>
						<th>Назва</th>
						<th>Дата початку дії </th>
						<th>Дата закінчення дії </th>
					</tr>
				</thead>
				<tbody>
					<xsl:for-each select="//ROW_DEP">
						<xsl:sort order="ascending" select="C_DEP" data-type="number"/>
						<tr>
							<xsl:attribute name="id"><xsl:value-of select="ancestor::*/C_REG"/></xsl:attribute>
							<xsl:attribute name="style"><xsl:choose><xsl:when test="ancestor::*/C_REG=$cSSCU">display:block;</xsl:when><xsl:otherwise>display:none;</xsl:otherwise></xsl:choose>>
			   </xsl:attribute>
							<td align="right">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="C_DEP"/>
							</td>
							<td align="right">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="FULL_CODE"/>
							</td>
							<td align="left">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select="NAME_DEP"/>
							</td>
							<td align="center">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select=" opz:ConvertDate(D_BEGIN)"/>
							</td>
							<td align="center">
								<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
								<xsl:value-of select=" opz:ConvertDate(D_END)"/>
							</td>
						</tr>
					</xsl:for-each>
				</tbody>
			</table>
		</div>
	</xsl:template>
	<!-- Перегляд персональних параметрів -->
	<xsl:template match="/" mode="SETTINGS">
		<div style="height:100%; width:100%; text-align:center; vertical-align:middle; padding:2" id="SetDiv">
			<table cellpadding="0" cellspacing="0" style="height:100%; width:100%">
				<tr>
					<td style="width:20%;border-left:2px solid navy;border-top:2px solid navy;	border-bottom:2px solid navy;">
						<div style="height:95%; overflow:auto;font-family:Verdana;">
							<table width="100%" cellspacing="0" id="personList">
								<xsl:for-each select="//ROW">
									<xsl:sort data-type="number" select="TIN"/>
									<tr onmouseover="ManageList(this)" onmouseout="ManageList(this)" onclick="ManageList(this)" ondblclick="ManageList(this)">
										<xsl:attribute name="rownum"><xsl:value-of select="@num"/></xsl:attribute>
										<xsl:if test="@selected='true'">
											<xsl:attribute name="style">background-color:#ffff99;</xsl:attribute>
											<xsl:attribute name="selected">true</xsl:attribute>
										</xsl:if>
										<td style="vertical-align:top;text-align:left;">&#160;<img src="..\images\UI_pOpt.gif"/>
										</td>
										<td align="right" style="color:navy; vertical-align:top;">&#160;<xsl:value-of select="TIN"/>
										</td>
										<td style="vertical-align:top;">&#160;<xsl:value-of select="NAME"/>
										</td>
									</tr>
								</xsl:for-each>
							</table>
						</div>
						<table style="vertical-align:bottom;width:100%;">
							<tr>
								<td style="text-align:center;">
									<button onclick="AddNewSettings();">Додати </button>
								</td>
								<td style="text-align:center;">
									<button onclick="DeleteSettingsCard();">Видалити</button>
								</td>
							</tr>
						</table>
					</td>
					<td style="border:2px solid navy; background-color:white; vertical-align:top; text-align:left;padding-left:1%;padding-right:1%;" class="Detail" nowrap="nowrap;">
						<div style="height:95%;font-family:Verdana;overflow:auto;" id="CurrentSet">
							<!--основні параметри-->
							<table cellpadding="0" cellspacing="0">
								<tr>
									<td nowrap="nowrap">Тип платника</td>
									<td>
										<select id="PERSON_TYPE" onchange="dataChanged();SetSettingsView()">
											<option value="1">
												<xsl:if test="//ROW[@selected='true']/PERSON_TYPE=1">
													<xsl:attribute name="SELECTED">true</xsl:attribute>
												</xsl:if>
													Юридична особа</option>
											<option value="2">
												<xsl:if test="//ROW[@selected='true']/PERSON_TYPE=2">
													<xsl:attribute name="SELECTED">true</xsl:attribute>
												</xsl:if>
												Фізична особа</option>
											<option value="3">
												<xsl:if test="//ROW[@selected='true']/PERSON_TYPE=3">
													<xsl:attribute name="SELECTED">true</xsl:attribute>
												</xsl:if>
												Договір про спільну діяльність</option>
											<option value="4">
												<xsl:if test="//ROW[@selected='true']/PERSON_TYPE=4">
													<xsl:attribute name="SELECTED">true</xsl:attribute>
												</xsl:if>

												Представник нерезидента</option>
											<option value="5">
												<xsl:if test="//ROW[@selected='true']/PERSON_TYPE=5">
													<xsl:attribute name="SELECTED">true</xsl:attribute>
												</xsl:if>

												Договір про управління майном</option>
										</select>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<table>
											<tr>
												<td nowrap="nowrap">Код ДПІ </td>
												<td>
													<input type="text" id="C_STI" size="4" maxlength="4" onchange="dataChanged()" onkeydown="dataChanged()">
														<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/C_STI"/></xsl:attribute>
													</input>
												</td>
												<td nowrap="nowrap">Код ПФ </td>
												<td>
													<input type="text" id="C_PFU" size="5" maxlength="5" onchange="dataChanged()" onkeydown="dataChanged()">
														<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/C_PFU"/></xsl:attribute>
													</input>
												</td>
												<td nowrap="nowrap">Філія ПФ </td>
												<td>
													<input type="text" id="F_PFU" size="5" maxlength="5" onchange="dataChanged()" onkeydown="dataChanged()">
														<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/F_PFU"/></xsl:attribute>
													</input>
												</td>
												<td nowrap="nowrap">Орган держстатистики</td>
												<td>
													<input type="text" id="C_SSCU" size="5" maxlength="5" onchange="dataChanged()" onkeydown="dataChanged()">
														<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/C_SSCU"/></xsl:attribute>
													</input>
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Код ЄДРПОУ ДПІ </td>
									<td>
										<input type="text" id="C_STI_TIN" size="10" maxlength="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/C_STI_TIN"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap" id="PayerKodText">Код ЄДРПОУ </td>
									<td>
										<input type="text" id="TIN" size="10" maxlength="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/TIN"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap" id="PayerNameText">Назва платника </td>
									<td>
										<textarea cols="30" id="NAME" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:value-of select="//ROW[@selected='true']/NAME"/>
										</textarea>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Номер свідоцтва ПДВ </td>
									<td>
										<input type="text" id="NUMPDVSVD" size="12" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/NUMPDVSVD"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Індивідуальний податковий номер</td>
									<td>
										<input type="text" id="IPN" size="12" maxlength="12" title="Індивідуальний податковий номер" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/IPN"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Вид діяльності (КВЕД)</td>
									<td>
										<input type="text" id="KVED" size="20" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/KVED"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">КОАТУУ</td>
									<td>
										<input type="text" id="KOATUU" size="20" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/KOATUU"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td id="contract" colspan="2">
												Договір про спільну (сумісну) діяльність(або Договір про управління майном) від	&#160;&#160;
											<input type="text" id="CONTRACT_DATE" size="12" valueType="DGDate" onblur="CheckValue(this)" onkeydown="dataChanged()" onchange="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/CONTRACT_DATE"/></xsl:attribute>
										</input>&#160;&#160;
											№&#160;&#160;		
											<input type="text" id="CONTRACT_NUMBER" size="12" onkeydown="dataChanged()" onchange="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/CONTRACT_NUMBER"/></xsl:attribute>
										</input>
									</td>
								</tr>
							</table>
							<br/>
							<table width="98%" style="border-top:2px solid silver;" cellspacing="0">
								<tr>
									<td colspan="2" style="color:maroon;text-align:left;font-style:italic;">Адресні дані</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Поштовий індекс</td>
									<td>
										<input type="text" id="ZIPCODE" size="5" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/ZIPCODE"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Поштова адреса</td>
									<td>
										<textarea id="ADRESS" cols="30" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:value-of select="//ROW[@selected='true']/ADRESS"/>
										</textarea>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Телефон</td>
									<td>
										<input type="text" id="PHONE" size="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/PHONE"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Факс</td>
									<td>
										<input type="text" id="FAX" size="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/FAX"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">E-mail</td>
									<td>
										<input type="text" id="EMAIL" size="30" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/EMAIL"/></xsl:attribute>
										</input>
									</td>
								</tr>
							</table>
							<br/>
							<table width="98%" style="border-top:2px solid silver;" cellspacing="0" id="DirBuhTab">
								<tr>
									<td colspan="2" style="color:maroon;text-align:left;font-style:italic;">Керівники</td>
								</tr>
								<tr id="DirInfo">
									<td nowrap="nowrap">ДРФО директора</td>
									<td>
										<input type="text" id="DINN" size="10" maxlength="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/DINN"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">ПІБ директора</td>
									<td>
										<textarea id="DFIO" cols="30" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:value-of select="//ROW[@selected='true']/DFIO"/>
										</textarea>
									</td>
								</tr>
								<tr id="BuhInfo">
									<td nowrap="nowrap">ДРФО бухгалтера</td>
									<td>
										<input type="text" id="BINN" size="10" maxlength="10" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/BINN"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">ПІБ бухгалтера</td>
									<td>
										<textarea id="BFIO" cols="30" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:value-of select="//ROW[@selected='true']/BFIO"/>
										</textarea>
									</td>
								</tr>
							</table>
							<br/>
							<table width="98%" style="border-top:2px solid silver;" cellspacing="0">
								<tr>
									<td colspan="4" style="color:maroon;text-align:left;font-style:italic;">
Шляхи
</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Збереження</td>
									<td>
										<input type="text" id="SAVE_PATH" size="50" valueType="FilePath" onBlur="CheckValue(this)" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/SAVE_PATH"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Друк</td>
									<td>
										<input type="text" id="PRINT_PATH" size="50" valueType="FilePath" onBlur="CheckValue(this)" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/PRINT_PATH"/></xsl:attribute>
										</input>
									</td>
								</tr>
								<tr>
									<td nowrap="nowrap">Відправка</td>
									<td>
										<input type="text" id="SEND_PATH" size="50" valueType="FilePath" onBlur="CheckValue(this)" onchange="dataChanged()" onkeydown="dataChanged()">
											<xsl:attribute name="value"><xsl:value-of select="//ROW[@selected='true']/SEND_PATH"/></xsl:attribute>
										</input>
									</td>
								</tr>
							</table>
							<table width="98%" style="border-top:2px solid silver;" cellspacing="0">
								<tr>
									<td>Автозаповнення документа&#160;<input type="checkbox" id="AUTOFILL" onclick="dataChanged()">
											<xsl:if test="//ROW[@selected='true']/AUTOFILL=1">
												<xsl:attribute name="CHECKED">true</xsl:attribute>
											</xsl:if>
										</input>
									</td>
									<td>Підготовка до відправки&#160;<input type="checkbox" id="AUTOSEND" onclick="dataChanged()">
											<xsl:if test="//ROW[@selected='true']/AUTOSEND=1">
												<xsl:attribute name="CHECKED">true</xsl:attribute>
											</xsl:if>
										</input>
									</td>
								</tr>
							</table>
						</div>
						<div>
							<table style="vertical-align:bottom;width:100%;">
								<tr>
									<td style="text-align:left;">
										<button onclick=" SettingsExit()">Обрати</button>	&#160;&#160;
												<button disabled="disabled" id="btnSettingsSave" onclick="SaveChangedCard();">Зберегти зміни</button>&#160;&#160;
												<button onclick=" SettingsExit()">Вийти</button>
									</td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</xsl:template>
	<!--Перегляд правил заповнення документа -->
	<xsl:template match="/" mode="ShowRule">
		<table border="0" cellspacing="0" cellpadding="0" width="100%" id="SetRules">
			<thead>
				<tr>
					<th>Правила заповнення документу</th>
				</tr>
			</thead>
			<tbody>
				<xsl:for-each select="//document/rule">
					<tr>
						<td align="left">
							<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
							<xsl:value-of select="@description"/>
						</td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>
	<!--Перегляд журналу документ_в -->
	<xsl:template match="/" mode="LOG_VIEW">
		<div style="font-size:120%;color:maroon;font-weight:bold;text-align:center;">
			<xsl:choose>
				<xsl:when test="$sprType='logView'">Журнал документ_в</xsl:when>
				<xsl:when test="$sprType!='logView'"> Обер_ть документ</xsl:when>
			</xsl:choose>
		</div>
		<ul style="font-weight:bold;" id="LogList">
			<xsl:attribute name="tin"><xsl:value-of select="$Tin"/></xsl:attribute>
			<xsl:for-each select="$filter">
				<xsl:sort select="C_DOC"/>
				<xsl:sort select="C_DOC_SUB"/>
				<xsl:sort select="PERIOD_YEAR"/>
				<xsl:sort select="PERIOD_MONTH"/>
				<li onclick="ListManage()" class="topLevelC" style="font-face:Courier New;color:navy;">
					<xsl:value-of select="concat(C_DOC,C_DOC_SUB,'      ',NAME)"/>
					<xsl:variable name="cDoc">
						<xsl:value-of select="C_DOC"/>
					</xsl:variable>
					<xsl:variable name="cDocSub">
						<xsl:value-of select="C_DOC_SUB"/>
					</xsl:variable>
					<ul>
						<xsl:if test="$cDoc!='R12'">
						<xsl:for-each select="//DocSet/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub ]/PERIOD">
							<li class="topLevelC">
								<xsl:value-of select="opz:translatePeriod(PERIOD_TYPE,PERIOD_MONTH,PERIOD_YEAR)" disable-output-escaping="yes"/>
								<xsl:variable name="periodType">
									<xsl:value-of select="PERIOD_TYPE"/>
								</xsl:variable>
								<xsl:variable name="periodMonth">
									<xsl:value-of select="PERIOD_MONTH"/>
								</xsl:variable>
								<xsl:variable name="periodYear">
									<xsl:value-of select="PERIOD_YEAR"/>
								</xsl:variable>
								<ul>
									<xsl:for-each select="//DocList/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub and 
					            PERIOD_TYPE=$periodType and PERIOD_MONTH=$periodMonth and PERIOD_YEAR=$periodYear and FILENAME!='']">
										<xsl:sort select="C_DOC_CNT"/>
										<xsl:sort select="C_DOC_TYPE"/>
										<li class="lastLevel">
											<xsl:attribute name="filename"><xsl:value-of select="FILENAME"/></xsl:attribute>
											<xsl:choose>
												<xsl:when test="$sprType!='logView'">
													<xsl:attribute name="style">text-decoration:underline;cursor:hand;</xsl:attribute>
													<xsl:attribute name="onclick">if (confirm('В_дкрити даний документ?'))
								    { window.returnValue=""+this.filename;window.close();}</xsl:attribute>
												</xsl:when>
												<xsl:otherwise>
													<xsl:attribute name="style">cursor:auto;</xsl:attribute>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:value-of select="FILENAME"/>
											<font color="maroon">  ( дата :
				            	<xsl:value-of select="concat(substring(D_FILL,1,2),'.',substring(D_FILL,3,2),'.',substring(D_FILL,5,8))"/>
												<xsl:if test="concat(C_DOC,C_DOC_SUB)='A12015'">
													<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>   № <xsl:value-of select="N_NUM"/>
												</xsl:if>)</font>
											<img src="../images/ui_save.gif" alt="Зберегти як..." onclick="SaveDocFromLog()"/>
											<img src="../images/ui_trash.gif" alt="Видалити..." onclick="DeleteDocFromLog()"/>
										</li>
									</xsl:for-each>
								</ul>
							</li>
						</xsl:for-each>
						</xsl:if>
						<!-- Запити-->
						<xsl:if test="$cDoc='R12'">
						
							<xsl:for-each select="//DocList/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub  and FILENAME!='']">
										<xsl:sort select="C_DOC_CNT"/>
										<li class="lastLevel">
											<xsl:attribute name="filename"><xsl:value-of select="FILENAME"/></xsl:attribute>
											<xsl:choose>
												<xsl:when test="$sprType!='logView'">
													<xsl:attribute name="style">text-decoration:underline;cursor:hand;</xsl:attribute>
													<xsl:attribute name="onclick">if (confirm('В_дкрити даний документ?'))
								    { window.returnValue=""+this.filename;window.close();}</xsl:attribute>
												</xsl:when>
												<xsl:otherwise>
													<xsl:attribute name="style">cursor:auto;</xsl:attribute>
												</xsl:otherwise>
											</xsl:choose>
											<xsl:value-of select="FILENAME"/>
											<font color="maroon">  ( дата :
				            	<xsl:value-of select="concat(substring(D_FILL,1,2),'.',substring(D_FILL,3,2),'.',substring(D_FILL,5,8))"/>
												<xsl:if test="concat(C_DOC,C_DOC_SUB)='J12010'">
													<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>   № <xsl:value-of select="N_NUM"/>
												</xsl:if>)</font>
											<img src="../images/ui_save.gif" alt="Зберегти як..." onclick="SaveDocFromLog()"/>
											<img src="../images/ui_trash.gif" alt="Видалити..." onclick="DeleteDocFromLog()"/>
										</li>
									</xsl:for-each>
								
						</xsl:if>
					</ul>
				</li>
			</xsl:for-each>
		</ul>
	</xsl:template>
	<!--Пакет ПФУ-->
	<xsl:template match="/" mode="PFUPackage">
		<div style="font-size:120%;color:maroon;font-weight:bold;text-align:center;">
			Оберіть документи пакета
		</div>
		<div style="width:100%;text-align:right;border:0px solid navy;">
			<input value="Підтвердити" type="button" onclick="SavePFUPack();"/>
		</div>
		<ul style="font-weight:bold;" id="LogList">
			<xsl:attribute name="tin"><xsl:value-of select="$Tin"/></xsl:attribute>
			<xsl:for-each select="$filter">
				<xsl:sort select="C_DOC"/>
				<xsl:sort select="C_DOC_SUB"/>
				<xsl:sort select="PERIOD_YEAR"/>
				<xsl:sort select="PERIOD_MONTH"/>
				<li onclick="ListManage()" class="topLevelC" style="font-face:Courier New;color:navy;">
					<xsl:value-of select="concat(C_DOC,C_DOC_SUB,'      ',NAME)"/>
					<xsl:variable name="cDoc">
						<xsl:value-of select="C_DOC"/>
					</xsl:variable>
					<xsl:variable name="cDocSub">
						<xsl:value-of select="C_DOC_SUB"/>
					</xsl:variable>
					<ul>
						<xsl:for-each select="//DocSet/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub ]/PERIOD">
							<li class="topLevelC">
								<xsl:value-of select="opz:translatePeriod(PERIOD_TYPE,PERIOD_MONTH,PERIOD_YEAR)" disable-output-escaping="yes"/>
								<xsl:variable name="periodType">
									<xsl:value-of select="PERIOD_TYPE"/>
								</xsl:variable>
								<xsl:variable name="periodMonth">
									<xsl:value-of select="PERIOD_MONTH"/>
								</xsl:variable>
								<xsl:variable name="periodYear">
									<xsl:value-of select="PERIOD_YEAR"/>
								</xsl:variable>
								<ul>
									<xsl:for-each select="//DocList/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub and 
					            PERIOD_TYPE=$periodType and PERIOD_MONTH=$periodMonth and PERIOD_YEAR=$periodYear and FILENAME!='']">
										<xsl:sort select="C_DOC_CNT"/>
										<xsl:sort select="C_DOC_TYPE"/>
										<li class="lastLevel" style="list-style-image:none;">
											<xsl:attribute name="filename"><xsl:value-of select="FILENAME"/></xsl:attribute>
											<xsl:attribute name="style">text-decoration:underline;cursor:hand;</xsl:attribute>
											<xsl:attribute name="onclick"/>
											<input type="checkbox" title="Обрати"/>
											<xsl:value-of select="FILENAME"/>
											<font color="maroon">  ( дата :
				            	<xsl:value-of select="concat(substring(D_FILL,1,2),'.',substring(D_FILL,3,2),'.',substring(D_FILL,5,8))"/>
												<xsl:if test="concat(C_DOC,C_DOC_SUB)='A12015'">
													<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>   № <xsl:value-of select="N_NUM"/>
												</xsl:if>)</font>
										</li>
									</xsl:for-each>
								</ul>
							</li>
						</xsl:for-each>
						<!--	<xsl:for-each select="//DocList/DOC[C_DOC=$cDoc and C_DOC_SUB=$cDocSub  and FILENAME!='']">
								<xsl:sort select="C_DOC_CNT"/>
								<li class="lastLevel">
									<xsl:attribute name="filename"><xsl:value-of select="FILENAME"/></xsl:attribute>
									<xsl:choose>
										<xsl:when test="$sprType!='logView'">
											<xsl:attribute name="style">text-decoration:underline;cursor:hand;</xsl:attribute>
											<xsl:attribute name="onclick">if (confirm('Відкрити даний документ?'))
								    { window.returnValue=""+this.filename;window.close();}</xsl:attribute>
										</xsl:when>
										<xsl:otherwise>
											<xsl:attribute name="style">cursor:auto;</xsl:attribute>
										</xsl:otherwise>
									</xsl:choose>
									<xsl:value-of select="FILENAME"/>
									<font color="maroon">  ( дата :
				            	<xsl:value-of select="concat(substring(D_FILL,1,2),'.',substring(D_FILL,3,2),'.',substring(D_FILL,5,8))"/>
										<xsl:if test="concat(C_DOC,C_DOC_SUB)='J12010'">
											<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>   № <xsl:value-of select="N_NUM"/>
										</xsl:if>)</font>
									<img src="../images/ui_save.gif" alt="Зберегти як..." onclick="SaveDocFromLog()"/>
									<img src="../images/ui_trash.gif" alt="Видалити..." onclick="DeleteDocFromLog()"/>
								</li>
							</xsl:for-each>-->
					</ul>
				</li>
			</xsl:for-each>
		</ul>
	</xsl:template>
</xsl:stylesheet>
