<?php header('Content-Type: text/html; charset=windows-1251'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=windows-1251">
<STYLE>A {BACKGROUND:silver;cursor:pointer}</STYLE></head>
<?php
///////////////////////////////////////
// 
///////////////////////////////////////
if (isset ($_REQUEST['soob']))          // 
{$soob=$_REQUEST['soob'];}             
else
{$soob="";}
//echo  htmlspecialchars($mrep, ENT_QUOTES);  
$vvv="";                // 
$osre=false;            //         
list($abs1, $s22) = explode("pages",getcwd( ));
include $abs1."f.php";                         // 






$scr2=getcwd()."/script/~server-before.php";   // 
if  (file_exists($scr2))                       //   
{include $scr2;                                // 
}
$os="";               // 
$os2="";              // 
$beg=1;               //
//$kol=10;            // 
$kos=3;               // 
$admin=true;          // 
$sss="";              // 
$ver=false;           // 

$uri=$_SERVER['REQUEST_URI']; 
$ttt=explode("tables.php",$uri);  
$pz="tables.php".$ttt[1]; 
$ttt2=explode("/",$ttt[0]);  
list($s1, $numbaz) = explode("_",$ttt2[count($ttt2)-2]);   // 
if (isset ($_REQUEST['tabl']))                            //
{$tabl=$_REQUEST['tabl'];}             
else
{$tabl="";}



$access="yes";                                    
//***************************************************************************************
include $abs1.'sampl/baza1/tables_access.php';   //        
//***************************************************************************************

//*******************************************************
//  
//******************************************************
if (isset ($_REQUEST['select2']))         //
{$select2=$_REQUEST['select2'];}          // 
else                                      // 
{$select2="";}                            // 
if  ($select2!="")                        // 
{if (strstr($select2,"2s"))               // 
{$_select=getcwd()."/select2.txt";}	      // 
else                                      // 
{$_select=getcwd()."/select3.txt";}       // 
$w2 = fopen($_select, 'w') or exit;       // 
fwrite($w2,$select2);                     // 
fclose($w2);
}




list($beg, $dalee) = explode("contents",getcwd());
list($beg, $dalee) = explode("_",$dalee);
if (substr($dalee, 0, 3)=="000") 
{$table_number=3;}                       // 
else if (substr($dalee, 0, 2)=="00") 
{$table_number=2;}                       // 
else
{$table_number=1;}                       // 

if (strstr($tabl, "1s/"))                // 
{$mm5=1;}
else if (strstr($tabl, "2s/"))           // 
{$mm5=2;}
else if (strstr($tabl, "3s/"))           // 
{$mm5=3;}
else
{$mm5=count(explode("/",$tabl));         // 
}                                        // 
if ($mm5==1)
{$kin="father";}                         // 
else if ($mm5==2)
{$kin="son";}                            // 
else if ($mm5==3)                                
{$kin="grandson";}                       // 

//*****************************************************************************
$tablr=rtr($ttt2[3]);
if (isset ($_REQUEST['zag5']))           //  
{$zag5=$_REQUEST['zag5'];}
else
{$zag5="";}
$mpod=count(explode("/",$tabl));         //

if (isset ($_REQUEST['ggg']))          // 
{$ggg=$_REQUEST['ggg'];}             
else
{$ggg="";}
// ggg=1  
// ggg=2  
// ggg="" 


if (strpos($tabl,"-")==0)    
{$pre=explode("/",$tabl); 
$kpre=count($pre); 
}
if (isset ($_REQUEST['napr']))          // 
{$napr=$_REQUEST['napr'];}
else
{$napr=0;}
if (isset ($_REQUEST['ns']))             //
{$ns=$_REQUEST['ns'];}
else
{$ns=0;}
if (isset($_GET['mob']))
{$mob=$_GET['mob'];}
else
{$mob=0;}
if (isset ($_REQUEST['mob']))              // 
{$mob=$_REQUEST['mob'];}
else
{$mob=0;}
if (isset ($_REQUEST['retu2']))   
{$retu2=$_REQUEST['retu2'];}
else
{$retu2="";}
if (isset ($_REQUEST['mrep']))     // 
{$mrep=trim($_REQUEST['mrep']);}
else
{$mrep="";}

if (isset ($_REQUEST['to']))     // 
{
	$to=trim($_REQUEST['to']);}
else
{$to="1";}


//***************************************************************************************
//                   
//****************************************************************
if  (true)   //($com!=3)   //
{if ($kpre==1)                                            // 
//****************************************************************
{$level="1s";                                             // 
$level2="/";                                              // 
$_1_txt="1.txt";                                          // 
}
else if ($kpre==2)                                        // 
//***************************************************************
{list($tz,$tz2)=explode("/",$tabl);
$level2="/".$tz."/"; 
$_2s= file(getcwd()."/select2.txt");                      // 
$_2s=$_2s[0];
$level=$_2s;
$_1_txt=str_replace("2s","",$_2s);
if ($_1_txt=="")
{$_1_txt="1.txt";}
else
{$_1_txt=$_1_txt.".txt";	
}}
//*****************************************************************
else if ($kpre==3)                                          // 
{list($tz,$tz2,$tz3)=explode("/",$tabl);
$level2="/".$tz."/".$tz2."/";
$_3s= file(getcwd()."/select3.txt");                        // 
$_3s=$_3s[0];
$level=$_3s;
$_1_txt=str_replace("3s","",$_3s);
if ($_1_txt=="")
{$_1_txt="1.txt";}
else
{$_1_txt=$_1_txt.".txt";	
}}
}

//*******************************************************************
//      
//******************************************************************
if (strpos($tabl,"-")==0)                                   // 
{if ($kpre==1)
{$ifsu=getcwd()."/1s/sv.txt";}
else if ($kpre==2)
{$ifsu=getcwd()."/".$_2s."/sv.txt";}
else if ($kpre==3)
{$ifsu=getcwd()."/".$_3s."/sv.txt";}

if (file_exists($ifsu))
{$ifsu2=file_get_contents($ifsu);                      // 
//***********************************************************************************************
// 
//***********************************************************************************************
$corr=false;                                            // 
if (strstr($ifsu2,'style="WIDTH: 480px"'))              // 
{$ifsu2=str_replace('style="WIDTH: 480px"',"",$ifsu2);  // 
$corr=true;                                             // 
}
if (strstr($ifsu2,'this.value'))                        // 
{$ifsu2=str_replace('this.value',"this",$ifsu2);        // 
$corr=true;                                             // 
}
if (strstr($ifsu2,'onclick'))                        // 
{$ifsu2=str_replace('onclick',"onchange",$ifsu2);        // 
$corr=true;                                             //
}
$ifsu2=str_replace('selected',"",$ifsu2);
}
else                                                    //
{$ifsu2='<SELECT id=suu onchange=uz(this) value=""><OPTION selected value="">SELECTION:</OPTION></SELECT>';
$corr=true;                                             //
}
if ($corr)                                              // 
{$ww1=  fopen($ifsu, 'w') or exit;                      // 
fwrite($ww1,$ifsu2);                                    // 
fclose($ww1);
}}
//********************************************************************************
//                       
//*********************************************************************************
if (isset ($_REQUEST['com']))                            //
{$com=$_REQUEST['com'];}             
else
{$com="";}
if ($com!="")                                            //
{
include $abs1.'sampl/baza1/tables_command.php';          // 
}
//*********************
// 
//********************
if (isset ($_REQUEST['mmon']))                           // 
{$mmon=$_REQUEST['mmon'];}          
else
{$mmon="";}
if ($mmon!="")                                           // 
{list($abs1, $s22) = explode("pages",getcwd( ));         // 
$otkuda=$abs1.'sampl/baza1/script/~button-script.htm';
$otkuda2=$abs1.'sampl/baza1/script/~server-before.php'; 
$otkuda4=$abs1.'sampl/baza1/script/~submit.htm'; 
$kuda=getcwd ( ).'/script/';
if  (!file_exists($kuda))                                // 
{mkdir($kuda);}
$kuda=getcwd ( ).'/script/~button-script.htm';           // 
$kuda2=getcwd ( ).'/script/~server-before.php'; 
$kuda4=getcwd ( ).'/script/~submit.htm'; 
if ($mmon=="button")
{if  (file_exists($kuda) or file_exists($kuda2) or file_exists($kuda4))  
 {$soob='BUTTON IS ALREADY INSERTED!';}
 else
{copy($otkuda,$kuda);                                     // 
copy($otkuda2,$kuda2); 
copy($otkuda4,$kuda4); 
$soob='BUTTON INSERTED!';
}}
else if($mmon=="button-del")                              // 
{if(file_exists($kuda))
{unlink ($kuda);}
if(file_exists($kuda2))
{unlink ($kuda2);}
if(file_exists($kuda3))
{unlink ($kuda3);}
if(file_exists($kuda4))
{unlink ($kuda4);}
$soob='BUTTONS REMOVED!';
}
else if($mmon=="edit")                                    // 
{
//	echo exec("notepad++.exe");
}
else
{$fpas=getcwd ( ).'/1s/m.txt'; 
 if ($mmon=="yes")                                        // 
{if  (file_exists($fpas))  
 {}
 else
 {$ww1=  fopen($fpas, 'w') or exit;                      // 
 fclose($ww1);
 $soob='Monopoly ESTABLISHED!';
}}
else
{if  (file_exists($fpas))                                // 
{unlink ($fpas);
 $soob='Monopoly CANCELED!';
 }}}}
//*******************************************************************************
//                      
if (isset ($_REQUEST['pa']))             //  
{$pa=$_REQUEST['pa'];}          
else
{$pa="";}
if ($pa!="")     
{$fpas=getcwd ( ).'/p.txt';
if ($pa=="*"  )                          // 
{if  (file_exists($fpas))  
 {unlink ($fpas);}
  $soob="Password CANCELED!";
}
else                                    // 
{$ww1=  fopen($fpas, 'w') or exit;      // 
 fwrite($ww1,md5($pa,false));           // 
 fclose($ww1);
 $soob='Password ENTERED OR CHANGED!';
}}
//*******************************************************************************

if (isset ($_REQUEST['totable']))          //
{$totable=$_REQUEST['totable'];}          
else
{$totable=$tabl;}

if (isset ($_REQUEST['tbeg']))             //
{$tbeg=$_REQUEST['tbeg'];}              
else
{$tbeg=1;}

if (isset ($_REQUEST['tend']))             // 
{$tend=$_REQUEST['tend'];}         
else
{$tend=999999;
}
if (isset ($_REQUEST['pp']))                //
{$pp=$_REQUEST['pp'];}                      //
else
{$pp="";}                                   //

//************************************************************************************************
//                           
//*********************************************************************************************** 
if (file_exists(getcwd ( ).'/'.$tabl))       // 
{
include $abs1.'sampl/baza1/tables_change_ leaves.php';  // 
//**************************************************************************************************************
include $abs1.'sampl/baza1/tables_create _configure.php';   // 
//************************************************************************************************
if (isset($_REQUEST['bufv2']))                              // 
{if (isset ($_REQUEST['bufv']))                             // 
{$bufv=$_REQUEST['bufv'];}                                  // 
else
{$bufv="";}
if ($kin=="father")                                        //
{$tabbuff=getcwd ()."/1s/2.txt";}
else if ($kin=="son")
{$tabbuff=getcwd ()."/".$_2s."/2.txt";}                     //
else if ($kin=="grandson")                               
{$tabbuff=getcwd ()."/".$_3s."/2.txt";}                     //
if ($bufv=="" and file_exists($tabbuff))
{unlink ($tabbuff);
$soob="Buffer file deleted!";
}
else if ($bufv!="")
{$ww100=fopen($tabbuff, 'w') or exit;          // 
fwrite($ww100,$bufv);
fclose($ww100);
$soob="Buffer saved!";
}}
if (isset ($_REQUEST['mdel'])) 
{$mdel=trim($_REQUEST['mdel']);}               // 
else
{$mdel="";}
if (isset ($_REQUEST['mins'])) 
{$mins=trim($_REQUEST['mins']);}                //
else
{$mins="";}
//**********************************************************************************
//     
//***********************************************************************************  
if  ($mins!="" or $mdel!="")                         // 
{include $abs1.'sampl/baza1/tables_abandoned.php';   // 
}}

//***************************************************************************************************************
// 
if ($pp!="")
{echo '<body onkeydown=kc(event.keyCode)   leftMargin=0 id=bod topMargin=0 style="background:white;overflow:auto;visibility:hidden" >';
}else{if ($kpre==1)
{echo '<body onkeydown=kc(event.keyCode)  background="../../../../d~e~f/bkg.gif"  leftMargin=0 id=bod topMargin=0 style="overflow:auto;visibility:hidden" >';
}if ($kpre==2)
{echo '<body onkeydown=kc(event.keyCode)  background="../../../../d~e~f/bkg2.gif"  leftMargin=0 id=bod topMargin=0 style="overflow:auto;visibility:hidden" >';
}if ($kpre==3)
{echo '<body onkeydown=kc(event.keyCode)  background="../../../../d~e~f/bkg3.gif"  leftMargin=0 id=bod topMargin=0 style="overflow:auto;visibility:hidden" >';
}}
if ($sss!="")                         // 
{echo $sss;}
if (isset ($_REQUEST['rel']))         // 
{$rel=$_REQUEST['rel'];}          
else
{$rel="";}
if ($rel=="1")
{echo '<b id=rell style="display:none">+</b>';
}
else
{echo '<b id=rell style="display:none">-</b>';
}
//****************************************************************************************************
//                                 
//***************************************************************************************************
if  (isset($_REQUEST['submit']))   //
{$fpas=getcwd ( ).'/p.txt';                    // 
if  (file_exists($fpas))                       // 
{if (isset ($_REQUEST['pain']))                // 
{$pain=$_REQUEST['pain'];
}          
else
{$pain="";}

if (isset ($_REQUEST['save']))                // 
{$save=$_REQUEST['save'];
}          
else
{$save="";}

if ($save!="")
{	
if ($pain=="no")                           // 
{}
else                                       // 
{$pass=md5($pain,false);                   //  
$lp = file($fpas); 			               // 
foreach ($lp as $lpi => $lpin)             // 
{$pass1=$lpin;break;}                      // 
 if ($pass!=$pass1)                        // 
 {$mrep=""; $mdel=""; $mins="";$madd="";   // 
  $soob="<b style='color:yellow;background:brown'>NOT SAVED! ENTER CORRECT PASSWORD!</b>";
 }
 else                                      //
 {$soob="Changes saved ! ";
  $pain="no";                              // 
}
}}}
//echo $mrep."+".$mdel."+". $mins."+".$madd."+";
//*****************************************************************************************
 if  ($mrep!="" or $mdel!="" or $mins!="" or $madd!="" )   // 
//*****************************************************************************************
{if (substr($mrep, 0, 1)=="¶" or substr($mdel, 0, 1)=="¶") // 
{include $abs1.'sampl/baza1/tables_global.php';            // 
}
else
{include $abs1.'sampl/baza1/tables_change_data.php';      // 
}
//*****************************************************************************************
if (strstr($tabl,"-"))                                    // 
{$data_substitution=file(getcwd ( ).'/'.$tabl);           // 
for ($i = 0; $i <=3; $i++)                                // 
{$properties[$i]=$data_substitution[$i];	              // 
}
$j=0;                                                     // 
$data=array();                                            // 
for ($i = 4; $i <=count($data_substitution)-1; $i++)      // 
{$data[$j++]=$data_substitution[$i];	                  // 
}}
else                                                      // 
{$data = file(getcwd ( ).'/'.$tabl);                      // 
}
$kol=count($data);                                       // 
}}
//*********************************
//
//*********************************
if (isset ($_REQUEST['kstol']))    
{$kstol=$_REQUEST['kstol'];}          
else
{$kstol="";}
if ($kstol!="")
{list($z1, $z2) = explode("-",$kstol);
if ($z1!="" and $z2!="")
{$otkuda=getcwd ( ).'/'.$_2s.'/1-'.$z1.'.txt';
$kuda=getcwd ( ).'/'.$_2s.'/1-'.$z2.'.txt';
if (copy($otkuda,$kuda)) {} else {$os=$os. "<b>Copy error".$z."</b>";}
}}
//*********************************************************************************
//                                           
//*********************************************************************************
echo '<script type="text/javascript">'."\r\n";
echo 'var tip="'.str_replace("\r\n","",$properties[0]).'";'."\r\n";
echo 'var minmax="'.str_replace("\r\n","",$properties[1]).'";'."\r\n";
echo 'var def="'.str_replace("\r\n","",$properties[2]).'";'."\r\n";
$mms5=explode("```",str_replace("\r\n","",$properties[3]));       //  
$www=explode("/",str_replace("\r\n","",$mms5[0]));   //
$tboz2=$www[1]; $tsabl=""; $topis="";$tpod="";    

for ($i = 1; $i <= count($mms5)-1; $i++)                          // 
{$mms55=explode("/",str_replace("\r\n","",$mms5[$i]));            // 
$tboz2=$tboz2."```".$mms55[1]; $tsabl=$tsabl."```".$mms55[2]; $topis=$topis."```".$mms55[3];
$tpod=$tpod."```";
}
//
echo 'var oboz2="'.$tboz2.'";'."\r\n";                            // 
echo 'var sabl="'.$tsabl.'";'."\r\n";                             // 
echo 'var opis="'.$topis.'";'."\r\n";                             // 
if (count($properties)>4)                                 // 
{echo 'var pod="'.str_replace("\r\n","",$properties[4]).'";'."\r\n";    // 
}
else
{echo 'var pod="'.$tpod.'";';}
echo '</script>';
//********************************************************************************
// 
// 
//********************************************************************************
if ($ver)                                       // 
{$today = getdate();                            // 
$ver1=$today["year"]."/".$today["mon"]."/". $today["mday"]."/".$today["hours"].":".
$today["minutes"].":".$today["seconds"];
$fver=getcwd ( ).'/1s/v.txt';                   // 
$w2 = fopen($fver, 'w') or exit;                // 
fwrite($w2,$ver1);
fclose($w2);
}

?>
<table id=h style="z-index:2;opacity:0.3;visibility:hidden;height:100%;width:100%;position:absolute;top:0;left:0;background:black;filter:alpha(opacity=30)"><tr><td>&nbsp;&nbsp;&nbsp;</td><tr></table> 
<?php
//***********************************************************************************
// 
//***********************************************************************************
if ($kpre==1)
{echo '<table id=f555 border=0 width=100% height=100% background="../../../../d~e~f/bkg.gif" style="display:none;z-index:3;position:absolute;top:0px;left:0px">';
}if ($kpre==2)
{echo '<table id=f555 border=0 width=100% height=100% background="../../../../d~e~f/bkg2.gif"  
style="display:none;z-index:3;position:absolute;top:0px;left:0px">';
}if ($kpre==3)
{echo '<table id=f555 border=0 width=100% height=100% background="../../../../d~e~f/bkg3.gif"  
style="display:none;z-index:3;position:absolute;top:0px;left:0px">';
}if (strpos(" ".$tabl,"-")==0)            //
{echo '<tr><td colspan=5 align=center><b>Editing the selected line &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onclick=bw(this)  style=background:white  title="Edit column in large window" border=1>
big edit</button></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td align=center valign=center>
&nbsp;&nbsp;&nbsp;<button  onclick=save555()  style=background:white 
title="Save changes to input fields" >save</button>&nbsp;&nbsp;&nbsp;
<button  title="Close edit" 
onclick=document.getElementById("f555").style.display="none";document.getElementById("div").style.display=""  
style=background:white>cancel</button></td>
</tr>';
echo str_repeat('<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>',15);
echo '</tr></table>';
}
//***************************************************************************************
include $abs1.'sampl/baza1/tables_forms.php';   // 
//***************************************************************************************
?>
<!------------------------------------   --------------------------------------------->
<table id=main cellPadding=0   border=1 width=100% height=100%><tr><td height=10 align=center
<?php
//**********************************************************************************************************
//                                      
//**********************************************************************************************************
if ($pp!="")                             // 
{echo ' style="background:darkblue;color:yellow"><b><big id=zag>'.$zag5.' - lookup field table  «'.$pp.'»</big></b>';}
else
//***********************************************************
{if  ($kpre==1)                           // 
//***********************************************************
{echo ' style="background:#a0522d;color:white">
<table width=100% height=20 border=0>
<tr>';
echo "<td id=monopoly style='display:none;width:30;color:red;background:yellow'>monopoly</td>";
if (file_exists(getcwd ()."/1/1/"))            // 
{echo "<td align=center width=10><img align=left src=../../../../sampl/baza1/rel1.bmp></td>";}
else if (file_exists(getcwd ()."/1/"))         // 
{echo "<td align=center width=10><img align=left src=../../../../sampl/baza1/rel0.bmp></td>";}
echo '<td align=center>
<big style="color:white;font-weight:bold" id=zag>&nbsp;</big></td>';
if (file_exists($ifsu))                         //
{$ifsu2=file_get_contents($ifsu);               //
$ifsu2=str_replace("id=suu","id=suu3  title='This is a list of saved selections,
are performed over the group. Click 1 row to deselect.'",$ifsu2);
echo "<td width=50 style=background:silver>".$ifsu2."</td></tr></table>";    // 
}}
//**************************************************************
if ($kpre==2)                                // 
//**************************************************************
{echo ' style="background:#2e8b57;color:white">
<table width=100% height=20 border=0>
<tr>';
echo "<td id=monopoly style='display:none;width:30;color:red;background:yellow'>monopoly</td>";
if (file_exists(getcwd ()."/1/1/"))        // 
{echo '<td><img align=left src=../../../../sampl/baza1/rel2.bmp></td>';}
else if (file_exists(getcwd ()."/1/"))     // 
{echo '<td><img align=left src=../../../../sampl/baza1/rel01.bmp></td>';
if  ($glob!=1)                               
{$www='<td align=center style=color:white><nobr>Table&nbsp;<SELECT id=tabl_sel  onchange=tab_sel() title="This is a list of tables." >';
}
else                                       // 
{$www='<td disabled align=center style=color:white><nobr>Table&nbsp;<SELECT id=tabl_sel  onchange=tab_sel() title="This is a list of tables." >';
}
$s =scandir(getcwd ());                          // 
foreach ($s as $val) 			         
{if ($val != "." && $val != "..")
{if (strpos($val,".")==0)                        // 
{if (substr($val,0,2)=="2s")                     // 
{$_2s2= file(getcwd()."/".$val."/0.txt");        // 
$_2s2=$_2s2[3];                                  // 
$_2s2=explode("/",$_2s2);                        // 
$_2s2=$_2s2[1];
$www=$www.'<option value='.$val.'>'.$_2s2.'</option>';
}}}}
$www=$www."</SELECT></nobr></td>";	
echo $www;
}	
echo '<td width=100% align=center>&nbsp;<big style="color:white;font-weight:bold" id=zag>&nbsp;</big></td>';
if (file_exists($ifsu))                         // 
{$ifsu2=file_get_contents($ifsu);               // 
$ifsu2=str_replace("id=suu","id=suu3 title='This is a list of saved selections'",$ifsu2);
echo "<td align=center>".$ifsu2."</td>";       // 
}
//
echo "</tr></table>";
}
//***************************************************************
if ($kpre==3)                                  // 
//***************************************************************
{echo ' style="background:#4682b4;color:white">
<table width=100% height=20 border=0><tr>';
echo "<td id=monopoly style='display:none;width:30;color:red;background:yellow'>monopoly</td>";
echo '<td><img align=left src=../../../../sampl/baza1/rel3.bmp></td>';
if  ($glob!=1)                               
{$www='<td align=center style=color:white><nobr>Table&nbsp;<SELECT id=tabl_sel  onchange=tab_sel() title="This is a list of tables." >';
}
else                                             //
{$www='<td align=center style=color:white><nobr>Table&nbsp;<SELECT id=tabl_sel disabled  onchange=tab_sel() title="This is a list of tables." >';}
$s =scandir(getcwd ());                          //
foreach ($s as $val) 			         
{if ($val != "." && $val != "..")
{if (strpos($val,".")==0)                        //
{if (substr($val,0,2)=="3s")                     //
{$_3s2= file(getcwd()."/".$val."/0.txt");        //
$_3s2=$_3s2[3];                                  //
$_3s2=explode("/",$_3s2);                        //
$_3s2=$_3s2[1];
$www=$www.'<option value='.$val.'>'.$_3s2.'</option>';
}}}}
$www=$www."</SELECT></nobr></td>";	
echo $www;	
echo '<td width=100% align=center>&nbsp;<big style="color:white;font-weight:bold" id=zag>&nbsp;</big></td>';
if (file_exists($ifsu))                         // 
{$ifsu2=file_get_contents($ifsu);               // 
$ifsu2=str_replace("id=suu","id=suu3 title='This is a list of saved selections'",$ifsu2);
echo "<td align=center>".$ifsu2."</td>";        //
}
echo "</select></td></tr></table>";
}}
?>
<b id=rep></b>
</td></tr>
<tr width=100% height=10%>
<td valign=top >
<!------------------------------------  --------------------------->
<table id=s  height=20  width=100% border=0>
<?php
$mobile="\r\n"."<tr id=0>";                         //
$sty='style="color:white;background:#a9a9a9"';      //
if ($mob==0)                                   //
{echo '<tr id=std style="background:#a9a9a9;color:white">';}
else                                           //
{echo '<tr id=std style="display:none;background:#a9a9a9;color:white">';}

$mms=explode("```",$properties[3]);           // 
for ($i = 0; $i <= count($mms)-1; $i++)       // 
{$mms2=explode("/",$mms[$i]);                 // 
$zstol[$i]=$mms2[0];                          // 
$oboz[$i]=$mms2[1];                           // 
$sabl[$i]=$mms2[2];                           // 
$opis[$i]=$mms2[3];                           // 
}
for ($ti = 0; $ti <= count($mmtip)-1; $ti++)   // 
{$sb="";                                       // 
if ($mmtip[$ti]=="L")                          // 
{$sb='style=background:#ffefd5;color:black';   // 
}
else if ($mmtip[$ti]=="a")                     // 
{$sb='style=background:#e0ffff;color:black';   // 
}
else                                           
{
if (count($properties)>4)                      // 
{$mms5=explode("```",$properties[4]);          // 
if (trim($mms5[$ti])!="")                     // 
{$sb='style=background:#98fb98;color:black';   // 
}
}
}
// 
if ($ggg!="" and ($mmtip[$ti]=="i" or $mmtip[$ti]=="$") and $ti>1)
{
echo '<td align=center onclick=togr('.$ti.') title="'.$zstol[$ti].'"><b '.$sb.' >'.($ti+1).'</b></td>';
$mobile=$mobile.'<td '.$sty.'  onclick=togr('.$ti.') style="FONT-WEIGHT: bold"  >'.
str_replace("\r\n","",$zstol[$ti]).'</td>';
}
else
{
echo '<td  align=center title="'.$zstol[$ti].'"><b '.$sb.' >'.
($ti+1).'</b></td>';
$mobile=$mobile."<td ".$sty."  style='FONT-WEIGHT: bold'  >".
str_replace("\r\n","",$zstol[$ti])."</td>";
}}
if ($mob==0)
{$mobile=$mobile.'<td '.$sty. '>&nbsp;</td>';
}
else
{$mobile=$mobile."<td align=center".$sty.">&nbsp;r&nbsp;&nbsp; x&nbsp;&nbsp;</td>";
}
$mobile=$mobile."</tr>";
//echo  htmlspecialchars($mobile, ENT_QUOTES);
//
echo '<td align=center title="FLAGS: 1-change, 2-delete,
to go to the subordinate table, click past the checkboxes.">r&nbsp;x</td>';
?>
</tr></table>
<!-----------------------------------    -------------------------------------------------------->
<?php 
if  ($mob==0)
{echo '<DIV  onclick=clit(this,event)  id=div style="OVERFLOW: scroll;height:100%;width:100%" align=left>';
}
else
{echo '<font  onclick=clit(this,event)  id=div style="width:100%" align=left>';
}
if (isset ($_REQUEST['v']))     // 
{$v=$_REQUEST['v'];}            // 
else
{$v=10;
}                        // 
if (isset ($_REQUEST['beg']))   // 
{$beg=$_REQUEST['beg'];}        // 
else
{$beg=0;}                       // 
if (isset ($_REQUEST['end']))   // 
{$end=$_REQUEST['end'];}        // 
else
{$end=0;}                       // 
if ($fin)    //
{$beg=1;
 $end=9999;
}
if ($vvv!="")                   // 
{$v=999999;}                    // 
?>
<!----------------------------- ---------------------------------------------->
<table id=t   border="1" width=100% style=""><tbody>   
<?php
//*********************************************************************************************
//               
//*********************************************************************************************
if ($napr==0 and $beg==0 and $end==0 ) // 
{if (file_exists(getcwd ()."/1/") and ($kpre==1 or ($kpre==2 and file_exists(getcwd ()."/1/1/" ))))
{$napr=0;}
else
{$napr=3;}                            
}
if ($napr==0 )                        // 
//***********************************************************************
{$ot=1;                               // 
$do=$v;                               // 
if ($do>$kol) {$do=$kol;}             // 
}
else if ($napr==4 )                   // 
//************************************************************ 
{$ot=$beg;                            // 
if ($madd!="")                       // 
{$do=9999;}                           //
else
{$do=$end;}                           //
if ($do>$kol) {$do=$kol;}
}
else if ($napr==3)                     //
//**************************************************************
{$ot=$kol-$v+1;                        // 
if ($ot<=0) {$ot=1;}
$do=$kol;                              // 
}
else if ($napr==2)                    // 
//********************************************************
{$ot=$end+1;
if ($ot>=$kol) 
{$ot=$kol-$v+1;                        // 
$do=$kol;
}
else
{$do=$ot+$v-1;}
if ($ot<=0) {$ot=1;}
if ($do>$kol) {$do=$kol;}
}
else if ($napr==1)                    // 
//*********************************************************
{$ot=$beg-$v;
if ($ot<=0) 
{$ot=1;}
$do=$ot+$v-1;
if ($do>$kol) {$do=$kol;}
}
echo $mobile;                                         // 
//*******************************************************************************
$sss2="";
if (isset($_REQUEST['sele']))                          //
//********************************************************************
{
$sele=true;                                           // 
if (isset ($_REQUEST['stt1']))                         // 
{$stt1="#".$_REQUEST['stt1'];}             
else
{$stt1="";}
if (isset ($_REQUEST['stt2']))                         // 
{$stt2="#".$_REQUEST['stt2'];}             
else
{$stt2="";}
if (isset ($_REQUEST['stt3']))                         // 
{$stt3="#".$_REQUEST['stt3'];}             
else
{$stt3="";}
$ot4=explode("#",$stt1);                                //
$do4=explode("#",$stt2);                                //
$sp4=explode("#",$stt3);                                //
}
else
{$sele=false;}

//***************************************************************************************************
//                                     
//***************************************************************************************************
$refsm=explode(";",$refs);                               // 
//$os2=$ot."+".$do."+".$napr;
--$ot;--$do;                                             // 
for ($i =$ot ; $i <= $do; $i++)                          // 
//for ($i =0 ; $i <=count($data)-1; $i++)                          // 
//***************************************************************************************************
{$tt=explode("```",str_replace("\r\n","",$data[$i])) ;   // 
$da5=false;                                              // 
$da55=false;                                             // 
if ($sele)                                               // 
{
include $abs1.'sampl/baza1/tables_select.php';           // 
}
else                                                     // 
{$da5=true;}                                             // 
if ($da5)                                                // 
{echo "\r\n"."<tr id=".$i.">";
for ($i2 = 0; $i2 <= count($tt)-1; $i2++)                // 
{if ($i2==0)                                            
{echo "<td title=".$i2.">".$tt[$i2]."</td>";             // 
}
else
{
if ($mmtip[$i2]=="a")             // 
{$reft=str_replace("\r\n","",$tt[$i2]);                  // 
$refi="?";                                               // 
foreach ($refsm as $tii => $tinn)                        // 
{if ($reft==$tinn)
{$refi=$tii;break;}}
if ($mob==0)                                        
{echo "<td><a title=".$refi."n>...</a></td>";            //
}
else
{echo "<td><a  title=".$refi."n>...</a></td>";}          //
}
else                               
{echo "<td>".str_replace("\r\n","",$tt[$i2])."</td>";}   // 
}}
echo "<td><img src=no.gif ><img src=no.gif>&nbsp;</td>";  //
echo "</tr>";
}}
?>
</tbody></table>
<?php
if ($mob)
{echo '</font>';}
else
{echo '</div>';}
?>
</td></tr>
<!-----------------------------   --------------------------------------------------->
<tr id=p1 height=40 width=100% ><td align=left style="background:silver">
<table border=1 width=100%><tr>
<td title="Report" id=repo valign=top align=center><?php if ($soob=="") {echo "Download completed";} else {echo $soob;} ?>
</td><td align=left width=350><nobr>
&nbsp;&nbsp;
<button id=delc onclick='clea()' style="z-index:" title="Delete data from the selected cell click me or press Delete" style="background:white"><b>XX</b></button>
&nbsp;
<button onclick=postr() title="To go, in a group, to the desired line, enter the search context or a list of contexts (separator /) on the right and click me" style="background:white"><b>To!</b></button>
<?php 
echo '<input type=text id=zam1 title="what, where" style="width:140"  value=""> &nbsp;';
if ($glob!=1)
{echo '<img height=19 onclick=zam2() src=../../../../d~e~f/arrow-rj.gif height=17  title="Copy column value.
  Enter numbers: from where (left field)
  and where (field to the right)
  and click me."> ';
}
echo '<input type=text id=zam2 title="what, where, what to fill, what to add"  style="width:140" value="">&nbsp;&nbsp;';
echo '<img height=19 onclick=zam()  src=../../../../d~e~f/arrow-rj.gif height=17 title="Execute on table rows in selected column:
replace - enter what (first field on the left) with what (second field on the left),
add - what to add (second field from the left),
fill - what to fill (second field from the left),
and click me. "> ';
?>
</td><td align=right>

<table border=0><tr><td>
<?php
if ($pp=="")                             // 
{if ($kin=="grandson")                   // 
{echo '<img   style="border-right:green  15 solid" title="The transition from grandson to father"  onclick=pro3(this)  src=../../../../d~e~f/tables_1-1.gif>&nbsp;&nbsp;&nbsp;';
}
if ($kin=="father" and $table_number==3)  // 
{echo '<img   style="border-left:green 15 solid" title="The transition from father to grandson"  onclick=pro2(this) src=../../../../d~e~f/tables_4-1.gif>&nbsp;&nbsp;&nbsp;';
}
if ($kin=="son" and $table_number==3 )                           // 
{echo '<img   style="border-right:#ffd700  15 solid" title="The transition from son to father" onclick=pro1(this) src=../../../../d~e~f/tables_2.gif>&nbsp;&nbsp;&nbsp;';
}}
?>
<b>ENTER:</b>&nbsp;&nbsp;&nbsp;</td><td align=right  width=20>
<?php
if ($pp=="")                             // 
{if (($kin=="father" and ($table_number==2 or $table_number==3)) or ($table_number==3 and $kin=="son" ))
{echo '<img id=imb  style="border-left:#ffd700  15 solid" title="Transition to descendant" onclick=pro(this) src=../../../../d~e~f/tables_3.gif>';
}
if ($kin=="grandson")                      // 
{echo '<img  style="border-right:#ffd700 15 solid" title="Transition from grandson to son" onclick=pro1(this) src=../../../../d~e~f/tables_2.gif>';
}
if ($kin=="son" and $table_number==2 )                           // 
{echo '<img   style="border-right:#ffd700  15 solid" title="The transition from son to father" onclick=pro1(this) src=../../../../d~e~f/tables_2.gif>';
}}
?>
</td>
</td><tr></table>
</td></tr></table>
<table id="textarea" width=100%  >
<tr width=100% style="background:silver;color:yellow"><td id="textarea2">
<?php  
//**************************************************************************************************************
//                           
//************************************************************************************************************** 
for ($ti = 0; $ti <= count($mmtip)-1; $ti++)       // 
{echo '<TEXTAREA name=""  id=ta'.$ti." ";
  if (strstr($zstol[$ti], "^"))
 {echo  ' title="" readOnly  onclick=textareaclick(this)  style="background:silver;overflow:hidden;color:red;width:30"';}
 else if ($ti==0)                                  // 
 {echo  ' title="" readOnly  title="Lkz" onclick=rw() style="background:silver;overflow:hidden;color:red;width:30"';}
 else
 { if ($mmtip[$ti]=="L" or strstr($zstol[$ti], "=") or strstr($zstol[$ti], "!") or strstr($zstol[$ti-1], "=")) 
 {echo  ' readOnly  onfocus=textareaclick(this) ';}
 if ($mmtip[$ti]=="a")
 {echo  ' readOnly  onfocus=textareaclick(this) ';}
  if ($mob and  $mmtip[$ti]!="L" and $mmtip[$ti]!="a") 
  {echo ' readOnly '; }
  echo '  onclick=textareaclick(this); style="background:#fff8dc;overflow:hidden;color:red;width:30" title="" ';}
 echo '></TEXTAREA>'."\r\n";
}
?>
</td></tr></table>
</td></tr>
<tr id=p2 height=20><td  align=left valign=top style=background:silver >
<?php
//**************************************************************************************************************
//                                    
//**************************************************************************************************************
if ($kpre>1)
{echo '<img src=../../../../d~e~f/tables_28.gif border=2  onclick="selg(0)" title="Show rows of all parents, or deselect this display, or deselect on the server" style="background:white">&nbsp;&nbsp;';
}
if ($glob!=1)
{if ($pp!="")                       // 
{echo '<img src=../../../../d~e~f/tables_27.gif   onclick="totable()"  border=2 title="Back to table">&nbsp;&nbsp;';
}
echo '<img src=../../../../d~e~f/tables_10.gif id=vkon  onclick="aend()" border=2 title="At the end to add, or add a line at the end, for all mode.">';
echo '&nbsp;&nbsp;&nbsp;<img src=../../../../d~e~f/tables_1.gif   onclick=ad(2) border=1 title="Insert before the selected line, cancels sorting and selection, cancels sorting and selection.">';
echo '<img id=kb45  src=../../../../d~e~f/tables_4.gif  onclick=ad(1) border=1 title="Insert after the selected line, cancels sorting and selection, cancels sorting and selection.">';
echo '&nbsp;&nbsp;<img src=../../../../d~e~f/tables_29.gif   onclick=bufa(0) border=1 title="Paste from clipboard. ">';
}
?>
&nbsp;&nbsp;
<img id=kb0 onclick='document.getElementById("repo").innerHTML="Go to group 1!";utt(0);' border=1 title="group 1" src=../../../../d~e~f/tables_1-1.gif>
<img id=kb1 onclick='utt(1);' border=1 title="Previous group" src=../../../../d~e~f/tables_2.gif>
<img id=kb2 onclick='utt(2);' border=1 title="Next group" src=../../../../d~e~f/tables_3.gif>
<img id=kb3 onclick='utt(3);' border=1 title="Last group" src=../../../../d~e~f/tables_4-1.gif>
&nbsp;&nbsp;
<?php
if  ($glob!=1)
{echo '<img id=obn onclick="re(55);" border=1 title="Refresh, load table data from file, discards all unsaved changes." src=../../../../d~e~f/tables_5.gif>';
echo '&nbsp;&nbsp;';
}
?>
<img id=big src=../../../../d~e~f/tables_12.gif onclick=bw(this)  title="Edit in a large window." border=1>
<img onclick='document.getElementById("repo").innerHTML="Show properties";col(this);' title="Column properties." src=../../../../d~e~f/tables_16.gif border=1>
<img onclick=hel(this) title="User guide." src=../../../../d~e~f/tables_15.gif border=1>
&nbsp;&nbsp;&nbsp;
<?php
if (strpos($tabl, "_")==0)         // 
{if  ($glob!=1)
{echo '<img id=ko onclick="com(this);" border=1  title="Administrator commands." src=../../../../d~e~f/tables_22.gif>';
}
else
{echo '<img id=ko onclick="com(this);" border=1 style="display:none" title="Administrator commands." src=../../../../d~e~f/tables_22.gif>';
}}
?>
&nbsp;&nbsp;&nbsp;
<img onclick='document.getElementById("repo").innerHTML="The column is hidden!";hid(this);' title="Hide column." border=1 src=../../../../d~e~f/tables_17.gif>
<img onclick='document.getElementById("repo").innerHTML="Column hiding is canceled!";vis(this);' border=1 title="Show all columns." src=../../../../d~e~f/tables_18.gif>
&nbsp;&nbsp;
<img src=../../../../d~e~f/tables_91.gif border=1 onclick="selad(this)" title="Add the value of the selected cell to the selection list." >
<img  onclick='sel(this)' border=1 title="Open the selection form (filter)." src=../../../../d~e~f/tables_9.gif>
<img id=group_only onclick='sel1(this,0);'  border=1 title="Make a selection 'only' on the group." src=../../../../d~e~f/tables_100.gif>
<img  onclick='sel1(this,1);' border=1 title="Make a selection 'except' on a group." src=../../../../d~e~f/tables_102.gif>
<img  onclick='sel1(this,2);' border=1 title="Perform selection on the server." src=../../../../d~e~f/tables_101.gif>
<img id=select_cancel  onclick='selca(1)' border=1 title="Deselect or show all rows." src=../../../../d~e~f/tables_25.gif>
&nbsp;&nbsp;
<img onclick='document.getElementById("repo").innerHTML="Sorted ascending!";sort(1);' title="Sort ascending." border=1  src=../../../../d~e~f/tables_19.gif>
<img onclick='document.getElementById("repo").innerHTML="Sorted Descending!";sort(2);' title="Sort Descending" border=1  src=../../../../d~e~f/tables_20.gif>
<img onclick='document.getElementById("repo").innerHTML="Sorting canceled!";otm2(1);'  title="Cancel sorting." border=1 src=../../../../d~e~f/tables_21.gif>
&nbsp;&nbsp;
<?php
if ($glob!=1)
{echo '<img onclick="def1(0)" title="Make default temporary." border=1 src=../../../../d~e~f/tables_23.gif>';
echo '&nbsp;&nbsp;';
}
?>
<img onclick='sum1(0);' title="Show sums of numeric columns" border=1 src=../../../../d~e~f/tables_24.gif>
<img height=20 onclick='fromc()'  title="Insert date from the calendar. In the text, insert the current: date time." border=1 src=../../../../d~e~f/d.gif>
<img height=20 onclick='fromk()'  title="Paste from calculator." border=1 src=../../../../d~e~f/c.gif>
&nbsp;<img  onclick=selall(this)  src=../../../../d~e~f/no.gif title="Mark/Unmark to delete a group row.">
&nbsp;
<?php
echo $sss2;          // 
echo '<img onclick="re(0)" id=re0 border=1 title="Save on the server, after saving updates the table, canceling selection, sorting. " src=../../../../d~e~f/tables_7.gif>';
//****************************************************************************************************
//                          
//*****************************************************************************************************************
$fdo2=getcwd()."/script/~button-script.htm";
if  (file_exists($fdo2))  
{include $fdo2;
}
?>
</td></tr>
<tr style=background:silver><td align=left valign=top>
<!---------------------------------------- ------------------------------------------>
<form id="form"  action="<?php   echo $pz; ?>&v=10" method="post" enctype="multipart/form-data" >
<input type=hidden name="mins" value="">
<input type=hidden name="madd" value="">
<input type=hidden name="mdel" value="">
<input type=hidden name="mrep" value="">
<input type=hidden name="napr" value="0">
<input type=hidden name="ns" value="0">    <!--  --->
<input type=hidden name="com"  value="">  <!--  --->
<input type=hidden name="st1"  value="">  <!--  --->
<input type=hidden name="st2"  value="">  <!--  --->
<input type=hidden name="st3"  value="">  <!--  --->
<input type=hidden name="st4"  value="">  <!--  --->
<input type=hidden name="st5"  value="">  <!--  --->
<input type=hidden name="stt1"  value="">  <!-- --->
<input type=hidden name="stt2"  value="">  <!--  --->
<input type=hidden name="stt3"  value="">  <!--  --->
<input type=hidden name="soob" value="">  
<input type=hidden name="pa" value="">  
<input type=hidden name="pain" value="<?php  echo $pain; ?>">  
<input type=hidden name="mmon" value="">  
<input type=hidden name="pp"  value="<?php  echo $pp; ?>">
<input type=hidden name="pptable"  value="<?php  echo $totable; ?>">
<input type=hidden name="totable"  value="<?php  echo $totable; ?>">
<input type=hidden name="tbeg"  value="<?php echo $tbeg;   ?>">
<input type=hidden name="tend"  value="<?php echo $tend;   ?>">
<input type=hidden name="mob"  value="<?php echo $mob; ?>">
<input type=hidden name="ggg"  value="<?php echo $ggg; ?>">
<input type=hidden name="kstol"  value="">
<input type=hidden name="rel"  value="">   <!---  --->
<input type=hidden name="glob" value="<?php echo $glob; ?>">
<input type=hidden name="retu2" value="<?php echo $retu2; ?>">
<input type=hidden name="zag5" id=zag5 value="<?php echo $zag5; ?>"><!---  --->
<input type=hidden name="vers2" id=vers2 value="">
<input type=hidden name="save" id=save value="">   
<input type=hidden name="from_reddoc" id=from_reddoc value="">

<input type=hidden name="s2" value="">   <!---  --->
<input type=submit  value="" name=submit id=submit style="display:none">
<input type=submit  value="" name=sele id=sele  style="display:none">
<input type=hidden  value="" name=kontr id=kontr style="display:none"> <!---  --->
<input type=hidden  value="" name=bufv id=bufv value="">      <!---  --->
<input type=submit name=bufv2 id=bufv2 style="display:none"> <!---  --->
<input type=hidden name="xboct" value="" >  
Charts:
<font style="border:silver thin solid" title="Disable charts.">no<INPUT id=otkL onclick="form.elements['ggg'].value='';re(56);" type=radio name="g"></font>
<font style="border:silver thin solid" title="Include graphics and place them in one column." >1<INPUT onclick="form.elements['ggg'].value=1;re(56)" type=radio   name="g"></font>
<font style="border:silver thin solid" title="Include graphics and place them in 2 column.">2<INPUT  onclick="form.elements['ggg'].value=2;re(56)" type=radio name="g"></font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button form="" onclick=tabtop() style="background:white;color:brown" title="Print table." ><b>&nbsp;P&nbsp;</b></button>&nbsp;&nbsp;
LINES:
<font style="border:silver thin solid" title="Set the group size to 10 rows and show it from the beginning of the table."  >10<INPUT onclick="ut(0)" type=radio value=10 <?php  if ($v==10)  { echo "CHECKED";} ?>  name="v"></font>
<font style="border:silver thin solid" title="Set the group size to 50 rows and show it from the beginning of the table.">50<INPUT onclick="ut(0)" type=radio value=50  <?php  if ($v==50)  { echo "CHECKED";}   ?>     name="v"></font>
<font style="border:silver thin solid" title="Set the group size to 100 rows and show it from the beginning of the table." >100<INPUT  onclick="ut(0)" type=radio value=100 <?php  if ($v==100)  { echo "CHECKED";}   ?>   name="v"></font>
<font style="border:silver thin solid" title="Set the size of all rows and show it from the beginning of the table.">all <INPUT  onclick="ut(0)"  type=radio value=999999 <?php  if ($v==999999)  { echo "CHECKED";}   ?>     name="v"></font>
to  &nbsp;<input type=text name="to" value="<?php echo $to;?>" style="width:45" > &nbsp;&nbsp; 
<button onclick='document.getElementById("repo").innerHTML="Jump by line number done!";go(0);'
 title = "Show installed group,
  starting from the entered number.
  Left last selected line number
  before contacting the server. " style="background:white"><b>Go!</b></button>
 &nbsp;Total:&nbsp;<b id=tmax><?php echo $kol;?></b> 
&nbsp;shown:&nbsp;<b id=pokz>0</b>
<!--      --->
<?php
$fdo2=getcwd()."/script/~submit.htm";
if  (file_exists($fdo2))  
{include $fdo2;}
?>
</form>
<div id=prov1 style="display:none"></div>
<textarea id=prov style="display:none" ></textarea>
<?php
if ($mob==0)
{echo '<a  id=hel href="../../../../sampl/baza1/st1.htm" target=_blank style="display:none"><b>&nbsp;Help&nbsp;</b></a>';}
else
{echo '<a  id=hel href="../../../../sampl/baza1/st1.htm" target=_blank style="display:none"><b>&nbsp;Help&nbsp;</b></a>';}
echo '<b id=sname2 style=display:none>';
include "../../../../plan/name.txt";
echo '</b>';
?>
<i id=tsort style=display:none></i>
<i id=tsel style=display:none></i>
<i id=vsel style=display:none></i>
</td></tr>
</table>

<table id=err  border=0 style="display:none;width:100%;height:100%;z-index:3;position:absolute;top:30px;left:0px;">
<tr>
<td width=30%> </td>
<td width=30% valign=top align=center>
<center style="background:brown;color:yellow"><b>TABLE ERRORS - CANCEL:</b>      
<button style="background: #ffdead;" onclick=err_close() title="Close  window.">&nbsp;&nbsp;X&nbsp;&nbsp;   </button>   
</center>
<div id=err2 style="height:350;width:800;OVERFLOW: scroll;background:#faebd7"><?php echo $os2;?>
</div></td><td width=30%> </td></tr></table>
<script type="text/javascript">
//*************************************** *********************************
var obj=""      // 
var obji=0      // 
var objt=0      // 
var objk=0      // 
var mss=""
var mk1ss=""  
var mst=""    
var mk1st=""
var mtextarea=""
var mdis=" ,"    // 
var msap=""     // 
var prs=false   //
var table = new Array();                     // 
var spis = new Array();                      // 
var msel = new Array();                      // 
var mpok = new Array();                      // 
var mzag = new Array();                      // 
var mzagpok = new Array();                   // 
var mref = new Array();                      // 
var ref="";                                  // 
var dp="";
var dp1="";
var vib=false;                                 //
var mob=false;
var bods=0;                                    //
var pclick=document.getElementById("bod");     //
var monn=false;                                //
<?php
echo "tab2='".$tabl."';";
?>
par=document.getElementById("form").action
par1=par.split('tables.php')
mpar=par1[1].split('/')



//*****************************************************
function err_close()
//****************************************************
{document.getElementById("err").style.display="none"}

<?php
if ($mob==0)
{echo "mob=false";}
else
{echo "mob=true";}

if  ($mpod==2)                                    // 
{$selected2= file(getcwd()."/select2.txt");       // 
echo "\r\nselected2='".$selected2[0]."'\r\n";     // 
}
if  ($mpod==3)                                    // 
{$selected3= file(getcwd()."/select3.txt");       // 
echo "\r\nselected3='".$selected3[0]."'\r\n";     // 
}
?>
//************************************************************************************************************
                                   window.onload=function ()    // 
//************************************************************************************************************
{if(document.getElementById('t').getElementsByTagName("TR").length==0)       // 
{alert("TABLE EMPTY!")
return
}
if (document.getElementById('err2').innerHTML!="")
{
//alert("+"+document.getElementById('err2').innerHTML+"+")	
	
	document.getElementById('err').style.display=""}
//***************************************************************************
if (document.getElementById('tabl_sel')!=undefined)      //
{<?php
if  ($mpod==2)      //
//***************************************************************************
{echo "opt_arr=document.getElementById('tabl_sel').options    // \r\n";
echo "for(var j = 0; j < opt_arr.length; j++)\r\n";	
echo "{if (opt_arr[j].value==selected2)                    // \r\n";
echo "{document.getElementById('tabl_sel').selectedIndex=j   // \r\n";
echo "break}\r\n";
echo "}";
}
if  ($mpod==3)      // 
//***************************************************************************
{echo "opt_arr=document.getElementById('tabl_sel').options    //\r\n";
echo "for(var j = 0; j < opt_arr.length; j++)\r\n";	
echo "{if (opt_arr[j].value==selected3)                      // \r\n";
echo "{document.getElementById('tabl_sel').selectedIndex=j   // \r\n";
echo "break}\r\n";
echo "}";
}
?>	
}
devdate=new Date();
var y="";
y=devdate.getFullYear()
var m="";
m=devdate.getMonth()+1
var c="";
c=devdate.getDate();
var d="";
d=devdate.getDay();
dp=y+"-"+m+"-"+c+"-"+d
dp1=y+"<br>"+m+"<br>"+c
ref=location.href.split("gidra")[1].split("contents")[0]
pzz=document.getElementById("form").action
mpzz=pzz.split("/")
fl=window.top.frames
<?php
if  (file_exists(getcwd ( ).'/1s/m.txt'))                //
{echo ";monn=true;";}                                    //
else
{echo ";monn=false;";}	                                 //

if  (file_exists($abs1.'otd/odin.txt'))                  //
{echo ";mnogo=false;";
echo ";monn=true;";
}                                                       // 
else
{echo ";mnogo=true;";}	                                // 
?>

//*****************************************************************************************
//
//
//****************************************************************************************
if (document.getElementById("repo").innerHTML.indexOf("monopoly")>=0)
{if (mpar.length==1)                             // 
{if (fl[1]!=undefined)                           // 
{fl[1].document.getElementById("obn").click()	 // 
}
if (fl[2]!=undefined)
{fl[2].document.getElementById("obn").click()		
}}	
//*******************************
if (mpar.length==2)       // 
{if (fl[0]!=undefined)
{fl[0].document.getElementById("obn").click()}
if (fl[2]!=undefined)
{fl[2].document.getElementById("obn").click()}
}
//*******************************
if (mpar.length==3)       // 
{

//alert(window.top.document.getElementById("ifr2").style.visibility)

if (fl[0]!=undefined)
{fl[0].document.getElementById("obn").click()}
if (fl[1]!=undefined)
{fl[1].document.getElementById("obn").click()}
}}

if (mpzz[mpzz.length-1].indexOf("-")<0)                  // 
{if  (monn)                                              // 
{if (mnogo)
{document.getElementById('monopoly').style.background="yellow"
document.getElementById('monopoly').title="Monopoly in multiplayer mode (multi-user mode)"
}	
else
{document.getElementById('monopoly').style.background="#7fff00"
document.getElementById('monopoly').title="Monopoly in single user mode, canceled by canceling single user mode."
if (window.top.document.getElementById('refe').innerHTML.indexOf("reddoc")>=0)    //
{
form.elements["from_reddoc"].value="yes"
}

}
document.getElementById('monopoly').style.display=""                            // 
if (window.top.document.getElementById('refe').innerHTML.indexOf("reddoc")<0)    //
{if (mnogo)                                               //
{document.getElementById('mono').style.display=""}       // 
 monn=true
}                                                        // 
}
else
{document.getElementById('monopoly').style.display="none"   // 
}}
if (window.top.document.getElementById('refe').innerHTML.indexOf("reddoc")<0)    //
{document.getElementById("ko").style.display="none"        //
document.getElementById("ko1").style.display="none"
document.getElementById("ko2").style.display="none"
document.getElementById("ko3").style.display="none"
mrepp=document.getElementById("repo").innerHTML
mrepp=mrepp.replace("\r\n","")
form.elements["vers2"].value=window.top.document.getElementById("ver").innerHTML  //
if (mrepp=="saved" || mrepp=="added")
{window.top.document.getElementById("papa").innerHTML="-"
}}
else                                                           //
{
if (monn)                                                      // 
{document.getElementById("ki").disabled=false
document.getElementById("kv").disabled=false
document.getElementById("ku").disabled=false
}
else
{document.getElementById("ki").disabled=true
document.getElementById("kv").disabled=true
document.getElementById("ku").disabled=true
}
document.getElementById("ko4").style.display="none"}
mtip=tip.split("```")    //
mdef=def.split("```") 
mpod=pod.split("```")     
mminmax=minmax.split("```")
msabl=sabl.split("```")     
moboz2=oboz2.split("```")     
mopis=opis.split("```")     
if (document.getElementById("t").clientWidth==0)
{ document.getElementById("bod").style.visibility="visible";
("The table is EMPTY!")
document.getElementById("p2").style.display="none";
return
}
 document.getElementById("bod").style.visibility="visible"
//
document.getElementById("s").style.width=document.getElementById("t").clientWidth
document.getElementById("textarea").width=document.getElementById("t").clientWidth
//
mss=document.getElementById("std").getElementsByTagName("TD")   // 
mst=document.getElementById("t").getElementsByTagName("TR")     // 
mpok.length=mst.length     
mstd=mst[0].getElementsByTagName("TD")                          // 
mzag.length=mstd.length
mzagpok.length=mstd.length

for(var i = 0; i < mzag.length; i++)        //
{mzag[i]=mstd[i].outerHTML
mzagpok[i]=true
}
mref1=document.getElementById("ref1").getElementsByTagName("TR")     //
for(var i = 0; i < mref1.length; i++)                                //
{mref11=mref1[i].getElementsByTagName("TD")
mref[i]=mref11[6].innerHTML
}
mtextarea=document.getElementById("textarea").getElementsByTagName("TEXTAREA")
kss=1
table.length=mst.length-kss                  //
for(var i = 0; i < table.length; i++)        //
  {table[i] = new Array()
  table[i].length=mstd.length
  }
 for(var j = 0; j < table.length; j++)       // 
{mstd1=mst[j+1].getElementsByTagName("TD") 
  for(n = 0; n < table[j].length; n++) { 
 table[j][n] =mstd1[n].innerHTML
 }}

 ////// 
<?php
if ($ggg!="")     // 
{$nnn=0;
foreach ($mmtip as $tipi => $tipl)                 // 
{$mtipl=substr($tipl, 0,1);
if (($nnn>1) and ($mtipl=="i" or $mtipl=="$"))        // 
{echo 'document.getElementById("ifrg'.$nnn.'").src="../../../../sampl/baza1/gr.php?col='.$nnn.'";';
}
$nnn++;
}}
// 
// Y 1 
// Y 2 
// Y 3 
// 
////  
?>
otm3=form.elements["ggg"].value
if (isNaN(otm3))
{otm3=0}
jk=0
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{if (fli[j].name=="g" )
{if  (jk==otm3)
{fli[j].checked=true
if (jk==0)
{form.elements["ggg"].value=""
}}
else
{fli[j].checked=false}
jk++
}}
msap=mst[0].outerHTML
document.getElementById("div").style.height=document.getElementById("h").offsetHeight-220



//----------------------------------------------
// 
// 
//----------------------------------------------
spis.length=mtip.length                      // 
for(var i = 0; i < spis.length; i++)         // 
{spis[i] = new Array()                        // 
if (mtip[i]=="L")                            // 
{iss="list"+(i)                              // 
mssl=document.getElementById(iss).getElementsByTagName("TR")    // 
spis[i].length=mssl.length                                      // 
for(var ii = 0; ii < mssl.length; ii++)                         // 
{mmssl=mssl[ii].getElementsByTagName("TD")                       //
spis[i][ii]=mmssl[1]                                            // 
}
}
else
{spis[i].length=1                                      // 
spis[i][0]=""
}} 

//************************************************
// 
//**********************************************
mst1=""
msel.length=mtip.length                      // 
for(var i = 0; i < msel.length; i++)         // 
{msel[i] = new Array()             
 msel[i].length=3
 mst1=mst1+"#"
 for(var ii = 0; ii <3; ii++)                // 
 {msel[i][ii]=""
}}

restore_conditions=false
w7=document.getElementById("tabl_sel")
if (w7!=undefined)
{tnap=w7.options[w7.selectedIndex].text
if (window.top.st_tabl==tnap)
{restore_conditions=true
// 
}
}


if (mpar.length==1)
{if  (window.top.st1=="" || !restore_conditions) 
{mmst1=mst1
mmst2=mst1
mmst3=mst1}
else
{mmst1=window.top.st1
mmst2=window.top.st2
mmst3=window.top.st3
}}

if (mpar.length==2)
{if  (window.top.st21=="" || !restore_conditions )
{mmst1=mst1
mmst2=mst1
mmst3=mst1}
else
{mmst1=window.top.st21
mmst2=window.top.st22
mmst3=window.top.st23}}

if (mpar.length==3)
{if  (window.top.st31=="" || !restore_conditions)
{mmst1=mst1
mmst2=mst1
mmst3=mst1}
else
{mmst1=window.top.st31
mmst2=window.top.st32
mmst3=window.top.st33}}

mmst1="#"+mmst1
mmst2="#"+mmst2
mmst3="#"+mmst3
mpar1=mmst1.split('#')
mpar2=mmst2.split('#')
mpar3=mmst3.split('#')


//**************************
// 
//**************************
 props='<div onclick=zus(event) style="height:217;OVERFLOW: scroll"><center><b style=color:brown>Selection, if all conditions are met:</b></center>'+ 
'<table id=selp width=100% border=1><tr style="background:grey;color:white">'+
'<td>'+
'<b>N</b></td><td><b>Column</b></td><td><b>Type</b></td><td>'+
'<b>Conditions</b></td></tr>'
 for(var i=1; i<mss.length-1; i++)                            // 
 {props=props+"<tr><td>"+(i+1)+"</td><td onclick=clpv(this)>"+mss[i].title+'</td><td >'+mtip[i]+"</td><td>"
 if (mtip[i]=="d")
 {props=props+"&nbsp;from&nbsp;&nbsp;<input lang='' value='"+mpar1[i]+"' readonly name=minn  style='width:80;background:#ffdead' type=text>"
 props=props+"&nbsp;to&nbsp;&nbsp;&nbsp;<input lang='' value='"+mpar2[i]+"' readonly  name=maxx  style='width:80;background:#ffdead' type=text>"
 props=props+"<br> or in the list<br><input lang='' value='"+mpar3[i]+"' readonly name=spi style='width:290;background:#ffdead' type=text>" 
 }
 if (mtip[i]=="i")
 { props=props+"&nbsp;from&nbsp;&nbsp;<input lang='' value='"+mpar1[i]+"' readonly name=minn style='width:100;background:#ffdead' type=text>"
 props=props+"&nbsp;to&nbsp;&nbsp;&nbsp;<input lang='' value='"+mpar2[i]+"' readonly name=maxx style='width:100;background:#ffdead' type=text>"
 props=props+"<br> or in the list<br><input lang='' value='"+mpar3[i]+"' readonly name=spi style='width:290;background:#ffdead' type=text>" 
 }
 if (mtip[i]=="$")
 { props=props+"&nbsp;from&nbsp;&nbsp;<input lang='' value='"+mpar1[i]+"' readonly   name=minn style='width:100;background:#ffdead' >"
 props=props+"&nbsp;to&nbsp;&nbsp;&nbsp;<input lang='' value='"+mpar2[i]+"' readonly name=maxx style='width:100;background:#ffdead' type=text>"
 props=props+"<br> or in the list<br><input lang='' value='"+mpar3[i]+"' readonly name=spi style='width:290;background:#ffdead' type=text>" 
 }
if (mtip[i]=="a") 
{props=props+" in the list <input lang='' value='"+mpar3[i]+"' readonly name=spi style='width:230;background:#ffdead' disabled title='in this version there is no selection by reference' type=text>"
}
if (mtip[i]=="t")
{props=props+" in the list <input lang='' value='"+mpar3[i]+"' readonly name=spi style='width:230;background:#ffdead' type=text >"
} 
if (mtip[i]=="L")
{if (mpar3[i].indexOf("+++")>0)
{mzn3=mpar3[i].split("+++")
zval=' value="'+mzn3[0]+'"'
ztit=' title="'+mzn3[1]+'"'
}
else
{zval=' value="'+mpar3[i]+'"'
ztit=""
}
props=props+" in the list <input lang='' "+zval+ztit+"' readonly name=spi style='width:230;background:#ffdead' type=text >"
} 
props=props+'</td></tr>'
 }
 props=props+'</table></div><small> TYPES: &nbsp;t-text; &nbsp;&nbsp;d-date;&nbsp;&nbsp;'+
'i is an integer;&nbsp;&nbsp;$-money;&nbsp;&nbsp;L-list;a-link. '+
'To cancel the field condition, click in "Column". The separator of values in a list is the /, '+
'The list must end with a separator. Re-entering clears the field.</small>'
document.getElementById("sel1").innerHTML=props
if (form.elements["pp"].value=="" && mpar.length==1)        //
{if (table.length==0)                                       //
{if (window.top.document.getElementById("ifr1")!=undefined)
{window.top.document.getElementById("ifr1").style.visibility="hidden";}
if (window.top.document.getElementById("ifr2")!=undefined)
{window.top.document.getElementById("ifr2").style.visibility="hidden";}
}
document.getElementById("zag").innerHTML=window.top.document.getElementById('zag').innerHTML
}
//**********************************************************************************************
if (form.elements["pp"].value=="" && mpar.length==2)    //
{
if (form.elements["glob"].value!=1)
{if (table.length==0)
{if (window.top.document.getElementById("ifr2")!=undefined)
{
window.top.document.getElementById("ifr2").style.visibility="hidden";}

}
document.getElementById("zag").innerHTML=window.top.document.getElementById('zagf').innerHTML
}
else
{
document.getElementById("zag").innerHTML="ALL ROWS"
}
}
//*************************************************************************
if (form.elements["pp"].value=="" && mpar.length==3)         //
{if (form.elements["glob"].value!=1)
{if (window.top.tabl_2_server)                               //
{document.getElementById("zag").innerHTML=window.top.tabl_2_server_zag+"/"+ 
window.top.document.getElementById('zags').innerHTML
}
else
{document.getElementById("zag").innerHTML=window.top.document.getElementById('zagf').innerHTML+" / "+window.top.document.getElementById('zags').innerHTML
}}
else
{document.getElementById("zag").innerHTML="ALL ROWS"}
}
if  (form.elements["mob"].value==1)   {document.getElementById("bod").scrollTop=0}
 <?php
 if (isset ($_REQUEST['add']))          // 
 { echo 'mst[mst.length-1].click()'."\r\n";
 echo 'ad(1)'."\r\n";
 }
 ?>
otm(1)
crz(1)
jdv(1)

if (form.elements["glob"].value!=1)                 //
{selc(1)}                                           //
seltext()                                           //
}

obj1=""
//****************************************************************************
function rw()     //  
//****************************************************************************
{if (form.elements["mob"].value==1) 
{window.document.body.scrollTop=bods}
else
{document.getElementById("div").scrollTop=bods}
document.getElementById("repo").innerHTML="Return to the selected line."   
}

winp=""    // 
winz=""    // 
//******************************************************************************
function textareaclick(p)  // 
//******************************************************************************
{if (obj1=="")
{alert("No row selected for editing, \r\nclick the row and repeat!")
return
} 
isort=""
if (prs)
{}
else
{if (p.title=="")
{p.style.background="yellow"
p.title="Ok"
document.getElementById("lis").style.display="none"
document.getElementById("list").style.display="none"
document.getElementById("ref").style.display="none"
da=false
if (obj1!="")        // 
{obj1.style.background="#fff8dc"
obj1.title=""
}}
else
{da=true
}}
obj1=p
da=true
ik=parseInt(p.id.replace("ta",""),10)
if (typeof do_focus==='undefined')
{if (p.value.length>=200)
{bw(1)
}}
else
{do_focus(ik)
}
qwe=mss[ik].title
qwe=qwe.replace(/<br>/g," ")
qwe=qwe.replace(/<BR>/g," ")
document.getElementById("repo").innerText=qwe
if (mzag[ik].indexOf("^")>0)   // 
{return
}

if (qwe.indexOf("=")>0)
{document.getElementById("add2").disabled=true
document.getElementById("dob3").disabled=true
document.getElementById("dob3").src="../../../../d~e~f/no.gif";
document.getElementById("liss").innerHTML=".";
}
else
{document.getElementById("add2").disabled=false
document.getElementById("dob3").disabled=false
}
if (qwe.indexOf("!")>0)
{document.getElementById("add2").disabled=true
document.getElementById("dob3").disabled=true
document.getElementById("dob3").src="../../../../d~e~f/no.gif";
document.getElementById("liss").innerHTML=".";
}
if (mpod[ik]!="" && da && mtip[ik]!="L" && mtip[ik]!="a"  )     // 
{mmsq=document.getElementById("lisdiv").getElementsByTagName("div") 
for(var i=0; i<mmsq.length; i++)  
{mmsq[i].style.display="none"
kp="-"+ik+"-"
if (mmsq[i].id.indexOf(kp)>0)
{mmsq[i].style.display=""
winz=mmsq[i]
winp=winz
document.getElementById("lis").style.display=""
}}

if (mtip[ik]=="t")
{document.getElementById("add2").style.display=""}
else
{document.getElementById("add2").style.display="none"}
document.getElementById("lissi").innerHTML=mss[ik].title
if  (form.elements["mob"].value==1) 
{document.getElementById("bod").scrollTop=0}
}
else
{if (mtip[ik]=="L")
{
mmsq=document.getElementById("listdiv").getElementsByTagName("div") 
for(var i=0; i<mmsq.length; i++)  
{mmsq[i].style.display="none"}
document.getElementById("pods2").disabled=true
if (document.getElementById("pods1").disabled)
{document.getElementById("pods1").disabled=false
document.getElementById("pods3").disabled=false
document.getElementById("pods4").disabled=false
document.getElementById("pods5").disabled=false
document.getElementById("ko1").disabled=false
}
document.getElementById("list").style.display=""
document.getElementById("list"+(ik)).style.display=""
winp=document.getElementById("list"+(ik))
document.getElementById("listsi").innerHTML=mss[ik].title
if  (form.elements["mob"].value==1) 
{document.getElementById("bod").scrollTop=0}
}
if (mtip[ik]=="a")
{document.getElementById("ref").style.display=""
winp=document.getElementById("ref1")
document.getElementById("ref1").style.display=""
document.getElementById("refsi").innerHTML=mss[ik].title
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
}}}


//******************************************************************************
function bw(p)               // 
//******************************************************************************
{if (obj1=="")
{alert("No row selected for editing, \r\nclick the row and repeat!")
return
} 
ik=parseInt(obj1.id.replace("ta",""),10)
if (ik==0)
{alert("The order number cannot be edited!")
return
}
// 
if (mss[ik].title.indexOf("=")>0 || mss[ik-1].title.indexOf("=")>0 || mss[ik].title.indexOf("!")>0  )
{alert("Only from the value table!")
return
}
if  (mtip[ik]!="L" && mtip[ik]!="a" )
{if (mob)
{document.getElementById("textarea_for_red").value=obj1.value
h.style.visibility="visible";
zii.style.display="";
document.getElementById("textarea_for_red").focus()
}
else
{qwe=mss[ik].title
qwe=qwe.replace(/<br>/g," ")
qwe=qwe.replace(/<BR>/g," ")
document.getElementById("redp").innerHTML=qwe
if (qwe.indexOf("^")>0)
{document.getElementById("zii2t").readOnly=true
document.getElementById("bwr").style.display="none"
}
else
{document.getElementById("zii2t").readOnly=false
document.getElementById("bwr").style.display=""
}
document.getElementById("zii2t").value=obj1.value
zii2.style.display="";
document.getElementById("zii2t").focus()
}}
else
{alert("Lists and links are not \r\neditable in the big window!")
}}
//***************************************************************************************
function buttons_for_red(j) //
//***************************************************************************************
{bods1=bods
if (typeof do_before1==='undefined')
{}
else
{if (!do_before1(ik))                                   // 
{mimg=objj.parentNode.getElementsByTagName("IMG") 
mimg[0].src="../../../../d~e~f/no.gif"
return
}}
if (j==2)   // 
{obj1.value=document.getElementById("zii2t").value
objj.click()
zii2.style.display="none";
}
if (j==1)   // 
{obj1.value=document.getElementById("textarea_for_red").value
objj.click()
h.style.visibility="hidden";
zii.style.display="none";}
obj=""
document.getElementById("bod").scrollTop=bods1
}
//*********************************
objj=""
ivs=0              // 
mktst=0
var otmm=false    // 
var objiz=9999; nniz=999999
//*************************************************************************************************
//                   
//*************************************************************************************************
function stc(pp,event)
{// 
if  (form.elements["mob"].value==1)
{bods=parseInt(window.document.body.scrollTop)
}
else
{bods=parseInt(document.getElementById("div").scrollTop)    // 
}
otmm=false                                                   //
event = event || window.event
var t = event.target || event.srcElement
if (t.tagName=="A") {return}
mktst=pp.getElementsByTagName("TD")  
for(var i=0; i<mtextarea.length; i++)
{if (mktst[i].offsetLeft==t.offsetLeft && mtextarea[i].title=="Ok" )
{if (i==0)
{mmm5=" "+t.parentNode.style.background
if (mmm5.indexOf('yellow')>0 )
{f555();return}
}
else
{if (postr2)
{postr2=false
}
else
{obj1.focus()
}}}}
for(var i=0; i<mtextarea.length; i++)
{mtextarea[i].title=""
mtextarea[i].style.background="#fff8dc"
}
nni=0
for(var i=0; i<mtextarea.length; i++)
{if (mktst[i].offsetLeft==t.offsetLeft)
{mtextarea[i].title="Ok"
mtextarea[i].style.background="yellow"
nni=i
obj1=mtextarea[i]
break
}}
if  (t.tagName=="IMG")
{if (!monn && 
parseInt(pp.getElementsByTagName("TD")[0].innerHTML,10)<=parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n in exclusive mode can delete \r\nsaved lines or undo a change !")
}
else
{fl=window.top.frames
if (t.outerHTML.indexOf("no.gif")>0)
 { t.src="../../../../d~e~f/yes.gif"
table[pp.getElementsByTagName("TD")[0].title-1][mtextarea.length]=t.parentNode.innerHTML
 }
 else
{if (t.outerHTML.indexOf("yes.gif")>0)
 { t.src="../../../../d~e~f/no.gif"
 table[pp.getElementsByTagName("TD")[0].title-1][mtextarea.length]=t.parentNode.innerHTML 
 }}}}
 if  (form.elements["mob"].value==1 && i>0) 
{window.top.document.getElementById("bod").scrollTop=999999
mtextarea[0].scrollIntoView(top)
}
if (objj!="" && !prs)                           //
{min=objj.getElementsByTagName("IMG")
mktst=objj.getElementsByTagName("TD")           //
for(var i=0; i<mtextarea.length; i++)           
{if (mtip[i]=="a")
{msss=mktst[i].getElementsByTagName("A")  
mtex=msss[0].title
}
else
{mtex=mktst[i].innerHTML
}
if (mtextarea[i].value!=mtex)    //
{if (typeof do_before==='undefined')
{}
else
{if (!do_before())                                   //
{mimg=objj.parentNode.getElementsByTagName("IMG") 
mimg[0].src="../../../../d~e~f/no.gif"
return
}}

//*************************************
// 
//*************************************
msstr1=" ,0,1,2,3,4,5,6,7,8,9,"
//**********************************************
// 
if (mtip[i]=="t")
{ree=mtextarea[i].value         // 
ree=ree.replace(/<br>/g," ")
ree=ree.replace(/<BR>/g," ")
document.getElementById("prov1").innerHTML=ree 
document.getElementById("prov").value=document.getElementById("prov1").innerHTML
max3=mminmax[i].split(",")[1]
if ( mtextarea[i].value.length>max3)
{if (confirm("In "+(i+1)+" - violation of text length " +mminmax[i] +",\r\n characters entered "+ mtextarea[i].value.length+".\r\n Shorten the text and repeat! \r\n Click Cancel to cancel"))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true
}}
// 
qwe=" "+document.getElementById("prov").value
}
//*****************************************************************************
// 
if (mtip[i]=="i")
{msstr=mtextarea[i].value.split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(","+msstr[ii]+",")<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (confirm("In "+(i+1)+" non-numeric value, enter an integer! \r\n Click Cancel to cancel"))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true;return}
}}}
msstr=mminmax[i].split(",")        
mini=parseInt(msstr[0],10)
maxi=parseInt(msstr[1],10)
teki=parseInt(mtextarea[i].value,10)
if (mtextarea[i].value=="")           // 
{}
else
{if  (teki<=maxi && teki>=mini ) {} else
{if (confirm("In "+(i+1)+" violation of the range of values: " +mminmax[i] +", enter an integer in the interval and repeat! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}}
//******************************************************************************************************
// 
if (mtip[i]=="$")
{if (mtextarea[i].value=="")
{}
else
{oper=mtextarea[i].value.replace(",",".")
if (oper.lastIndexOf(".")<0)                           // 
{oper=oper+".00"}                                       //
mta=oper.split(".")                                    // 
if (mta.length!=2 || mta[1].length!=2)                                     // 
{if (confirm("In "+(i+1)+" non-monetary value, enter money! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}
if (mta[1].length==1 )                              // 
{oper=oper+"0"}
if (mta.length>2 )                                  // 
{oper=mta[0]+"."+mta[1].substr(0,2);}
mtextarea[i].value=oper
m$=mtextarea[i].value.replace(".","")
msstr=m$.split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (confirm("In "+(i+1)+" non-monetary value, enter money! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true;return}
}}}
msstr=mminmax[i].split(",")  
mini1=msstr[0].replace(".","")
maxi1=msstr[1].replace(".","")
mini=parseInt(mini1,10)
maxi=parseInt(maxi1,10)
teki1=mtextarea[i].value.replace(".","")
teki=parseInt(teki1,10)
if  (teki<=maxi && teki>=mini) {} else
{if (confirm("In "+(i+1)+" violation of the range of values: " +mminmax[i] +", enter money in the interval and repeat! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}}
// 
if (mtip[i]=="d")
{if (mtextarea[i].value=="")
{}
else
{oper=mtextarea[i].value.replace("/",".")
oper=oper.replace("/",".")
oper=oper.replace("/",".")
oper=oper.replace("-",".")
oper=oper.replace("-",".")
oper=oper.replace("-",".")
mta=oper.split(".")                                    //
if (mta.length!=3)                                     //
{if (confirm("In "+(i+1)+" no date format, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}
if (!otmm)
{if (mta[0].length==2)                              //
{}
else
{if (confirm("In "+(i+1)+" wrong day, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{if (mta[1].length==2 )                              //
{}
else
{if (confirm("In "+(i+1)+" wrong month, enter date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{if (mta[2].length==4 )                              //
{}
else
{if (confirm("In "+(i+1)+" Wrong year, enter date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{msstr=mta[0].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (confirm("In "+(i+1)+" Day is not a number, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}}}
if (!otmm)
{msstr=mta[1].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (confirm("In "+(i+1)+" The month is not a number, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}}}
if (!otmm)
{msstr=mta[2].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-" ) {} else{
if (confirm("In "+(i+1)+" Year is not a number, enter a date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}}}
if (!otmm)
{mini=parseInt(mta[0],10)
if  (mini>31 || mini==0 )
{if (confirm("In "+(i+1)+" Day is more than 31 or 0, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{mini=parseInt(mta[1],10)
if  (mini>12 || mini==0 )
{if (confirm("In "+(i+1)+" The month is greater than 12 or 0, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{mini=parseInt(mta[2],10)
if  (mini>2050 || mini<1700 )
{if (confirm("In "+(i+1)+" The year is more than 2050 or less than 1700, enter the date! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}}
if (!otmm)
{if (!validate_date(oper)) 
{alert("Incorrect date entered!")
return;
}}
msstr=mminmax[i].split(",")  
mmini1=msstr[0].split(".")
mini1=mmini1[2]+mmini1[1]+mmini1[0]
mmaxi1=msstr[1].split(".")
maxi1=mmaxi1[2]+mmaxi1[1]+mmaxi1[0]
mini=parseInt(mini1,10)
maxi=parseInt(maxi1,10)
mteki1=mtextarea[i].value.split(".")
teki=parseInt(mteki1[2]+mteki1[1]+mteki1[0],10)
if  (teki<=maxi && teki>=mini) {} else
{if (confirm("In "+(i+1)+" violation of the range of values: " +mminmax[i] +", enter the date in the interval and repeat! \r\n Click 'Cancel' to cancel."))
{return}
else
{mtextarea[i].value=mktst[i].innerHTML;otmm=true}
}
if (!otmm)
{mtextarea[i].value=oper}
}}
if (!otmm)
{document.getElementById("s").style.width=document.getElementById("t").clientWidth
document.getElementById("textarea").width=document.getElementById("t").clientWidth
min[0].src="../../../../d~e~f/yes.gif"       
table[mktst[0].title-1][table[mktst[0].title-1].length-1]=min[0].outerHTML+min[1].outerHTML
for(var ii=0; ii<mtextarea.length; ii++)                            //
{if (mtip[ii]=="a")
{am1="<a "
am1=am1+" title="+mtextarea[ii].value+">...</a>"
ik=parseInt(mtextarea[ii].value.replace("n",""),10)
mktst[ii].innerHTML=am1
}
else
{ree=mtextarea[ii].value
ree1=ree.replace(/</g,"&lt;")
ree1=ree1.replace(/>/g,"&gt;")
mktst[ii].innerHTML=ree1  
mtextarea[ii].value=ree
}
if (mtip[ii]=="L")
{
if (mtextarea[ii].name=="")
{}
else
{table[mktst[0].title-1][ii]=mtextarea[ii].name  //
}}
else
{if (mtip[ii]=="a")
{table[mktst[0].title-1][ii]=am1
}
else
{table[mktst[0].title-1][ii]=mtextarea[ii].value  //
}}}
for(var i=0; i<mstd.length; i++)                              //
{mss[i].style.width=mstd[i].clientWidth}
for(var i=0; i<mstd.length-1; i++)                            //
{if  (mstd[i].clientWidth>0)
{mtextarea[i].style.width=mstd[i].clientWidth-1}
}}
if (typeof do_after==='undefined')     // 
{}
else
{do_after()}
}
else     //
{}
}
objj.style.background="" 
}
mktst=pp.getElementsByTagName("TD")         //
obji=mktst[0].title
for(var i=0; i<mtextarea.length; i++)      // 
{if (mtip[i]=="a")
{msss=mktst[i].getElementsByTagName("A")  
mtextarea[i].value=msss[0].title
}
else
{mtextarea[i].value=mktst[i].innerHTML
}}
pp.style.background="yellow"
objj=pp
if (document.getElementById("imb")!=undefined)
{
if  (t.tagName=="TD" &&  (t.innerHTML.indexOf('yes.gif')>0 || t.innerHTML.indexOf('no.gif')>0))
{
document.getElementById("imb").click()
}
}
prs=false
}


//**********************************************************************************************
function kc(p)                       // 
//**********************************************************************************************
{if ( objj=="" || document.activeElement.tagName=="INPUT" ) {return}
if (document.getElementById("list").style.display=="none" &&  zii.style.display=="none" 
&& document.activeElement.tagName!="TEXTAREA" && document.getElementById("sel").style.display=="none" && document.getElementById("com").style.display=="none"  )
{if (p==33)   // PageUp 
{//document.getElementById("kb1").click()
}
if (p==34)   // PageDown
{//document.getElementById("kb2").click()
}
if (p==36)   // Home 
{//document.getElementById("kb0").click()
}
if (p==35)   // End 
{//document.getElementById("kb3").click()
}
if (p==45)   // Insert 
{//document.getElementById("kb45").click()
}
if (p==46)   // Delete 
{document.getElementById("delc").click()
}
if (p==98)   // 
{if ( objj.id==mst.length-1) {return}
mst[parseInt(objj.id,10)+1].click()
document.getElementById("div").scrollTop=document.getElementById("div").scrollTop+objj.offsetHeight+2 
}
if (p==104)  // 
{if ( objj.id==1) {return}
mst[parseInt(objj.id,10)-1].click()
document.getElementById("div").scrollTop=document.getElementById("div").scrollTop-objj.offsetHeight -2
}
if (p==103)   // Home
{mst[1].click()
document.getElementById("div").scrollTop=0
}
if (p==97)   // end
{mst[mst.length-1].click()
document.getElementById("div").scrollTop=9999999
}
if (p==16)   // shift
{
}}}



//*************************************************************************************************
function oi(p)   
//*************************************************************************************************
{if (p.title=="")
{p.style.background="red"
p.title="*"
mg=p.firstChild.outerHTML
p.firstChild.outerHTML=mg.replace("CHECKED","")
}
else
{p.style.background=""
p.title=""
}}

//**********************************************************************************************
function col(p)                          // 
//***********************************************************************************************
{if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
document.getElementById("prop").style.display=""
 // 
 props='<div style="height:370;OVERFLOW: scroll"><table width=100% border=1><tr style="background:grey;color:white">'+
' <td><b>N</b></td><td><b>Heading</b></td><td><b>Type</b></td><td><b>Interval, Length</b></td><td><b>Default</b></td><td><b>Values from</b></td>'+
'<td><b>Designation</b></td></tr>'
 for(var i=1; i<mss.length-1; i++)                            // 
{ props=props+"<tr><td>"+(i+1)+"</td><td title='TEMPLATE:"+msabl[i]+"\r\nDESCRIPTION:"+mopis[i]+"'>"+mss[i].title+'</td><td >'+mtip[i]+"</td><td><nobr>"+mminmax[i]+"</nobr></td><td>"+mdef[i]+"</td><td>"+mpod[i]+"</td>"+
"<td>"+moboz2[i]+"</td> </tr>" 
 }
props=props+'</table></div><center style="background:grey;color:white"><b > TYPES:&nbsp;t - text;&nbsp;&nbsp; d - date;&nbsp;&nbsp; i - integer;&nbsp;&nbsp;  $ - money; &nbsp;&nbsp;L - list; a - link</b></center>'
props=props+'<small >IN HEADER: = prohibits editing in this and the next column, entering data into these columns from the table of values;&nbsp;&nbsp; \
input only from the table of values;&nbsp;&nbsp;^ prohibits editing, ~ unique values. To view the template and description, the cursor is on the 2nd column or click it.<br>IN TEMPLATE: \
+ if the first, then includes the column value in the headers of the subordinate tables. </small>';
 document.getElementById("prop1").innerHTML=props
}
//***********************************
function col1(p)
//***********************************
{if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=bods}
document.getElementById("prop").style.display="none"
}

//*******************************************************************************************************
function sel(p)                                 //
//*******************************************************************************************************
{document.getElementById("h").style.visibility="visible"
document.getElementById("sel").style.display=""
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
}
//********************************
// 
//********************************
<?php
$fhel=getcwd()."/help.php";
//echo '//'.count(file($fhel))."\r\n";
if (file_exists($fhel))
{echo "helpyes=true;";}
else
{echo 'helpyes=false;';}
?>
//***************************************************
function hel(p)  // 
//***************************************************
{// 
<?php
if  (file_exists($fhel))
{echo 'dop=window.open("help.php","","");';}
else
// 
{echo 'document.getElementById("hel").click()';}
?>
}
// 
function zg()
{jk=0
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{if (fli[j].name=="g" )
{if  (jk==0)
{fli[j].checked=true
form.elements["ggg"].value=""
}
else
{fli[j].checked=false}
jk++
}}}

//****************************************************************************************************
function re(p)                           // 
//****************************************************************************************************
{document.getElementById("pwv").value=''
if (table.length==0) 
{form.elements['ggg'].value=''
document.getElementById("otkL").click()
return}
rvs=1
form.elements["save"].value="" 

if (table[0][0]=="?")
{}	
else
{form.elements["to"].value=parseInt(objj.getElementsByTagName("TD")[0].title,10)+parseInt(table[0][0],10)-1
}


         
if (p==0)          //
{form.elements["save"].value="yes"          
}
//**********************************************************************
else if (p==56)          //
//**********************************************************************
{if (table[0][0]=="?") 
{form.elements['ggg'].value=''
document.getElementById("otkL").click()
return}
inn=false
for(var j = 0; j < table.length; j++)                    //
 { if (table[j][0]=="?")                                 //
 {inn=true; break }
 if (table[j][table[j].length-1].indexOf('yes.gif')>0)   //
 {inn=true; break}
}
if (inn)
{alert("Impossible to post graphics! \r\n Changes have been made to the table! \r\n Click OK, save changes (save button) \r\n or discard them (refresh button).")
zg()
return
}
if (form.elements["glob"].value==1)
{alert("Data from all parents or a selection on the server! \r\n To enable or change the view of the \r\ngraphs, click 'G', or deselect and redo!")
zg()
return
}
if (!(mtip[1]=='i' || mtip[1]=='$' ))
{alert("To plot the graph, the values of the 2nd column are used as the X-axis. \r\n "+
"This column should only be of type 'integer' or 'money'. \r\n Graphs are drawn for all columns starting \r\nfrom 3 and of type 'integer' or 'money'")
//
zg()
return
}
//
for(var j = 0; j < table.length-1; j++)
{tek=parseInt(table[j][1])
sled=parseInt(table[j+1][1])
if (isNaN(tek) || tek>=sled)
{alert("To plot the graph, the values of the 2nd column are used as the X axis,\r\n"+ 
"but in it in the line "+ (table[j][0]) +" non-numerical, smaller or equal values are found! \r\n I can't post graphs! Correct the data in 1 column and repeat! ")
//
zg()
return
}}}
//*****************************************************************************
if (p==55 || p==56)                      // 
//******************************************************************************
{if (table[0][0]=="?")                   // 
 {for(var j = 0; j < table.length; j++)  //
 {if (table[j][0]!="?")                  //
 {rvs=table[j][0]-1                      //
 break
 }}}
else
{rvs=table[0][0]-1                       //
}
jdv(0)                                   //
rvs=parseInt(rvs)
beg=rvs+1
end=beg+table.length-1
vv=table.length
form.elements["napr"].value=4                    // 
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
if (p==55)
{form.elements["soob"].value="UPDATE completed!"
}
else
{if (form.elements["ggg"].value=='')
{form.elements["soob"].value="GRAPHICS canceled!"
}
else
{form.elements["soob"].value="GRAPHICS are built!"
}}
//form.elements["pain"].value="no" 
form.elements["submit"].click()
return}
//***********************************************************************************************************
// 
//***********************************************************************************************************
os=""
for(var jj = 0; jj < mss.length; jj++)                     // 
{if (mss[jj].title.indexOf('~')>0)                    // 
{if  (parseInt(document.getElementById("tmax").innerHTML,10)<=
parseInt(document.getElementById("pokz").innerHTML,10))    // 
{obj1=mtextarea[jj]                                        // 
sort(1)                                                    // 
document.getElementById("repo").innerHTML="Ascending for control!"
stroki=t.getElementsByTagName("TR")                           
scro=0
for(var j = 1; j <= stroki.length-1; j++)                  //
{rowt=stroki[j].getElementsByTagName("TD") 
mu=rowt[rowt.length-1].innerHTML.split("><")               //
if (mu[1].indexOf("yes.gif")>0)
{} 
else
{if (j>0)                                                  //
{rowp=stroki[j-1].getElementsByTagName("TD")               //
if (rowp[jj].innerHTML==rowt[jj].innerHTML)
{mu=rowp[rowt.length-1].innerHTML.split("><")              //
if (mu[1].indexOf("yes.gif")>0)
{} 
else
{os=os+rowt[jj].innerHTML+" REITERATION\r\n"
rowt[jj].style.color="red"
rowt[jj].style.background='yellow'
if (scro==0)
{scro=rowt[jj].offsetTop
}}}}}}
if (os!="")
{document.getElementById("div").scrollTop=scro
alert("Correct the errors:\r\n"+os)
return
}}
else
{alert("All changes to this table \r\n are only possible in LINE all mode! \r\n Therefore, they will be undone! \r\n After undo, click 'all' and redo!")
document.getElementById("obn").click() ///
return
}}}
//********************************************************************
 tins=false   //
 mins=""      //
 tdel=false   //
 mdel=""      //
 trep=false   //
 mrep=""      //
 if (table[0][0]=="?")
 {for(var j = 0; j < table.length; j++)
 {if (table[j][0]!="?")
 {rvs=parseInt(table[j][0])-1      //
 break
 }}}
 else
 {rvs=parseInt(table[0][0])       // 
 }
  rvs1=rvs
  nvs=0        //
  kud=0        //
  kvs=0        //
 //******************************************************************************************
 for(var j = 0; j < table.length; j++)       // 
 {trep=false                                 // 
  tins=false                                 // 
  tdel=false                                 // 
mu=table[j][table[j].length-1].split("src=")   	  
if (table[j][0]=="?")                      // 
{if (mu[mu.length-1].indexOf("no.gif")>0)  // 
{tins=true                                 // 
 nvs++                                     // 
 kvs++                                     // 
}
 }
  else                                       //
  {rvs=table[j][0]                           //
   nvs=0                                     //
  }
 if (table[j][table[j].length-1].indexOf('yes.gif')>0)  //
  {mfl=table[j][table[j].length-1].split("><")          //
  if (mfl[1].indexOf('yes.gif')>0) 
  {tdel=true                                            //
  if (table[j][0]=="?")
  { kvs--}}
  else
  {if (mfl[0].indexOf('yes.gif')>0) 
  {trep=true}}                                          //
 }
//*********************************************************************************
 if (tdel && !tins)                 // 
//********************************************************************************* 
 {mdel=mdel+table[j][0]+"¶"         // 
 kud++                              // 
 }
//******************************************************************************** 
 if (trep && !tins && !tdel )                 // 
//******************************************************************************** 
  {for(n = 0; n < table[j].length-1; n++)      // 
   {if (mtip[n]=="a")                          // 
   {tss="sampl/baza1/net.htm"                  // 
	for(nn = 0; nn < mref.length; nn++)        // 
    {ktp="title="+nn+"n"                       // 
	if (table[j][n].indexOf(ktp)>0)            // 
	 {tss=mref[nn]                             // 
	 break}
	 }
    mrep=mrep+tss+"```"                        // 
   }
   else
   {mrep=mrep+table[j][n]+"```"                // 
   }}
   mrep=mrep.substr(0,mrep.length-3)           // 
   mrep=mrep+"¶¶"
  } 
//************************************************************************************
 if (tins && !tdel )                          // 
//************************************************************************************
 {mins=mins+rvs+"+"+nvs+"```"
 for(n = 1; n < table[j].length-1; n++) 
   {if (mtip[n]=="a")
   {tss="sampl/baza1/net.htm"                 //
	for(nn = 0; nn < mref.length; nn++)       //
    {ktp="title="+nn+"n"                      //
	 if (table[j][n].indexOf(ktp)>0)          //
	 {tss=mref[nn]                            //
	 break}}
    mins=mins+tss+"```"
   }
   else
   {mins=mins+table[j][n]+"```"
  }
  }
  mins=mins.substr(0,mins.length-3)           // 
 
 mins=mins+"¶¶"
 
 }
 }                                             // 

if (form.elements["glob"].value==1)            // 
{if (mrep!="")
{mrep="¶"+mrep.substr(0,mrep.length-2)         // 
}}
else
{mrep=mrep.substr(0,mrep.length-2)    //
}
mdel=mdel.substr(0,mdel.length-1)    // 

if (form.elements["glob"].value==1 && mdel!="")            //
{mdel="¶"+mdel
}


if (par1[1].indexOf("-")>0 )                  //
{if (parseInt(kud)==parseInt(kvs)+parseInt(document.getElementById('tmax').innerHTML))
{alert("All lines cannot be deleted! Insert or leave 1 line.") 
return
}} 
//******************************************************************************
if (mrep=="" && mdel=="" && mins=="")       //
 {alert("No change! ")
 }
 else
 {
 if (mins!="")                                                    // 
 { mins=mins.replace(/\r\n/g,"")
 form.elements["mins"].value=mins                                  //
 }
if (mdel!="")
 {mdel=mdel.replace(/\r\n/g,"")
 form.elements["mdel"].value=mdel                                  //
 }
 //************************************************************************************
 if (mdel!="" || mins!="" )               //  
//***********************************************************************************	 
{fl=window.top.frames
if (par1[1].indexOf("-")<0 )                                              // 
{if (mpar.length==1)                                                      // 
{if (window.top.document.getElementById('ifr1')!=undefined)               // 
 {window.top.document.getElementById('ifr1').style.visibility="hidden" }
 if (window.top.document.getElementById('ifr2')!=undefined)                // 
 { window.top.document.getElementById('ifr2').style.visibility="hidden" }
 }
if (mpar.length==2)                                                        //
{ if (window.top.document.getElementById('ifr2')!=undefined)               //
 { window.top.document.getElementById('ifr2').style.visibility="hidden" }
 }}}
 if (mrep!="")                                              //
 {mrep=mrep.replace(/\r\n/g,"")
  form.elements["mrep"].value=mrep                          //
 }
 document.getElementById("h").style.visibility="visible"   // 
 if (confirm("In the table on the server, \r\n all lines marked in 'x' will be deleted, \r\n "+
  "marked in 'r' changed! \r\n strings in 'N' pp with '?' will be inserted! \r\n To confirm 'OK' to cancel 'Cancel'."))
 {if (kud==table.length)                                         //
 {form.elements["napr"].value=1                                  //
 beg=rvs1-parseInt(document.getElementById("pokz").innerHTML)-1
 }
 else
 {form.elements["napr"].value=4                                  //
  beg=rvs1
 }
end=beg+table.length                                            // 
vv=table.length
if (beg<=0 ) {beg=1}
if (mins!="")
{end=beg+vv	
}
else
{end=beg+vv-1 
}
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
document.getElementById("h").style.visibility="visible"
if (form.elements["pain"].value=="no")            // 
{jdv(0)                                           // 
form.elements["submit"].click()                   // 
}	
else                                              // 
{if (window.top.document.getElementById("refe").innerHTML.indexOf("reddoc")>0)    //
{form.elements["pain"].value="no"                 // 
jdv(0)                                            // 
form.elements["submit"].click()                   // 
}
 else                                                              //
{if (window.top.document.getElementById("papa").innerHTML=="+")    //
 {//
 document.getElementById("pas").style.display=""                   //
 }
 else
 {jdv(0)                                                           //
form.elements["submit"].click()                                    //
 }}}}
 else                                                              // 
{form.elements["mins"].value=""                                    // 
form.elements["madd"].value=""
form.elements["mdel"].value=""
form.elements["mrep"].value=""
document.getElementById("h").style.visibility="hidden"               //
}}}
//******************************************
//
//******************************************
function ppapa()
{document.getElementById('pas').style.display=""
}
//********************************
function ad(p)   //
//********************************
{if (objj=="")
{p=0
objj=document.getElementById("0")
}
if (document.getElementById("repo").innerHTML=="Added to the end!")
{document.getElementById("repo").innerHTML=="The last row of the table!"
return
}
if (document.getElementById("ta0").value=="?")
{nss=999999999}
else
{nss=parseInt(document.getElementById("ta0").value,10)}
if (p==2)                                                    // 
{if (!monn && nss<=parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n can insert lines between saved lines \r\n in exclusive mode!")
return
}

obji=parseInt(obji,10)-1
}
else                                                         //
{if (!monn && nss<parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n can insert lines between saved lines \r\n in exclusive mode!")
return
}}
var mtr = new Array()
mtr.length=mtip.length+1
for(var j = 0; j < mtr.length; j++)                         //
{if (j<mtr.length-1)
{if (j==0) 
{mtr[j]="?"}
else
{if (mtip[j]=="a")
{kls="?"
for(var jj = 0; jj < mref.length; jj++)                    //
 {if (mdef[j]==mref[jj])                                   //
 {kls=jj}}
if  (form.elements["mob"].value!=1)
{mtr[j]="<a title=" +kls+"n>...</a>"}
else
{mtr[j]="<a title=" +kls+"n>...</a>"}
 }
else
{mtr[j]=mdef[j]}
}}
else
{mtr[j]='<img src="../../../../d~e~f/no.gif" onclick1=cb(this,1)><img onclick1=cb(this,2) src="../../../../d~e~f/no.gif">'
}}
table.splice(obji,0,mtr)
obji=parseInt(obji)
otm(1)
crz(obji+1)
if (objj.id==table.length)                                 //
{document.getElementById("div").scrollTop=objj.offsetTop}  //
else
{
if (document.getElementById("div").scrollTop<objj.offsetTop) //
{document.getElementById("div").scrollTop=objj.offsetTop-document.getElementById("div").offsetHeight/2}    // 
}

if (p==2)
{document.getElementById("repo").innerHTML="Inserted BEFORE!"
}
else
{document.getElementById("repo").innerHTML="Inserted AFTER!"}
}
//*************************
//
//************************
function hid(p)
{if (table.length==0) {return}
if (obj1=="")
{}
else
{ik=obj1.id.replace("ta","")
 for(var i=0; i<mst.length; i++)                                  // 
 {mstd1=mst[i].getElementsByTagName("TD")
 for(var ii=0; ii<mstd1.length-1; ii++)                            //
 {if (ik==ii)
 {mstd1[ii].style.display='none'
}}}
mss[ik].style.display='none'
mtextarea[ik].style.display='none'
mzagpok[ik]=false
mstd=mst[0].getElementsByTagName("TD")                          //
mtextarea=document.getElementById("textarea").getElementsByTagName("TEXTAREA")
for(var i=0; i<mstd.length-1; i++)                            // 
{if (mstd[i].clientWidth>0)
{mtextarea[i].style.width=mstd[i].clientWidth-1}}
}}
//*************************
// 
//************************
function vis(p)
{if (table.length==0) {return}
for(var i=0; i<mst.length; i++)                     //
 {mstd1=mst[i].getElementsByTagName("TD")
 for(var ii=0; ii<mstd1.length-1; ii++)                            //
 {if (mstd1[ii].style.display=="")
 {} else
 {mstd1[ii].style.display=''
}}}
for(var i=0; i<mss.length; i++)
{mss[i].style.display=''}
for(var i=0; i<mtextarea.length; i++)
{mtextarea[i].style.display=''
 mzagpok[i]=true
}
for(var i=0; i<mstd.length; i++)                            // 
{mss[i].style.width=mstd[i].clientWidth}
for(var i=0; i<mstd.length-1; i++)                            //
{if  (mstd[i].clientWidth>0)
{mtextarea[i].style.width=mstd[i].clientWidth-1}}
mdis="There are hidden"
document.getElementById("rep").innerHTML=document.getElementById("rep").innerHTML.replace(", there are hidden","")
otm(1)
crz(1)
mst[1].click()     //
if (objj!="")
{objj.click()}
}
//*********************************
// 
//*********************************
var ssort=0
function sort(p)
{if (obj1=="")
{alert("Column not selected!");return}
if (table.length>100000)
{alert("More than 100,000 lines!");return}
mkl=""
ik=obj1.id.replace("ta","")
ssort=ik
mdis=" ,"                                   //
for(var i=0; i<mss.length; i++)             //
{if (mss[i].style.display=='none')
{mdis=mdis+i+","
}}
for(var j = 0; j < table.length; j++)       //
{mmm=table[j][ik]+"          "
if (mtip[ik]=="d")                          //
{mmm=table[j][ik]
mmm1=mmm.split('.')
mmm=""
for(var ii1=mmm1.length-1; ii1>=0; ii1--)  
{mmm=mmm+mmm1[ii1]
}}
if (mtip[ik]=="i" || mtip[ik]=="$" || mtip[ik]=="L" )        //
{krz=table[j][ik].length
if (krz>10)
{}
else
{pmmm=""
for(var ii1=1; ii1<=10-krz; ii1++)  
{pmmm=pmmm+"0"}
mmm=pmmm+mmm
}}
mkl=mkl+mmm.substr(0,10)
mkl=mkl+"¶"
kzr=5-table[j][0].length
if (kzr>0)
{for (var iii=1;iii<kzr;iii++)
{mkl=mkl+" "}
}
mkl=mkl+(parseInt(j,10)+1)
if (j<table.length-1)
{mkl=mkl+"~"}
}
ss="<table id=t  border=1 width=100% ><tbody>"
mdis=" ,"                                                  //
ss=ss+"<tr style='background:silver'>"
for(var i=0; i<mtip.length+1; i++)
{if (mss[i].style.display=='none')
{mdis=mdis+i+","
//ss=ss+mzag[i].replace("<TD",'<TD style="display:none" ')
ss2=mzag[i].replace('style="','style="display:none;')
//ss2=mzag[i].replace("<td",'<td style="display:none" ')
//alert(ss2)
ss=ss+ss2

}
else
{ss=ss+mzag[i]
}}
ss=ss+"</tr>"
skml=mkl.split('~')
skml=skml.sort()
//******************************
if (p==1)    // 
{document.getElementById("tsort").innerHTML=" ascending values in a column "+(parseInt(ik,10)+1)
ss=ss+""
for(var i=0; i<skml.length; i++)                            
{ij=skml[i].split("¶")[1]-1        //
ij=parseInt(ij,10)                //
if (mpok[ij])
{ss=ss+"<tr onclick=stc(this,event) id="+(i+1)+">"
}
else
{ss=ss+"<tr onclick=stc(this,event) style='display:none' id="+(i+1)+">"
}
for(var ii=0; ii<table[ij].length; ii++)    //
{ss=ss+"<td"
if (ii==0)                                  //
{ss=ss+" title="+(ij+1)+" "
}
if (mdis.indexOf(","+ii+",")>0)             // 
{ss=ss+" style='display:none' "}
if  (ii<table[ij].length-1)                 // 
{if (mtip[ii]=="L")                         // 
{msstr=table[ij][ii].split("")              // 
if (msstr.length==0)
{os="ERROR";}
else
{os=""}
for(var iii=0; iii<msstr.length; iii++)    
{if (msstr1.indexOf(msstr[iii])<0)                            //
{os="ERROR"}}
if (os=="")                                                   //
{if (parseInt(table[ij][ii],10)>parseInt(spis[ii].length)-1)  //
{os="ERROR"}
if (parseInt(table[ij][ii],10)==0)                            //
{os="REMOVED"}
}
if (os=="")
{zpkl=spis[ii][parseInt(table[ij][ii],10)].innerHTML
ss=ss+">"+zpkl+"</td>"}
else
{ss=ss+">"+os+"</td>"}
}
else       //
{ss=ss+">"+table[ij][ii]+"</td>"
}}
else
{ttt3=table[ij][ii]
if (ttt3.indexOf("../../../../d~e~f")<0) 
{ttt3=ttt3.replace(/no.gif/g,"../../../../d~e~f/no.gif")
ttt3=ttt3.replace(/yes.gif/g,"../../../../d~e~f/yes.gif")
}
ss=ss+" align=center>"+ttt3+"</td>" 
}}
ss=ss+"</tr>"
}}
//************************
if (p==2)   //
{document.getElementById("tsort").innerHTML=" descending values in a column  "+(parseInt(ik,10)+1)
kkk=1
for(var i=skml.length-1; i>=0; i--)
{ij=skml[i].split("¶")[1]-1
ij=parseInt(ij,10)
if (mpok[ij])
{ss=ss+"<tr onclick=stc(this,event) id="+(kkk++)+">"
}
else
{ss=ss+"<tr style='display:none' onclick=stc(this,event) id="+(kkk++)+">"
}
ij=skml[i].split("¶")[1]-1
for(var ii=0; ii<table[ij].length; ii++)   
{ss=ss+"<td"
if (ii==0)
{ss=ss+" title="+(ij+1)+" "
}
if (mdis.indexOf(","+ii+",")>0)   // 
{ss=ss+" style='display:none' "}
if  (ii<table[ij].length-1)
{if (mtip[ii]=="L")                // 
{msstr=table[ij][ii].split("")     // 
if (msstr.length==0)
{os="ERROR";}
else
{os=""}
for(var iii=0; iii<msstr.length; iii++)    
{if (msstr1.indexOf(msstr[iii])<0)                            //
{os="ERROR"}}
if (os=="")                                                   //
{if (parseInt(table[ij][ii],10)>parseInt(spis[ii].length)-1)  //
{os="ERROR"}
if (parseInt(table[ij][ii],10)==0)                            //
{os="REMOVED"}
}
if (os=="")
{zpkl=spis[ii][parseInt(table[ij][ii],10)].innerHTML
ss=ss+">"+zpkl+"</td>"}
else
{ss=ss+">"+os+"</td>"}
}
else
{ss=ss+">"+table[ij][ii]+"</td>"
}}
else
{ttt3=table[ij][ii]
if (ttt3.indexOf("../../../../d~e~f")<0) 
{ttt3=ttt3.replace(/no.gif/g,"../../../../d~e~f/no.gif")
ttt3=ttt3.replace(/yes.gif/g,"../../../../d~e~f/yes.gif")
}
ss=ss+" align=center>"+ttt3+"</td>" 
}}
ss=ss+"</tr>"
}}
ss=ss+"</tbody></table>"
document.getElementById("div").innerHTML=ss
objj="";
crz(1)
if (mdis!=" ,")
{document.getElementById("repo").innerHTML=document.getElementById("repo").innerHTML+".There are hidden"
}
document.getElementById("div").scrollTop=0
}


//****************************************************************************
function otm(p)       //
//***************************************************************************
{msstr1=",0,1,2,3,4,5,6,7,8,9,"
ss="<table id=t  border=1 width=100% ><tbody>"
mdis=" ,"                                                  //
ss=ss+"<tr style='background:silver'>"
for(var i=0; i<mzagpok.length; i++)
{if (mzagpok[i])
{ss=ss+mzag[i]
}
else
{mdis=mdis+i+","
ss=ss+mzag[i].replace("<TD",'<TD style="display:none" ')
}}
ss=ss+"</tr>"
ss1=""
da2=false                                               //
nep=0                                                   //

// ***********************************************************
for(var i=0; i<table.length; i++)
{da2=false
ss1="<tr onclick=stc(this,event) id="+(i+1)+" >"
for(var ii=0; ii<mtip.length+1; ii++)   
{ss1=ss1+"<td"
if (ii==0)
{ss1=ss1+" title="+(i+1)}
if (mdis.indexOf(","+ii+",")>0)                             //
{ss1=ss1+" style='display:none' "
}
if  (ii<=mtip.length-1)
{if  (mtip[ii]=="L")                                        //
{msstr=table[i][ii].split("")                               //
if (msstr.length==0)
{os="ERROR";}
else
{os=""}
for(var iii=0; iii<msstr.length; iii++)                       
{if (msstr1.indexOf(msstr[iii])<0)                           //
{os="ERROR"}}
if (os=="")
{if (parseInt(table[i][ii],10)>parseInt(spis[ii].length)-1)  //
{os="ERROR"}
if (parseInt(table[i][ii],10)==0)                            //
{os="REMOVED"}
}
if (os=="")
{zpkl=spis[ii][parseInt(table[i][ii],10)].innerHTML

ss1=ss1+">"+zpkl+"</td>"}
else
{ss1=ss1+">"+os+"</td>"}
}
else
{ss1=ss1+">"+table[i][ii]+"</td>"
}}
else
{ss1=ss1+" align=center>"+table[i][ii]+"</td>" 
}
if (ss1.indexOf("../../../../")<0)                     // 
{ss1=ss1.replace(/no.gif/g,"../../../../d~e~f/no.gif")
ss1=ss1.replace(/yes.gif/g,"../../../../d~e~f/yes.gif")
}}
for(var ii=0; ii<mtip.length+1; ii++)   
{if (select)                                           //
{//*************************************************************
//
//************************************************************
if (ii>0 && ii<msel.length)                  // 
{//*******************************************************************************
if (msel[ii-1][0]!="" && msel[ii-1][1]!="" )        //
//*******************************************************************************
{if (mtip[ii]=="d")                                 //
{dt1=table[i][ii].split('.')
dt=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dt=dt+dt1[ii1]}
dt=parseInt(dt,10)                                //
dt1=msel[ii-1][0].split('.')
dtot=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dtot=dtot+dt1[ii1]}
dtot=parseInt(dtot,10)                            //
dt1=msel[ii-1][1].split('.')
dtdo=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dtdo=dtdo+dt1[ii1]}
dtdo=parseInt(dtdo,10)                            //
if (dt>=dtot && dt<=dtdo)
{da2=true}                                        //
else                                              //
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//*********************************************************************************
if (mtip[ii]=="i")                               // 
{if (parseInt(table[i][ii],10)>=parseInt(msel[ii-1][0],10) && 
parseInt(table[i][ii],10)<=parseInt(msel[ii-1][1],10))
{da2=true}
else 
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//******************************************************************************
if (mtip[ii]=="$")                               // 
{if (parseFloat(table[i][ii])>=parseFloat(msel[ii-1][0]) && 
parseFloat(table[i][ii])<=parseFloat(msel[ii-1][1]))
{da2=true}
else 
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}}
else
{//*********************************************************************************
if (msel[ii-1][0]!="")                             //
//*********************************************************************************
{if (mtip[ii]=="d")                                 // 
{dt1=table[i][ii].split('.')
dt=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dt=dt+dt1[ii1]}
dt=parseInt(dt,10)                                 //
dt1=msel[ii-1][0].split('.')
dtot=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dtot=dtot+dt1[ii1]}
dtot=parseInt(dtot,10)                            // 
dt1=msel[ii-1][1].split('.')
if (dt>=dtot)
{da2=true}
else 
{if (msel[ii-1][2]!="")                           // 
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         // 
{da2=true}                                        // 
else                                              // 
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//***************************************************************************
if (mtip[ii]=="i")                                //
{if (parseInt(table[i][ii],10)>=parseInt(msel[ii-1][0],10))
{da2=true}                                        //
else                                              //
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//****************************************************************************
if (mtip[ii]=="$")                                 //
{if (parseFloat(table[i][ii])>=parseFloat(msel[ii-1][0]))
{da2=true}
else 
{if (msel[ii-1][2]!="")                            //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)          //
{da2=true}                                       // 
else                                               //
{if (msel[ii-1][2]!="")                           // 
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         // 
{da2=true}                                        // 
else                                              // 
{da2=false
break
}}
else                                              // 
{da2=false                                        // 
break
}}}}}}
else
{//*****************************************************************************
if (msel[ii-1][1]!="")                            // 
//******************************************************************************
{if (mtip[ii]=="d")                                //
{dt1=table[i][ii].split('.')
dt=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dt=dt+dt1[ii1]}
dt=parseInt(dt,10)                               //
dt1=msel[ii-1][1].split('.')
dtdo=""
for(var ii1=dt1.length-1; ii1>=0; ii1--)  
{dtdo=dtdo+dt1[ii1]}
dtdo=parseInt(dtdo,10)                           //
if (dt<=dtdo)
{da2=true}
else 
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//******************************************************************************
if (mtip[ii]=="i")                               //
{if (parseInt(table[i][ii],10)<=parseInt(msel[ii-1][1],10))
{da2=true}
else 
{if (msel[ii-1][2]!="")                           //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         //
{da2=true}                                        //
else                                              //
{da2=false
break
}}
else                                              //
{da2=false                                        //
break
}}}
//******************************************************************************
if (mtip[ii]=="$")                                //
{if (parseFloat(table[i][ii])<=parseFloat(msel[ii-1][1]))
{da2=true}
else 
{if (msel[ii-1][2]!="")                            //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)          //
{da2=true}                                       // 
else                                               //
{if (msel[ii-1][2]!="")                           // 
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)         // 
{da2=true}                                        // 
else                                              // 
{da2=false
break
}}
else                                              // 
{da2=false                                        // 
break
}}}}}}}}
//***********************
// 
//***********************
if (msel[ii-1][2]!="" &&  msel[ii-1][0]=="" && msel[ii-1][1]=="")      //
{if (mtip[ii]=="t")                               //
{
mmt=" "+table[i][ii]
mmm=msel[ii-1][2]+"/"
mmsel=mmm.split("/")                               //
da22=false
for(var ii2=0; ii2<=mmsel.length; ii2++)           //
{if (mmsel[ii2]!="")                               //
{
if (mmt.indexOf(mmsel[ii2])>0)                    // 
{da22=true
break
}}}
da2=da22
if (!da2)
{break}
}
else                                               //
{sss3=" /"+msel[ii-1][2]
if (sss3.indexOf("/"+table[i][ii]+"/")>0)          //
{da2=true}                                         //
else                                               //
{da2=false
break
}}}                                                //
}
}                                                 // 
else
{da2=true}                                        // 
}   // 


//*************************************************************************************
if (select)                                        // 
{
if  (psel)                                         // 
{if (!da2)                                          //
{ss1=ss1.replace("<tr",'<tr style="display:none"')
nep++
mpok[i]=false
}
else
{mpok[i]=true}
}
//*************************************************************************************
else                                              //
{if (!da2)                                        //
{mpok[i]=true                                    // 
}
else                                             // 
{ss1=ss1.replace("<tr",'<tr style="display:none"')  //
nep++                                               //
mpok[i]=false 
}}}
else                                              //
{mpok[i]=true                                      //
}
if (ii>mtip.length)
{if (ss1.indexOf("../../../../d~e~f")<0) 
{ss1=ss1.replace(/no.gif/g,"../../../../d~e~f/no.gif")
ss1=ss1.replace(/yes.gif/g,"../../../../d~e~f/yes.gif")
}}
ss=ss+ss1
ss=ss+"</tr>"
ss1=""
}
ss=ss+"</tbody></table>"
document.getElementById("pokz").innerHTML=table.length-nep
document.getElementById("div").innerHTML=ss

//alert (document.getElementById("div").outerHTML)

if (form.elements["ggg"].value!="") 
{window.top.myyy.length=table.length
window.top.ist.length=mstd.length

for(var i = 0; i < table.length; i++)        //
  {window.top.myyy[i]= new Array()
   window.top.myyy[i].length=table[i].length
  }
 for(var j = 0; j < table.length; j++)       //
{for(n = 0; n < table[j].length; n++) { 
  window.top.myyy[j][n]=table[j][n]
 }}
 //
mti=document.getElementById("std").getElementsByTagName("TD")  
window.top.ist.length=mti.length
for(var j = 0; j < mti.length; j++)       //
{mttt=mti[j].title.split('.')
window.top.ist[j]=mttt[0]
}}
}
//*****************************************************
// 
//*****************************************************
function cb2(p,p1)
{if (p.src.indexOf("no.gif")>0)
{p.src="../../../../d~e~f/yes.gif"}
else
{p.src="../../../../d~e~f/no.gif"
document.getElementById("liss").innerHTML="."
}}
//*****************************************************
// 
//*****************************************************
function cb(p,p1)
{if (p1==2 && !monn && parseInt(p.parentNode.parentNode.getElementsByTagName("TD")[0].title-1)<parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n can delete saved lines \r\n in exclusive mode!")
}
if (p.src.indexOf("no.gif")>0)
{p.src="../../../../d~e~f/yes.gif"}
else
{p.src="../../../../d~e~f/no.gif"}
table[p.parentNode.parentNode.getElementsByTagName("TD")[0].title-1][mtextarea.length]=p.parentNode.innerHTML
}
//**************************************************************
//  
//*************************************************************
function atip1(p,p1)
{mimg=p.parentNode.getElementsByTagName("IMG") 
for(var i=0; i<mimg.length; i++)   
{mimg[i].src="../../../../d~e~f/no.gif"
}
mimg[p1].src="../../../../d~e~f/yes.gif"
}
//**************************************************************
//  
//*************************************************************
var oldtip=""
var newtip=""            //
var newminmax=""         //
var newdef=""            //
var newzag=""            // 
function atip2(p,p1,p2)
{tip2=mtip[is]
def2=mdef[is]     
ree=mzag[is].replace("/","")
ree=ree.replace(/<td>/g,"")
zag2=ree.replace(/<TD>/g,"")
if (mminmax[is].indexOf(',')>0)
{minmax2=mminmax[is].split(",")
min2=minmax2[0]
max2=minmax2[1]
}
else
{min2=0
max2=100
}
document.getElementById("sabl").value=msabl[is]
document.getElementById("oboz2").value=moboz2[is]
document.getElementById("opis").value=mopis[is]
document.getElementById("podstx").value=mpod[is]
if (chto=="ins")
{document.getElementById("podstx").value=""
}
mimg=p.parentNode.parentNode.getElementsByTagName("IMG") 
for(var i=0; i<mimg.length; i++)   
{mimg[i].src="../../../../d~e~f/no.gif"
}
mimg[p1].src="../../../../d~e~f/yes.gif"
if (p1==0)  //
{newtip="t"
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""

if (mpzz[mpzz.length-1].indexOf("-")<0)                            //
{document.getElementById("podst").style.display=""}

document.getElementById("pmin").style.display="none"
document.getElementById("pmax").style.display=""
if (mtip[is]!="t" || chto=="ins" )
{document.getElementById("pmaxx").value="50"
document.getElementById("deff").value=""
document.getElementById("pminn").value="0"
}
else
{document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
document.getElementById("deff").value=def2
}
//document.getElementById("ol").style.display=""
}
if (p1==1)  //
{newtip="d"
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""
document.getElementById("pdef").style.display=""
document.getElementById("pmin").style.display=""
document.getElementById("pmax").style.display=""
//document.getElementById("ol").style.display=""
if (mpzz[mpzz.length-1].indexOf("-")<0)                            //
{document.getElementById("podst").style.display=""
}
if (mtip[is]!="d"  || chto=="ins")
{document.getElementById("deff").value="01.01.2015"
document.getElementById("pminn").value="01.01.1700"
document.getElementById("pmaxx").value="01.01.2016"
}
else
{document.getElementById("deff").value=def2
document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
}}
if (p1==2)  //
{newtip="i"
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""
document.getElementById("pdef").style.display=""
document.getElementById("pmin").style.display=""
document.getElementById("pmax").style.display=""
//document.getElementById("ol").style.display=""
if (mpzz[mpzz.length-1].indexOf("-")<0)                            //
{document.getElementById("podst").style.display=""}
if (mtip[is]!="i"  || chto=="ins")
{document.getElementById("deff").value="0"
document.getElementById("pminn").value="-10000000"
document.getElementById("pmaxx").value="10000000"
}
else
{document.getElementById("deff").value=def2
document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
}}
if (p1==3)  //
{newtip="$"
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""
document.getElementById("pdef").style.display=""
document.getElementById("pmin").style.display=""
document.getElementById("pmax").style.display=""
//document.getElementById("ol").style.display=""
if (mpzz[mpzz.length-1].indexOf("-")<0)                            //
{document.getElementById("podst").style.display=""}
if (mtip[is]!="$"  || chto=="ins")
{document.getElementById("deff").value="0.00"
document.getElementById("pminn").value="-10000000.00"
document.getElementById("pmaxx").value="10000000.00"
}
else
{document.getElementById("deff").value=def2
document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
}}
if (p1==4)  //
{newtip="L"
document.getElementById("podstx").value=""
document.getElementById("podst").style.display="none"
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""
document.getElementById("pdef").style.display="none"
if (mtip[is]!="L"  || chto=="ins")
{document.getElementById("deff").value=1
}
else
{document.getElementById("deff").value=def2
document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
}
document.getElementById("pmin").style.display="none"
document.getElementById("pmax").style.display="none"
//document.getElementById("ol").style.display=""
}
if (p1==5)  //
{newtip="a"
document.getElementById("podstx").value=""
document.getElementById("podst").style.display="none"
document.getElementById("podstx").disabled
document.getElementById("atip").style.display=""
document.getElementById("atip2").style.display=""
document.getElementById("atip4").style.display=""
document.getElementById("pdef").style.display=""
if (mtip[is]!="a"  || chto=="ins")
{document.getElementById("deff").value="sampl/baza1/net.htm"
}
else
{document.getElementById("deff").value=def2
document.getElementById("pminn").value=min2
document.getElementById("pmaxx").value=max2
}
document.getElementById("pmin").style.display="none"
document.getElementById("pmax").style.display="none"
//document.getElementById("ol").style.display=""
}
oldpod=mpod[is]
}
//*************************************************************
function def1(p)  //
//*************************************************************
{if (objj=="")
{alert("No selected line, select line with a click and repeat!")
return
}
document.getElementById("repo").innerHTML="Temporary by default!";
mdef[0]="0"
for(var i=1; i<mtextarea.length; i++)                            // 
{if (mtip[i]=="L")   //
{mdef[i]=table[obji-1][i]
}
else
{if (mtextarea[i].value=="")
{mdef[i]=""}
else
{if (mtip[i]=="a")   //
{mdef[i]=mref[parseInt(mtextarea[i].value)]
}
else
{mdef[i]=mtextarea[i].value
}}}}}

//*************************************************************
function sum1(p) //
//*************************************************************
{if (obj1!="")
{ik=parseInt(obj1.id.replace("ta",""),10)
if (mtip[ik]=="i" || mtip[ik]=="$")
{summ=0
for(var j = 0; j < table.length; j++)
{if (mpok[j])
{if (mtip[ik]=="$")
{psum=parseFloat(table[j][ik])}
else
{psum=parseInt(table[j][ik])}
summ=summ +psum
}}
if (mtip[ik]=="$")  
{summ=summ.toFixed(2)} 
qwe=mss[ik].title
qwe=qwe.replace(/<br>/g," ")
qwe=qwe.replace(/<BR>/g," ")
summ=" "+summ
poz=summ.indexOf('.')
if (poz>0)
{summ5=summ.substr(poz)
summ3=summ.substr(0,poz)
 }
else
{summ5=""
summ3=summ
poz=summ.length
}
mpar4=summ3.split('')
k=999999
for(var j = poz-1; j>= 0; j--)   
{for(var jj = 0; jj <=2; jj++)   
{k=j-jj
if (jj==2)
{summ5=" "+mpar4[k]+summ5
}
else
{summ5=mpar4[k]+summ5
}
if (k==0) {break}
}
if (k==0) {break}
j--;j--
}
if (document.getElementById("repo").innerHTML.indexOf('Sum')>0)
{document.getElementById("repo").innerHTML=document.getElementById("repo").innerHTML+","+qwe+"=<b style='color:black;background:yellow'>"+summ5+"</b>";
}
else
{document.getElementById("repo").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sum:  "+qwe+" =<b style='color:black;background:yellow'>"+summ5+"</b>";
}}
else
{document.getElementById("repo").innerHTML="Summation failed!";
alert("Column non-digit or summation is prohibited!")
}}}
olds=""                       // 
olds3=""                      // 


//********************************************************************************
function spc(pp,event)    // 
//********************************************************************************
{if (olds3!="" && document.getElementById("kvibp").outerHTML.indexOf('no.gif')>0)
{olds3.parentNode.style.background="#ffefd5"}
event = event || window.event
var t = event.target || event.srcElement
if (t.tagName=="IMG")
{
t=t.parentNode
}
if (t.tagName=="TD" && t.innerHTML.indexOf('</B')>0)
{return}
if (t.tagName=="B")
{

itz=t.parentNode.parentNode.parentNode.parentNode    //
isort=parseInt(t.title)
isort2=t.parentNode.title
ssp=t.parentNode.parentNode.getElementsByTagName("TD")
for(var jj = 0; jj < ssp.length; jj++) 
{ssp[jj].style.background="silver";
ssp[jj].style.color="black";
}
t.parentNode.style.background="yellow"
t.parentNode.style.color="brown"

if (document.getElementById("ksort2").src.indexOf('no.gif')>0)
{
//sort2("list*",2)
}
else
{
//sort2("list*",1)
}


}
else
{if (t.tagName!="TD") return
if (byellow(t.parentNode.style.background))
{t.parentNode.style.background=""
}
else
{t.parentNode.style.background="yellow"
}
if (document.getElementById("kvibp").outerHTML.indexOf('yes.gif')>0) 
{
return
}
else
{ssp=t.parentNode.getElementsByTagName("TD")
spkl=ssp[0].innerHTML                      //
olds3=t
olds=t
if (document.getElementById("lists").innerHTML==ssp[0].innerHTML+"-"+ssp[1].innerHTML)
{
if (document.getElementById("sel").style.display=="")
{}
else
{
flistv(1)                                //
}
}
document.getElementById("lists").innerHTML=ssp[0].innerHTML+"-"+ssp[1].innerHTML
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
}}}

//***************************************************
objspc2=""
osv=""
objvt=""                      //
isort=""                      // 
isort2=""                     //
itz=""                        //
olds2=""                      //
//******************************************************************
function spc2(pp,event)       // 
//******************************************************************
{if (olds2!="" && document.getElementById("kvibz").outerHTML.indexOf('no.gif')>0)  	// 
{olds2.parentNode.style.background="#e0ffff"}        					// 
event = event || window.event                        					// 
var t = event.target || event.srcElement                                // 
ik=parseInt(obj1.id.replace("ta",""),10)                                // 
iza="zlis-"                                                             // 
//****************************************
// 
if (t.outerHTML.indexOf('><')>0) return
if (t.tagName=="B" && t.parentNode.parentNode.id.substr(0,4)=="zlis")   //
{// 
itz=t.parentNode.parentNode.parentNode.parentNode         // 
isort=parseInt(t.title)                                                 //
isort2=t.parentNode.title                                               //
ssp=t.parentNode.parentNode.getElementsByTagName("TD")                  //
for(var jj = 0; jj < ssp.length; jj++)                                  //
{ssp[jj].style.background="silver";
ssp[jj].style.color="white";
}
t.parentNode.style.background="yellow"                                  //
t.parentNode.style.color="brown"
ik=parseInt(obj1.id.replace("ta",""),10)                                //
if (document.getElementById("ksort").src.indexOf('no.gif')>0)           //
{sort2("lis-"+ik+"-",2)}                                           //
else                                                                    //
{sort2("lis-"+ik+"-",1)}
document.getElementById("lissi").innerHTML="<b style=color:white>Sorted!</b>"
document.getElementById("liss").innerHTML="."
return                                                                  //
}   
//*****************************************
// 
if ((t.tagName=="TD" && t.parentNode.id==iza))                          // 
{return}
objspc2=t                                                               // 
osv=""
if (t.tagName!="TD") {return}                                           // 
if (byellow(t.parentNode.style.background))
{t.parentNode.style.background=""
}
else
{t.parentNode.style.background="yellow"                                  //
}
olds2=t                                                                 // 
rss=document.getElementById("repo").innerHTML                           // 
ssp22=pp.getElementsByTagName("B")                                      // 
//*************************
if (rss.indexOf('=')>0 || rss.indexOf('!')>0)                           // 
{rss=rss.replace("=","")                                                // 
rss=rss.replace("!","")
rss=rss.replace("*","")
rss=rss.replace("~","")
rss=rss.replace("^","")
zss=ssp22[parseInt(t.title)].innerHTML                                  // 
zss=zss.replace("~","")
zss=zss.replace("^","")
zss=zss.replace("!","")
zss=zss.replace("=","")
zss=zss.replace("*","")
if (rss!=zss)                                                           //
{document.getElementById("lissi").innerHTML="<b style=background:black;color:white>Column names do not match! Click right!</b>"
document.getElementById("liss").innerHTML="."
return
}
if (document.getElementById("repo").innerHTML.indexOf('=')>0)         //
{if ((ik+2)<mstd.length)                                                // 
{if (mpod[ik+1]!="" )
{document.getElementById("lissi").innerHTML="<b style=background:black;color:white>The next column is assigned a table of values, this is prohibited! </b>"
document.getElementById("liss").innerHTML="."
return
}
flistv2_mz=objspc2.parentNode.parentNode.getElementsByTagName("TD")    // 
if (mtip[ik+1]=="L")
{document.getElementById("lissi").innerHTML="<b style=background:black;color:white>The next column cannot be 'L' (lookup)!</b>"
document.getElementById("liss").innerHTML="."
return
}
if (mtip[ik+1]!="t")                                                //
{if (mtip[ik+1]!=flistv2_mz[2].title)                                //
{document.getElementById("lissi").innerHTML="<b style=background:black;color:white>The types of the next column do not match should be   "+flistv2_mz[2].title+" there is "+mtip[ik+1] +".  Input prohibited!</b>"
document.getElementById("liss").innerHTML="."
return
}}}}}
//***************************
if (mtip[ik]!="t" && osv=="")                                         // 
{if (mtip[ik]!=ssp22[parseInt(t.title)].parentNode.title)             // 
{document.getElementById("lissi").innerHTML="<b style=background:black;color:yellow>The types do not match where "+mtip[ik]+" from where "+ssp22[parseInt(t.title)].parentNode.title +",  substitution is prohibited!</b>"
document.getElementById("liss").innerHTML="."
return
}}
document.getElementById("lissi").innerHTML="<b style=color:yellow>Selected for "+rss+"</b>"
if (document.getElementById("kvibz").outerHTML.indexOf('yes.gif')>0) 
{document.getElementById("liss").innerHTML=t.innerHTML
return
}
//***************************
mzvs=""
ssp=t.parentNode.getElementsByTagName("TD")                             //
for(var jj = 0; jj < ssp.length; jj++) 
{mzvs=mzvs+ssp[jj].innerHTML+"/";
}
if  (objspc2==t && rss.indexOf('=')==0)                                 //
{mmm=""
for(var jj = 0; jj < ssp.length; jj++)                                      
{mmm=mmm+ssp[jj].innerHTML+" ";
}}
else
{mmm=t.innerHTML}
if (document.getElementById("liss").innerHTML==mmm)     //
{flistv2(1)
}
ssp=pp.getElementsByTagName("TD")
spkl=ssp[0].innerHTML 
if (document.getElementById("dob3").src.indexOf('yes.gif')>0)
{
if (document.getElementById("liss").innerHTML=="")
{document.getElementById("liss").innerHTML=mmm}
else
{
if (document.getElementById("liss").innerHTML.indexOf(mmm)>=0)   //
{return}
document.getElementById("liss").innerHTML=document.getElementById("liss").innerHTML+", "+mmm
}}
else
{document.getElementById("liss").innerHTML=mmm 
}
www=document.getElementById("liss").innerHTML	   //
document.getElementById("liss").innerHTML=www.replace(".,","")	//
document.getElementById("zvs").innerHTML=mzvs
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
}
olds4=""


//*******************************************************************************
function spc1(pp,event)    // 
//*******************************************************************************
{if (document.getElementById("kvib").outerHTML.indexOf('no.gif')>0)
{if (olds4!="")  
{olds4.parentNode.style.background=""}
}
event = event || window.event
var t = event.target || event.srcElement
if (byellow(t.parentNode.style.background))
{t.parentNode.style.background=""}
else
{t.parentNode.style.background="yellow"}
if (document.getElementById("kvib").outerHTML.indexOf('yes.gif')>0) 
{return
}
else
{ssp=pp.getElementsByTagName("TD")
spkl=ssp[0].innerHTML                                 //
olds4=t
spcc=ssp[0].innerHTML+"-"+ssp[1].innerHTML+"-"+ssp[2].innerHTML+"-"+ssp[3].innerHTML+"-"+ssp[4].innerHTML+"-"+ssp[5].innerHTML
if (document.getElementById("refs").innerHTML==spcc)
{refrep(1)                                             //
}
document.getElementById("refs").innerHTML=spcc
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=0}
}}

//************************************************
function refrep(p)  // 
//************************************************
{bods1=bods
if (p==2)                                   // 
{mbuff3=""
mtr3=document.getElementById("ref1").getElementsByTagName("TR")
if (document.getElementById("kvib").outerHTML.indexOf('yes.gif')>0) 
{vib2=true}
else
{vib2=false}
for(var jj2 = 0; jj2 <= mtr3.length-1; jj2++)  
{mtd3=mtr3[jj2].getElementsByTagName("TD")     //
if (vib2)
{pstr=" "+mtr3[jj2].style.background
if (pstr.indexOf('yellow')>0 )
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff3=mbuff3+"```"
}
mbuff3=mbuff3+(parseInt(mtd3[0].innerHTML)-1)+"n"+"\r\n"
}}
else
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff3=mbuff3+"```"
}
mbuff3=mbuff3+(parseInt(mtd3[0].innerHTML)-1)+"n"+"\r\n"
}}
document.getElementById("buff").value=mbuff3
if (vib2)
{alert("The selected lines are saved in the buffer! \r\nTo add them to the table, click the 'B' button.")
}
else
{alert("All lines are stored in the buffer! \r\nTo add them to the table, click the 'B' button.")
}
document.getElementById("ref").style.display="none"
}
else
{if (p==1)
{if (olds4=="") 
{alert("No choice made!")
return
}
fli=olds4.parentNode.getElementsByTagName("TD") 
obj1.value=parseInt(fli[0].innerHTML)-1+"n"
mktst[0].click()
}
document.getElementById("ref").style.display="none"
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=bods1}
}}
//***************************
function Bs()
//***************************
{if (document.getElementById("liss").innerHTML==".")
//
{alert("Click the column you want!")
return
}
if (document.getElementById("kvibz").outerHTML.indexOf('yes.gif')>0) 
{vib2=true}
else
{vib2=false}
isd2=olds2.title
mdiv2=document.getElementById("lisdiv").getElementsByTagName("DIV")  //
mbuff2=""
for(var jj = 0; jj <= mdiv2.length-1; jj++)  
{if  (mdiv2[jj].style.display!="none")          //
{mtr2=mdiv2[jj].getElementsByTagName("TR")      //
vno=true                                        //
for(var jj2 = 1; jj2 <= mtr2.length-1; jj2++)   //
{if (byellow(mtr2[jj2].style.background))
{vno=false
break
}}
for(var jj2 = 1; jj2 <= mtr2.length-1; jj2++)  
{mtd2=mtr2[jj2].getElementsByTagName("TD")      //
if (vib2)                                       //
{pstr=" "+mtr2[jj2].style.background
if (pstr.indexOf('yellow')>0 )
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff2=mbuff2+"```"
}
if (document.getElementById("repo").innerHTML.indexOf('=')>0) 
{mbuff2=mbuff2+mtd2[isd2].innerHTML+"```"+mtd2[parseInt(isd2)+1].innerHTML+"\r\n"
}
else       
{mbuff2=mbuff2+mtd2[isd2].innerHTML+"\r\n"
}}}
else
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff2=mbuff2+"```"
}
if (document.getElementById("repo").innerHTML.indexOf('=')>0) 
{mbuff2=mbuff2+mtd2[isd2].innerHTML+"```"+mtd2[parseInt(isd2)+1].innerHTML+"\r\n"
}
else       
{mbuff2=mbuff2+mtd2[isd2].innerHTML+"\r\n"
}}}}}
document.getElementById("buff").value=mbuff2
if (vib2)
{alert("The selected lines are saved in the buffer! \r\nTo add them to the table, click the 'B' button")
}
else
{alert("All lines are stored in the buffer! \r\nTo add them to the table, click the 'B' button")
}
document.getElementById("lis").style.display="none"
return
}



//***************************************************
function flistv2(p)    // 
//***************************************************
{ik=parseInt(obj1.id.replace("ta",""),10)
//***************************************************************************
if (p==4)                                  //
{if (document.getElementById("kvibp").outerHTML.indexOf('yes.gif')>0) 
{vib2=true}
else
{vib2=false}
mdiv2=document.getElementById("list").getElementsByTagName("DIV")  //
mbuff2=""
for(var jj = 1; jj <= mdiv2.length-1; jj++)  
{if  (mdiv2[jj].style.display!="none")          //
{mtr2=mdiv2[jj].getElementsByTagName("TR")      //
for(var jj2 = 1; jj2 <= mtr2.length-1; jj2++)  
{mtd2=mtr2[jj2].getElementsByTagName("TD")      //
if (vib2)                                       //
{pstr=" "+mtr2[jj2].style.background
if (pstr.indexOf('yellow')>0 )
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff2=mbuff2+"```"
}
mbuff2=mbuff2+(parseInt(mtd2[0].innerHTML))+"\r\n"
}}
else                                            //
{for(var jj3 = 1; jj3 < ik; jj3++)  
{mbuff2=mbuff2+"```"
}
mbuff2=mbuff2+(parseInt(mtd2[0].innerHTML))+"\r\n"
}}}}
document.getElementById("buff").value=mbuff2
if (vib2)
{alert("The selected lines are saved in the buffer! \r\nTo add them to the table, click the 'B' button")
}
else
{alert("All lines are stored in the buffer! \r\nTo add them to the table, click the 'B' button")
}
document.getElementById("list").style.display="none"
document.getElementById("list"+ik).style.display="none"
}
else
{bods1=bods
if (document.getElementById("liss").innerHTML==".")
{alert("No choice !")
return}
if (p==1)
{obj1.value=document.getElementById("liss").innerHTML}
else
{
obj1.value=obj1.value+","+document.getElementById("liss").innerHTML     //
}
if (document.getElementById("repo").innerHTML.indexOf('=')>0)           //
{if ((ik+2)<mstd.length)                                                //
{mzvs=document.getElementById("zvs").innerHTML.split('/')
if (document.getElementById("f555").style.display=="none")
{mtextarea[ik+1].value=mzvs[2]
}
else
{mtextarea2[ik+1].value=mzvs[2]
}}}
document.getElementById("lis").style.display="none"
objj.click()
if  (form.elements["mob"].value==1) 
{document.getElementById("bod").scrollTop=bods1}
}}



//************************************************
function flistv(p)   //
//************************************************
{bods1=bods
ik=parseInt(obj1.id.replace("ta",""),10)
if (p==4)                                                      //
{if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=bods}
}
//******************************
else if (p==2)                                              //
{if (document.getElementById("sel").style.display=="")
{mspi=0
mtex=""
mdivtr=document.getElementById("list"+iks).getElementsByTagName("TR")  //
for(var jj = 0; jj < mdivtr.length; jj++)  
{if (mdivtr[jj].outerHTML.indexOf('yes.gif')>0)  //
{mspi=mspi+(jj)+"/"
mtr=mdivtr[jj].getElementsByTagName("TD")
mtex=mtex+mtr[1].innerHTML+","
}}
obju.value=mspi
obju.title=mtex
document.getElementById("list"+iks).style.display="none"
document.getElementById("list").style.display="none"
}
else
{alert("Only in the selection!")
return
}}
//*************************************************************
else if (p==3)        // 
{if (!monn)
{alert("The list can only be edited \r\nby the ADMINISTRATOR in exclusive mode!")
return
}

// 
inn=false
for(var j = 0; j < table.length; j++)                    //
 { if (table[j][0]=="?")                                 //
 {inn=true; break }
 if (table[j][table[j].length-1].indexOf('yes.gif')>0)   //
 {inn=true; break}
}
if (inn)
{alert("The list cannot be edited! \r\n Changes have been made to the table! \r\n Click OK, Cancel, save changes (save button) or discard them (refresh button).")
return
}
//
beg=table[0][0]
beg=parseInt(beg)                                        //
form.elements["tbeg"].value=beg
form.elements["tend"].value=beg+table.length-1
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{ttk=fli[j].outerHTML
ttk=ttk.toUpperCase()
if (fli[j].name=="v" && (ttk.indexOf('CHECKED')>0 ||  ttk.indexOf('checked')>0 ))
{vv=parseInt(fli[j].value)
}}
beg=1
end=beg+vv    
form.elements["retu2"].value="tables.php"+par.split('tables.php')[1]    //
<?php 
if ($mm5==3)                                    //
{echo '_2ss="'.$_3s.'";';}                              
else                                            //
{echo '_2ss="'.$_2s.'";';}                                
?>
par1=_2ss+"/"+"1-"+(ik)+".txt"
mmsap=mst[0].getElementsByTagName("TD")         //
form.elements["pp"].value=mmsap[ik].innerHTML
zag5=window.top.frames[0].document.getElementById("zag").innerHTML
if (zag5!=document.getElementById("zag").innerHTML)
{zag5=zag5+" - "+document.getElementById("zag").innerHTML}
w7=document.getElementById("tabl_sel")
if (w7!=undefined)
{
//alert(w7)
zag5=zag5+" - "+w7.options[w7.selectedIndex].text}
document.getElementById("zag5").value=zag5    // 
form.elements["napr"].value=0
document.getElementById("form").action="tables.php?tabl="+par1
form.elements["submit"].click()
}
else
{if (olds=="")
{alert("No choice made!")
return
}

if (olds.tagName=="IMG" || olds.tagName=="img")
{olds=olds.parentNode}
fli=olds.parentNode.getElementsByTagName("TD") 
obj1.value=fli[1].innerHTML
obj1.name=fli[0].innerHTML
document.getElementById("list").style.display="none"
if  (form.elements["mob"].value==1) 
{document.getElementById("bod").scrollTop=bods1}
}
if (iks!=0)                                                    //
{document.getElementById("list"+iks).style.display="none"
}
else
{document.getElementById("list"+ik).style.display="none"       //
}
document.getElementById("list").style.display="none"          // 
if (objj!="")
{objj.click()
}
}

psel=true                                     // 
select=false                                  // 
//************************************************
function sel1(p,p2)   //   
//************************************************
{
if (tab2.indexOf("-")>0 && p2==2 )                  // 
{alert("For lookup field tables, server-side filtering is not provided!")
return
}
seltext()                                  //
select=true
if (p2==0)
{document.getElementById("vsel").innerHTML=" only on the group"
psel=true                                    //

if  (form.elements["glob"].value==1)    //(window.top.serv==2)
{document.getElementById("repo").innerHTML="SELECTION ON THE SERVER AND DIRECT IN THE GROUP!"
}
else
{document.getElementById("repo").innerHTML="SELECTION DIRECT IN THE GROUP!"
}}
else if (p2==1)
{document.getElementById("vsel").innerHTML=" except on the group"
psel=false                                   //
if  (form.elements["glob"].value==1)   //(window.top.serv==2)
{document.getElementById("repo").innerHTML="SELECTION ON THE SERVER AND BACK IN THE GROUP!"
}
else
{document.getElementById("repo").innerHTML="BACK SELECTION IN THE GROUP!"
}}
else if (p2==2)
{
if (document.getElementById("zag").innerHTML=="ALL ROWS")
{alert("Use all lines here \r\n sample in the group, do not load the server!")
return
}
document.getElementById("vsel").innerHTML=" only on the server "
window.top.serv=2                          // 
psel=true                                  // 
//************************************
// 
//************************************
if (mpar.length==1)                       //
{window.top.st4=document.getElementById('seltext2').innerHTML
}
if (mpar.length==2)                      //
{
window.top.st24=document.getElementById('seltext2').innerHTML
}
if (mpar.length==3)                     //
{window.top.st34=document.getElementById('seltext2').innerHTML
}}
for(var i = 0; i < msel.length; i++)       //
{msel[i][0]=""
msel[i][1]=""
msel[i][2]=""
}
os=""
ku2=0
fli=document.getElementById("selp").getElementsByTagName("TR") 
for(var j = 1; j < fli.length; j++)   
{flitd=fli[j].getElementsByTagName("TD") 
flii=fli[j].getElementsByTagName("INPUT") 
for(var jj = 0; jj < flii.length; jj++)   
{if (flii[jj].value!="")
{ku2++}
if (flii[jj].name=="minn")
{msel[j-1][0]=flii[jj].value}
if (flii[jj].name=="maxx")
{msel[j-1][1]=flii[jj].value}
if (flii[jj].name=="spi")                             // 
{if (flitd[2].innerHTML=="L" && flii[jj].title!="")   // 
{msel[j-1][2]=flii[jj].value+"+++"+flii[jj].title    
}
else
{msel[j-1][2]=flii[jj].value}
}
if (msel[j-1][0]!="" && msel[j-1][1]!="")
{if (mtip[j]=="i")
{if (parseInt(msel[j-1][0])>parseInt(msel[j-1][1]))
{os=os+"Integer value from="+ msel[j-1][0]+" more value before="+ msel[j-1][1]+" !"; 
alert("selection is not possible, \r\ncorrect errors:\r\n"+os)
return
}}
if (mtip[j]=="$")
{if (parseFloat(msel[j-1][0])>parseFloat(msel[j-1][1]))
{os=os+"The value of money from="+ msel[j-1][0]+" more value before="+ msel[j-1][1]+" !"
alert("selection is not possible, \r\ncorrect errors:\r\n"+os)
return
}}}}}
if (ku2==0)
{alert("There are no conditions for selection! \r\n Enter conditions!")
return
}
if (os!="")
{alert("selection is not possible, \r\ncorrect errors:\r\n"+os)}
else
{selut=""
selu=document.getElementById('sel1').getElementsByTagName("TR") 
for(var jj = 2; jj < selu.length; jj++)  
{selu2=selu[jj].getElementsByTagName("TD") 
selu3=selu[jj].getElementsByTagName("INPUT") 
if (selu3.length==3)                                                  //
{if (selu3[0].value!="" || selu3[1].value!="" || selu3[2].value!="")
selut=selut+selu2[1].innerHTML
if (selu3[0].value!="")
{selut=selut+", from "+selu3[0].value
}
if (selu3[1].value!="")
{selut=selut+", to "+selu3[1].value
}
if (selu3[2].value!="")
{selut=selut+", by the list: "+selu3[2].value
}}
else                                                                //
{if (selu3[0].value!="")
{selut=selut+selu2[1].innerHTML+", by the list: "+selu3[0].value
}}}
document.getElementById('tsel').innerHTML=selut
if (mpar.length==1)                                                  // 
{if (window.top.document.getElementById('ifr1')!=undefined)
 {window.top.document.getElementById('ifr1').style.visibility="hidden" }
 if (window.top.document.getElementById('ifr2')!=undefined)
 { window.top.document.getElementById('ifr2').style.visibility="hidden" }
 }
if (mpar.length==2 && tab2.indexOf("-")<0)                             //
{if (window.top.document.getElementById('ifr2')!=undefined)
 { window.top.document.getElementById('ifr2').style.visibility="hidden" }
 }
document.getElementById("sel").style.display="none"
document.getElementById("h").style.visibility="hidden"
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=bods}
vib=true

if (p2==2)                                                         //
{if (form.elements["glob"].value==1 && document.getElementById("pokz").innerHTML==document.getElementById("tmax").innerHTML)
{alert("All data is here! \r\n Filtering on the server does not make sense! \r\n Please select 'only'.")
return
}
document.getElementById("h").style.visibility="visible"
jdv(0)
window.top.serv=2
msel0=""
msel1=""
msel2=""
for(var i = 0; i < msel.length; i++)         
{msel0=msel0+msel[i][0]+"#"
msel1=msel1+msel[i][1]+"#"
msel2=msel2+msel[i][2]+"#"
}
form.elements["stt1"].value=msel0
form.elements["stt2"].value=msel1
form.elements["stt3"].value=msel2
//*****************************************
// 
w7=document.getElementById("tabl_sel")
if (w7!=undefined)
{tnap=w7.options[w7.selectedIndex].text
window.top.st_tabl=tnap
}
if (mpar.length==1 )
{window.top.st1=msel0.substr(0,msel0.length-1)
window.top.st2=msel1.substr(0,msel1.length-1)
window.top.st3=msel2.substr(0,msel2.length-1)
}
if (mpar.length==2)
{window.top.st21=msel0.substr(0,msel0.length-1)
window.top.st22=msel1.substr(0,msel1.length-1)
window.top.st23=msel2.substr(0,msel2.length-1)
}
if (mpar.length==3)
{window.top.st31=msel0.substr(0,msel0.length-1)
window.top.st32=msel1.substr(0,msel1.length-1)
window.top.st33=msel2.substr(0,msel2.length-1)
}
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{if (fli[j].name=="v" )
{vv=fli[j].value
if (vv==999999)
{fli[j].checked=true}}}
form.elements["napr"].value=0
vv=999999
form.elements["glob"].value=1              //
form.elements["napr"].value=4              //
par=document.getElementById("form").action
document.getElementById("form").action=par.split('.txt')[0]+".txt&v=9999&beg=1&end=9999"
form.elements["soob"].value="SELECTION ON THE SERVER!"
form.elements["sele"].click()
}
else
{otm(1)    // 
crz(1)
}}}
//****************************************************
function selc(p)   // 
//****************************************************
{fli=document.getElementById("selp").getElementsByTagName("TR") 
for(var j = 1; j < fli.length; j++)   
{flii=fli[j].getElementsByTagName("INPUT") 
for(var jj = 0; jj < flii.length; jj++)   
{flii[jj].value=""
flii[jj].title=""
}}
if (mpar.length==1)
{window.top.st1=""
window.top.st2=""
window.top.st3=""
}
if (mpar.length==2)
{window.top.st21=""
window.top.st22=""
window.top.st23=""
}
if (mpar.length==3)
{window.top.st31=""
window.top.st32=""
window.top.st33=""
}
}


//*************************************************************************
function selca(p)                                   //
//*************************************************************************
{document.getElementById("sel").style.display="none"
document.getElementById("h").style.visibility="hidden"
document.getElementById("tsort").innerHTML=""
select=false 
if  (form.elements["glob"].value==1)                       //
{
selg(0)                                                   // 
return
}
if (p==1)
{select=false
psel=true
document.getElementById("repo").innerHTML="Cancel selection!"
otm(1)                                                   // 
}
if  (form.elements["mob"].value==1) {document.getElementById("bod").scrollTop=bods}
crz(1)
if (document.getElementById('suu3')!=undefined)
{document.getElementById('suu3').selectedIndex=0       //
}}
//************************************************
function cb1(p)      //
//************************************************
{if (p.outerHTML.indexOf('yes.gif')>0)
{p.src='../../../../d~e~f/no.gif'} 
else
{p.src='../../../../d~e~f/yes.gif'} 
}
//************************************************************
function utt(p)     // 
//************************************************************
{fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{ttk=fli[j].outerHTML
ttk=ttk.toUpperCase()
if (fli[j].name=="v" && ttk.indexOf('CHECKED')>0)
{vv=fli[j].value
}}
if (window.top.serv==2)
{fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{if (fli[j].name=="v" )
{vv=fli[j].value
if (vv==10)
{fli[j].checked=true}}}
}
ut(p)
}

//*******************************************************************
function ut(p)                              //
//*******************************************************************
{if (form.elements["glob"].value==1 )
{alert("Group navigation is not possible! \r\n The table shows the descendants of all parents!")
return
}
beg=0                                                  //
inn=false                                              //
for(var j = 0; j < table.length; j++)                  //
 {if (table[j][0]=="?")                                //
 {inn=true; break }
 if (table[j][table[j].length-1].indexOf('yes.gif')>0) //
 {inn=true; break}
}
if (inn)
{if (!confirm("They will be canceled!. \r\n Click 'Cancel' to cancel. ")) 
{return}
}
jdv(0)
document.getElementById("h").style.visibility="visible"
form.elements["napr"].value=p                           // 
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{ttk=fli[j].outerHTML
ttk=ttk.toUpperCase()
if (fli[j].name=="v" && ttk.indexOf('CHECKED')>0)
{vv=fli[j].value
}}
if (vv==999999)
{beg=1
end=999999
form.elements["napr"].value=0
}
else
{if  (table.length==0)
{beg=parseInt(document.getElementById("tmax").innerHTML,10)-parseInt(vv,10)
beg=0
end=0
if (p==1 || p==2 || p==3)
{form.elements["napr"].value=4                         //
}}
else
{beg=table[0][0]
beg=parseInt(beg,10)                                  //
end=beg+parseInt(table.length,10)-1                   //
}}
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
mre=""
if (p==0)                                            //
{if  (window.top.serv==2)
{mre="Cancel selection on the server! Done at the BEGINNING!"
}
else
{mre="Done at the BEGINNING!"
}
}
if (p==1)
{mre="To the previous!!"}
if (p==2)
{mre="To the NEXT!"}
if (p==3)
{mre="Tot the end!"}
form.elements["soob"].value=mre
jdv(0)
form.elements["submit"].click()
}

//*********************************************************************************************************
function go(p)                           // 
//*********************************************************************************************************
{if (table.length==0)
{return} 
msstr1=" ,0,1,2,3,4,5,6,7,8,9,"
to=form.elements["to"].value
msstr=to.split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(","+msstr[ii]+",")<0) 
{alert("Non-numeric value of the line number for the transition, \r\n enter an integer> 0 but less than \r\nthe number of rows in the table!")
return}
}
to=parseInt(to,10)
if (document.getElementById("tmax").innerHTML==document.getElementById("pokz").innerHTML)
{document.getElementById("div").scrollTop=mst[to].offsetTop
}
else
{to1=parseInt(document.getElementById("tmax").innerHTML,10)
if (to<=0 || to>to1)
{alert("There is no such "+ to +" line number for the transition, \r\n enter an integer> 0 but less than \r\nthe number of rows in the table!")
return}
document.getElementById("h").style.visibility="visible"
beg=to
fli=document.getElementById("form").getElementsByTagName("INPUT") 
for(var j = 0; j < fli.length; j++)   
{if (fli[j].name=="v" )
{if (fli[j].checked)
{vvv=fli[j].value}
}}
end=beg+parseInt(vvv)-1
vv=table.length
form.elements["napr"].value=4               //
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end

form.elements["soob"].value="Line jump completed!"
jdv(0)
form.elements["submit"].click()
}}
//********************************************
function totable()    //  
//********************************************
{beg=parseInt(form.elements["tbeg"].value)
end=parseInt(form.elements["tend"].value)
vv=end-beg
form.elements["pp"].value=""
form.elements["napr"].value=4              //
document.getElementById("form").action=form.elements["retu2"].value+"&beg="+beg+"&end="+end
document.getElementById("repo").innerHTML="Wait..."
window.top.document.getElementById('jd').style.display=""
form.elements["soob"].value="Return to the table!"
form.elements["submit"].click()
}

//**********************************************
function aend()     //  
//**********************************************
{if (table.length!=0)
{if (table[0][0]=="?")
{return}
}
fli=document.getElementById("form").getElementsByTagName("INPUT")
for(var j = 0; j < fli.length; j++)   
{ttk=fli[j].outerHTML
ttk=ttk.toUpperCase()
if (fli[j].name=="v" && ttk.indexOf('CHECKED')>0)
{vv=fli[j].value
}}
if (vv==999999)                                    //
{mst[mst.length-1].click()                         //
ad(1)                                              //
document.getElementById("div").scrollTop=9999999	
return
}
beg=parseInt(document.getElementById("tmax").innerHTML)
end=beg+table.length-1
vv=table.length
form.elements["napr"].value=4              // 
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
form.elements["soob"].value="End of the table!"
jdv(0)
form.elements["submit"].click()
}

//*******************************************************
function savi()   // 
//*******************************************************
{is=parseInt(obj1.id.replace("ta",""),10)
if (chto=="del")   //
{
document.getElementById("napr").elements["napr"]=is
document.getElementById("form").elements["com"].value=0
jdv(0)
document.getElementById("obn").click()
return
}
if (chto=="ins")   //
{iis=is+1
is++
alert("To enter default values, \r\n after pasting, click on the table row, \r\n "+
"whose values will be the default, \r\n" +
"or add a line, enter all the necessary values \r\n" +
"click 'A' click 'Modify column'\r\n click 'and to save click me' ")
}         //
else
{iis=0
sdopp=" ,dt,it,$t,Lt,at,ta,iL,Li,tt,dd,ii,$$,LL,aa,"   //
pop=","+oldtip+newtip+","
if (sdopp.indexOf(pop)<0)
{alert("Type conversion "+oldtip+"->"+newtip+" prohibited !" )
return
}}
if (document.getElementById("anew").value.indexOf("/")>0)
{alert("Invalid character / in header!")
return
}
// 
stip=""
sminmax=""
sdef=""
szag=""
spod=""
stip=""
for(var i=0; i<mtip.length; i++)  
{if (i==is)
{stip=stip+newtip+"```"
if (iis!=0)
{stip=stip+mtip[i]+"```"}
}
else
{stip=stip+mtip[i]+"```"}
}
if (iis==mtip.length)
{stip=stip+newtip+"```"}
poz=stip.lastIndexOf("```")
stip=stip.substr(0,poz)

newminmax=document.getElementById("pminn").value+","+document.getElementById("pmaxx").value
// 
sminmax=""
for(var i=0; i<mminmax.length; i++)  
{if (i==is)
{sminmax=sminmax+newminmax+"```"
if (iis!=0)
{sminmax=sminmax+mminmax[i]+"```"
}}
else
{sminmax=sminmax+mminmax[i]+"```"}
}
if (iis==mtip.length)
{sminmax=sminmax+newminmax+"```"}
poz=sminmax.lastIndexOf("```")
sminmax=sminmax.substr(0,poz)

// 
newdef=document.getElementById("deff").value
sdef=""
for(var i=0; i<mdef.length; i++)  
{if (i==is)
{sdef=sdef+newdef+"```"
if (iis!=0)
{sdef=sdef+mdef[i]+"```"
}}
else
{sdef=sdef+mdef[i]+"```"}
}
if (iis==mtip.length)
{sdef=sdef+newdef+"```"}
poz=sdef.lastIndexOf("```")
sdef=sdef.substr(0,poz)

// 

newzag=document.getElementById("anew").value+"/"+document.getElementById("oboz2").value+"/"+document.getElementById("sabl").value+
"/"+document.getElementById("opis").value
newzag=newzag.replace(/\r\n/g,"")
newzag2=newzag.replace(/<br>/g,"")
newzag2=" "+newzag2.replace(/<BR>/g,"")
if (newzag2.lastIndexOf("<")>0)
{alert("< Character found in title, remove tags and repeat!");return;}
if (document.getElementById("aold").innerHTML!=newzag || chto=="ins")
{szag=""
mmzag2=document.getElementById("t").getElementsByTagName("TR") 
mmzag=mmzag2[0].getElementsByTagName("TD") 
if  (chto=="ins")                                                              // 
{for(var i=0; i<=mmzag.length-2; i++)                                          // 
{
//alert(mmzag[i].innerHTML)
if (i==is)                                                                    // 
{szag=szag+newzag+"```"}                                                       //
szag=szag+mmzag[i].innerHTML+"/"+moboz2[i]+"/"+msabl[i]+"/"+mopis[i]+"```"     //
}}                                                                             //
else                                                                           //
{for(var i=0; i<=mmzag.length-2; i++)                                          //
{if (i==is)                                                                    //
{szag=szag+newzag+"```"}                                                       //
else                                                                           //
{szag=szag+mmzag[i].innerHTML+"/"+moboz2[i]+"/"+msabl[i]+"/"+mopis[i]+"```"    //
}}}
mszag=szag.split("```")
for(var i=0; i<mszag.length-1; i++)  
{if (i<(mszag.length-2))
{if (mszag[i].lastIndexOf("=")>0 && (mszag[i+1].lastIndexOf("=")>0 || mszag[i+1].lastIndexOf("!")>0))  
{{alert("A column containing = cannot be followed \r\nby a column containing = or !");
return;
}}}}
if (iis==mtip.length)
{szag=szag+newzag+"```"}
poz=szag.lastIndexOf("```")
szag=szag.substr(0,poz)
}
//alert(szag)


// 
newpod=document.getElementById("podstx").value     // 
spod=""                                            // 
for(var i=0; i<mpod.length; i++)                   // 
{if (i==is)                                        // 
{spod=spod+newpod+"```"                            // 
if (iis!=0)                                        
{spod=spod+mpod[i]+"```"}
}
else
{spod=spod+mpod[i]+"```"}
}
if (iis==mpod.length)
{spod=spod+newpod+"```"}
poz=spod.lastIndexOf("```")
spod=spod.substr(0,poz)

if (chto=="ins")                                        // 
{document.getElementById("form").elements["com"].value=2
}
else                                                     // 
{document.getElementById("form").elements["com"].value=1
}
mst1=""
msel.length=mtip.length                      // 
for(var i = 0; i < msel.length; i++)         // 
{msel[i] = new Array()                        // 
 msel[i].length=3
 mst1=mst1+"#"
 for(var ii = 0; ii <3; ii++)  // 
 {msel[i][ii]=""
}}
if (mpar.length==1)
{window.top.st1=mst1
window.top.st2=mst1
window.top.st3=mst1
}
if (mpar.length==2)
{window.top.st21=mst1
window.top.st22=mst1
window.top.st23=mst1
}
if (mpar.length==3)
{window.top.st31=mst1
window.top.st32=mst1
window.top.st33=mst1
}
selc()
document.getElementById("form").elements["ns"].value=iis
document.getElementById("form").elements["st1"].value=stip
document.getElementById("form").elements["st2"].value=sminmax
document.getElementById("form").elements["st3"].value=sdef
document.getElementById("form").elements["st4"].value=szag
document.getElementById("form").elements["st5"].value=spod
jdv(0)
document.getElementById("obn").click()                   // 
}
//************************
function zam2()
//************************
{if (!monn)
{alert("Column copying is possible only in exclusive mode! \r\n Set a monopoly and repeat!")
return
}
z1=parseInt(document.getElementById("zam1").value)
z2=parseInt(document.getElementById("zam2").value)
kz=mzag.length-1
if (isNaN(z1) || isNaN(z2))
{alert("Column numbers, when copied, only integers in the range from 1 to "+kz+ " ! \r\n Enter 'which' and 'where' and repeat!")
return}
if (z1<1 || z1>kz || z2<1 || z2>kz)
{alert("Column numbers, when copied, only integers in the range from 1 to "+kz+ " ! \r\n Enter 'which' and 'where' and repeat!")
return}
if (mtip[z1-1]!=mtip[z2-1])
{alert("Columns 'what' and 'where' must be of the same type! \r\n Enter the 'what' and 'where' correctly and repeat!")
return}
document.getElementById("repo").innerHTML="Wait ..."
for(var j = 0; j < table.length; j++)       //
{if (mpok[j])                               //
{table[j][z2-1]=table[j][z1-1]
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
kz++
}}
if (mtip[z1-1]=="L")     // 
{document.getElementById("kstol").value=(z1-1)+"-"+(z2-1)
}
otm(1)
crz(1)
document.getElementById("repo").innerHTML="COPY from  done "+z1+" to "+z2+" done !"
alert("To finish copying columns on server \r\n click 'Save' to cancel 'Update'")
}


//************************************************
function zam()    // 
//************************************************
{if (!monn)
{alert("Multiple replacement is only possible in exclusive mode! \r\n Set a monopoly and repeat!")
return
}
if (obj1=="")
{alert("No replacement column selected!");return}
if (obj1.readOnly)
{alert("Substitution is prohibited!")
return
}
ik=parseInt(obj1.id.replace("ta",""),10)
if (ik==0 || mtip[ik]=="a")
{alert("Replacement in this column is not possible!");return}
z1=document.getElementById("zam1").value
z2=document.getElementById("zam2").value
tipzam=""
kz=0   // 
//****************************************
if (z1=="")   //
// 
{if (mtip[ik]=="L")    // 
{if (isNaN(z2))
{alert("Such a replacement in the list is not possible! ")
return}}
if (mtip[ik]=="i" || mtip[ik]=="$")    // 
{z2_=" "+z2
if (mtip[ik]=="$")    //  
{z2=z2.replace(",",".")
z21=z2.replace("+","")
z21=z21.replace("-","")
z21=z21.replace("*","")
z21=z21.replace("/","")
z21=z21.replace(",",".")
sim4=z21.substr(z21.length-3,1)
if (sim4!=".")
{sim4=z21.substr(z21.length-4,1)
if (sim4!=".")
{if (z2!="")
{alert("Enter money!");return
}}}}
// 
sim=z2.substr(0,1)
ks=" +-*/0123456789"
if (ks.indexOf(sim,1)<0)
{alert("Invalid 1 character "+sim);return;}
// 
sim2=z2.substr(z2.length-1,1)
ks2=" -+0123456789"
if (ks2.indexOf(sim2,1)<0)
{alert("Invalid last character "+sim2);return;}
// 
sim3=z2.substr(1,z2.length-2)
mpar7=sim3.split('')
ks3=".1234567890"
if (mtip[ik]=="$")  ks3=ks3+"."    
for(var j = 0; j < mpar7.length; j++)  
{if (ks3.indexOf(mpar7[j],0)<0)
{alert("Not a number "+mpar7[j]);return;
}}
tipzam="z"  
if (sim3.indexOf('+',0)+sim3.indexOf('-',0)+sim3.indexOf('*',0)+sim3.indexOf('/',0)!=-4)
{alert("If you add + at the beginning, if at the end it is a counter, \r\n if at the top - / * this is an action, the rest is ERROR! ")
return
}
if (z2.substr(z2.length-1,1)=="+")
{z2=z2.substr(0,z2.length-1)
if (!confirm("Unconditional replacement by a counter with an increase, starting "+z2+". \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="s"    
}
if (z2.substr(z2.length-1,1)=="-" )
{z2=z2.substr(0,z2.length-1)
if (!confirm("Unconditional replacement by counter by decreasing, starting "+ z2 +". \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="m"    
}
if (z2.substr(0,1)=="+")
{z2=z2.substr(1,z2.length-1)
if (!confirm("Unconditional replacement with the addition of "+ z2 +" \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="+"                          
}
if (z2.substr(0,1)=="-")
{z2=z2.substr(1,z2.length-1)
if (!confirm("Unconditional replacement with subtraction "+ z2 +". \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="-"                          
}
if (z2.substr(0,1)=="*")
{z2=z2.substr(1,z2.length-1)
if (!confirm("Unconditional replacement of values by multiplying by "+ z2 +" \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="*"                          
}
if (z2.substr(0,1)=="/")
{z2=z2.substr(1,z2.length-1)
if (!confirm("Unconditional replacement of values by division by "+ z2 +" \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="/"                          
}
if (tipzam=="z")
{if (!confirm("Unconditional replacement "+ z2 +". \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
}
if (mtip[ik]=="$")  
{z22=parseFloat(z2)}
else
{z22=parseInt(z2,10)                        // 
}
for(var j = 0; j < table.length; j++)       // 
{if (mpok[j])                               // 
{if (z2=="")
{table[j][ik]=""}
else
{if (mtip[ik]=="$")  
{ttz=parseFloat(table[j][ik])
}
else
{ttz=parseInt(table[j][ik],10)
}
if (tipzam=="z") {table[j][ik]=z22}          //
if (tipzam=="s") 
{table[j][ik]=z22+j}
if (tipzam=="m") 
{table[j][ik]=z22-j}
                       //
if (tipzam=="+") {table[j][ik]=ttz+z22}
if (tipzam=="-") {table[j][ik]=ttz-z22}
if (tipzam=="*") {table[j][ik]=ttz*z22}
if (tipzam=="/") {table[j][ik]=ttz/z22}
if (mtip[ik]=="$")  
{table[j][ik]=table[j][ik].toFixed(2)} 
if (mtip[ik]=="i")  
{table[j][ik]=table[j][ik].toFixed(0)} 
}
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
kz++
}}}
//********************************
else  // 
//********************************
{tipzam="z"
if (mtip[ik]=="d")
{if (z2=="")
{for(var j = 0; j < table.length; j++) 
{if (mpok[j])                               // 
{table[j][ik]=""
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
}}
 otm(1)
 crz(1)
return
}
if (z2.substr(z2.length-1,1)=="+")
{z2=z2.substr(0,z2.length-1)
tipzam="sd"
}
z2=z2.replace(/,/g,".")
z2=z2.replace(new RegExp("/",'g'),".")
mda=z2.split(".")
if (mda.length!=3)
{alert("This" + z2 + "is not a date!")
return
}
if (mda[0]<=0 || mda[0]>31 || mda[1]<=0 || mda[1]>12 || mda[2]<=1900 || mda[2]>2100)   
{alert("Date error "+z2+" !")
return
}
td=parseInt(mda[0])
tm=parseInt(mda[1])
ty=parseInt(mda[2])
jj=td
ty1=ty
if (!validate_date(z2)) return;
}
if (z2.substr(0,1)=="&")
{z2=z2.substr(1,z2.length-1)
if (!confirm("Unconditional replacement with the addition of "+ z2 +" at the beginning. \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="do"                          
}
if (z2.substr(z2.length-1,1)=="&")
{z2=z2.substr(0,z2.length-1)
if (!confirm("Unconditional replacement with the addition of "+ z2 +" at the end. \r\nSelectable. No full control! \r\n Click Cancel to cancel. ")) 
{return}
tipzam="posle"    
}
if (z2.substr(z2.length-1,1)=="+")
{z2=z2.substr(0,z2.length-1)
if (!confirm("Unconditional replacement by adding a counter at the beginning to increase, starting "+ z2 +" \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="s"    
kvd(z2,ik)                                  //
if (otmm) return
z22=parseInt(z2,10)
}
if (z2.substr(z2.length-1,1)=="-")
{z2=z2.substr(0,z2.length-1)
if (!confirm("Unconditional replacement by adding a counter at the beginning to decreasing, starting "+ z2 +". \r\n by selection. No full control! \r\n Click 'Cancel' to cancel. ")) 
{return}
tipzam="m"    
kvd(z2,ik)                                  //
if (otmm) return
z22=parseInt(z2,10)
}
if (mtip[ik]=="d" && tipzam!="z" && tipzam!="sd" )
{alert("For a column with dates, only filling the counter by day is allowed!")
return
}
for(var j = 0; j < table.length; j++)       //
{if (mpok[j])                               //
{if (tipzam=="z") {table[j][ik]=z2}
if (tipzam=="s") {table[j][ik]=z22+j+" "+table[j][ik]}
if (tipzam=="m") {table[j][ik]=z22-j+" "+table[j][ik]}
if (tipzam=="sd") 
{if (jj<=9)
{td1="0"+jj}
else
{td1=jj}
if (tm<=9)
{tm1="0"+tm}
else
{tm1=tm}
table[j][ik]=td1+"."+tm1+"."+ty1
if (!validate_date((jj+1)+"."+tm1+"."+ty1))
{tm++
jj=1
if (tm==13)
{ty1++;tm=1}
}
else
{jj++}
}
if (tipzam=="do") {table[j][ik]=z2+table[j][ik]}
if (tipzam=="posle") {table[j][ik]=table[j][ik]+z2}
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
kz++
}}}}
//***********************************************************
else                //
{if (z1==z2)         
{alert("The contexts are equal!");return}
kvd(z1,ik)          //
if (otmm) return
kvd(z2,ik)          //

if (otmm) return
kz=0
if (mtip[ik]=="i" || mtip[ik]=="$"  || mtip[ik]=="L")   //
{for(var j = 0; j < table.length; j++)                  //
{if (table[j][ik]==z1 && mpok[j])                       //
{table[j][ik]=z2
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
kz++
}}}
else
{for(var j = 0; j < table.length; j++)       //
{
//kzz=". "+table[j][ik]
kzz=table[j][ik]
//alert(z1+"   "+kzz)
if (kzz.indexOf(z1)>=0 && mpok[j])        //
{table[j][ik]=table[j][ik].replace(z1,z2)
table[j][table[j].length-1]="<img src=../../../../d~e~f/yes.gif><img src=../../../../d~e~f/no.gif>"
kz++
}}}}
if (kz==0)
{document.getElementById("repo").innerHTML="REPLACEMENT, replacement strings - "+kz+" !"
}
else
{
document.getElementById("repo").innerHTML="REPLACEMENT completed, lines with replacement - "+kz+" !"
}
 otm(1)
 crz(1)
}


//**********************************************************
function kvd(p,i)   //  
//**********************************************************
{otmm=false
msstr1=" ,0,1,2,3,4,5,6,7,8,9,"
//**********************************************
// 
if (mtip[i]=="t")
{ree=p         //
ree=ree.replace(/<br>/g," ")
ree=ree.replace(/<BR>/g," ")
document.getElementById("prov1").innerHTML=ree 
document.getElementById("prov").value=document.getElementById("prov1").innerHTML
max3=mminmax[i].split(",")[1]
if ( p.length>max3)
{if (alert("In replacement, violation of the length of the text " +mminmax[i] +",\r\n characters entered "+ p.length+".\r\n Shorten the text and repeat!"))
{return otmm}
else
{otmm=true}}
// 
qwe=" "+document.getElementById("prov").value
if (qwe.indexOf("<")<0) 
{}
else
{if (alert("Tags in the text! \r\n Remove the tags and repeat!"))
{return otmm}
else
{otmm=true}}
}
//*****************************************************************************
// 
if (mtip[i]=="i")
{msstr=p.split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(","+msstr[ii]+",")<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (alert("To replace a non-numeric value, enter an integer!"))
{return otmm}
else
{otmm=true;return otmm}
}}}
msstr=mminmax[i].split(",")        
mini=parseInt(msstr[0],10)
maxi=parseInt(msstr[1],10)
teki=parseInt(p,10)
if  (teki<=maxi && teki>=mini) {} else
{if (alert("In replacement, violation of the range of values: " +mminmax[i] +", \r\nenter an integer in the interval and repeat!"))
{return otmm}
else
{otmm=true}
}}
//******************************************************************************************************
// 
if (mtip[i]=="$")
{oper=p.replace(",",".")
if (oper.lastIndexOf(".")<0)                           // 
{oper=oper+".00"}                                       //
mta=oper.split(".")                                    // 
if (mta.length!=2 || mta[1].length!=2)                                     //
{if (alert("In replacement of non-monetary value, \r\nenter money!"))
{return otmm}
else
{otmm=true}
}
if (mta[1].length==1 )                              //
{oper=oper+"0"}
if (mta.length>2 )                                  //
{oper=mta[0]+"."+mta[1].substr(0,2);}
p=oper
m$=p.replace(".","")
msstr=m$.split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (alert("In replacement of non-monetary value, \r\nenter money!"))
{return otmm}
else
{otmm=true;return otmm}
}}}
msstr=mminmax[i].split(",")  
mini1=msstr[0].replace(".","")
maxi1=msstr[1].replace(".","")
mini=parseInt(mini1,10)
maxi=parseInt(maxi1,10)
teki1=p.replace(".","")
teki=parseInt(teki1,10)
if  (teki<=maxi && teki>=mini) {} else
{if (alert("In replacement, violation of the range of values: " +mminmax[i] +", \r\nenter money in the interval and repeat!"))
{return otmm}
else
{otmm=true}
}}
// 
if (mtip[i]=="d")
{oper=p.replace("/",".")
oper=oper.replace("/",".")
oper=oper.replace("/",".")
oper=oper.replace("-",".")
oper=oper.replace("-",".")
oper=oper.replace("-",".")
mta=oper.split(".")                                    //
if (mta.length!=3)                                     //
{if (alert("To replace the non-date format, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}
if (!otmm)
{if (mta[0].length==2)                              //
{}
else
{if (alert("Replace the wrong day, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}
if (!otmm)
{if (mta[1].length==2 )                              //
{}
else
{if (alert("The month is incorrect in the replacement, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}
if (!otmm)
{if (mta[2].length==4 )                              //
{}
else
{if (alert("The year is incorrect in the replacement, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}
if (!otmm)
{msstr=mta[0].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (alert("In the replacement day is not a number, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}}}
if (!otmm)
{msstr=mta[1].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-") {} else{
if (alert("In place of a non-numeric month, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}}}
if (!otmm)
{msstr=mta[2].split("")
for(var ii=0; ii<msstr.length; ii++)  
{if (msstr1.indexOf(msstr[ii])<0) 
{if (ii==0 && msstr[ii]=="-" ) {} else{
if (alert("In place of the year is not a number, \r\nenter the date"))
{return otmm}
else
{otmm=true}
}}}}
if (!otmm)
{mini=parseInt(mta[0],10)
if  (mini>31 || mini==0 )
{if (alert("In replacement of the day is more than 31 or 0, \r\nenter the date! "))
{return otmm}
else
{otmm=true}
}}
if (!otmm)
{mini=parseInt(mta[1],10)
if  (mini>12 || mini==0 )
{if (alert("In replacement month is more than 12 or 0, \r\nenter the date!"))
{return otmm}
else
{otmm=true}
}}
if (!otmm)
{mini=parseInt(mta[2],10)
if  (mini>2050 || mini<1700 )
{if (alert("In the replacement year is more than 2050 \r\nor less than 1700, enter the date!"))
{return otmm}
else
{otmm=true}
}}
msstr=mminmax[i].split(",")  
mmini1=msstr[0].split(".")
mini1=mmini1[2]+mmini1[1]+mmini1[0]
mmaxi1=msstr[1].split(".")
maxi1=mmaxi1[2]+mmaxi1[1]+mmaxi1[0]
mini=parseInt(mini1,10)
maxi=parseInt(maxi1,10)
mteki1=p.split(".")
teki=parseInt(mteki1[2]+mteki1[1]+mteki1[0],10)
if  (teki<=maxi && teki>=mini) {} else
{if (alert("In replacement, violation of the range of values: " +mminmax[i] +", \r\nenter the date in the interval and repeat! "))
{return otmm}
else
{otmm=true}
}}
return otmm
}


//***********************************
function ads(p,p1) // 
//************************************
{if (!acon()) return
if (mtip.length==2)
{alert("The last column is NOT REMOVED!")
return
}
selc(p)    //
if (objbutton!="")
{objbutton.style.background="white"}
p.style.background="yellow"
objbutton=p
chto=p1
if (confirm("The column will be permanently deleted! \r\n Click 'Cancel' to cancel. ")) 
{ik=parseInt(obj1.id.replace("ta",""),10)
form.elements["com"].value=0      
form.elements["ns"].value=ik      
jdv(0)
form.elements["submit"].click()
}}


//*************************************************************
function ads1(p,p1) //
//*************************************************************
{if (objbutton!="")
{objbutton.style.background="white"}
p.style.background="yellow"
objbutton=p
document.getElementById('pas').style.display=""
document.getElementById('com').style.display="none"
}
function ads2(p,p1)
{if (p1=="-")
{mpp="*"}
else
{mpp=document.getElementById('pwv').value
}
if (mpp==null || mpp=="")
{return }
else
{form.elements["pa"].value=mpp
document.getElementById("h").style.visibility="visible"
 if (table[0][0]=="?")
 { for(var j = 0; j < table.length; j++)
 {if (table[j][0]!="?")
 {rvs=table[j][0]-1
 break
 }}}
else
{rvs=table[0][0]-1
}
rvs=parseInt(rvs)
beg=rvs+1
end=beg+table.length-1
vv=table.length
form.elements["napr"].value=4              //
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
if (mpp=="*" )
{form.elements["soob"].value="PASSWORD canceled!"
}
else
{form.elements["soob"].value="PASSWORD changed!"
}
document.getElementById("h").style.visibility="visible"
form.elements["submit"].click()
}}


//********************************
function pin()  //
//********************************
{form.elements["pain"].value=document.getElementById('pwv').value
document.getElementById("h").style.visibility="visible"
 if (table[0][0]=="?")
 { for(var j = 0; j < table.length; j++)
 {if (table[j][0]!="?")
 {rvs=table[j][0]-1
 break
 }}}
else
{rvs=table[0][0]-1
}
rvs=parseInt(rvs)
beg=rvs+1
end=beg+table.length-1
vv=table.length
form.elements["napr"].value=4              //
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
document.getElementById("h").style.visibility="visible"
form.elements["submit"].click()
}

//********************************
function mon(p)  //
//********************************
{document.getElementById("h").style.visibility="visible"
 if (table[0][0]=="?")
 { for(var j = 0; j < table.length; j++)
 {if (table[j][0]!="?")
 {rvs=table[j][0]-1
 break
 }}}
else
{rvs=table[0][0]-1
}
rvs=parseInt(rvs)
beg=rvs+1
end=beg+table.length-1
vv=table.length
form.elements["napr"].value=4              //
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
if (p==1)
{form.elements["mmon"].value="yes" 
if (!mnogo)
{alert("In single user mode, \r\n monopoly is set automatically!")
return
}

}
else if (p==0)
{form.elements["mmon"].value="no"
if (!mnogo)
{alert("In single user mode, \r\n monopoly is not canceled!")
return
}
}
else if (p==2)
{form.elements["mmon"].value="button"
}
else if (p==3)
{if (confirm("ATTENTION ! All script files of inserted table buttons will be permanently deleted! \r\n Click Cancel to cancel. ")) 
{ik=parseInt(obj1.id.replace("ta",""),10)
form.elements["mmon"].value="button-del"
}
else
{return
}}
else if (p==4)
{form.elements["mmon"].value="edit"
}
document.getElementById("h").style.visibility="visible"
form.elements["submit"].click()
}
//*******************************
function ahref(p,event)
//******************************
{if (p.title=="?n")
{p.href="../../../../sampl/baza1/net.htm"}
else
{p.href="../"+mref[parseInt(p.title)]     //
}
return false
}

//**************************************************
//  
//*************************************************
function pro(p)
{if (table.length==0) 
{alert("To go to the subordinate table \r\n by any insert, enter and save the line!")
return
}
if (objj!="")
{if (objj.getElementsByTagName("TD")[0].innerHTML=="?") 
{alert("Only stored rows have linked tables.")
return
}}
jdv(0)
//alert()
document.getElementById("repo").innerHTML="To the subordinate"
fl=window.top.frames
if (fl.length==mpar.length) {return}
for(j = 0; j < fl.length; j++)
{fl[j].document.getElementById("h").style.visibility="visible"
}
//******************************************************************
if (mpar.length==1)              //
//******************************************************************
{if (fl.length==3 || fl.length==2)
{window.top.document.getElementById('ifr1').style.visibility="visible"
ozag=""
mobjj=objj.getElementsByTagName("TD")
for(j2 = 0; j2 < msabl.length; j2++)
{if (msabl[j2].substr(0,1)=="+")   // 
{if (ozag=="")
{ozag=mobjj[j2].innerHTML}
else
{ozag=ozag+" / "+mobjj[j2].innerHTML
}}}
window.top.document.getElementById('zagf').innerHTML=ozag
num2=fl[1].selected2.replace("2s","")     //
if (num2=="") 
{num2="1.txt"}
else
{num2=num2+".txt"}
fl[1].document.getElementById("form").action='tables.php?tabl='+parseInt(objj.getElementsByTagName("TD")[0].innerHTML)+"/"+num2   //"/2.txt"  
fl[1].document.getElementById("form").elements["soob"].value="UPDATE completed!"
fl[1].document.getElementById("form").elements["pain"].value="no" 
fl[1].document.getElementById("form").elements["rel"].value="1" 
fl[1].document.getElementById("form").elements["glob"].value="0"   // 
fl[1].document.getElementById("form").elements["submit"].click()
}
window.top.document.body.scrollLeft=window.top.document.getElementById("ifr1").offsetLeft
}
//************************************************************
if (mpar.length==2)              //
//************************************************************
{if (fl.length==3)   
{

window.top.document.getElementById('ifr2').style.visibility="visible"
ozag=""
mobjj=objj.getElementsByTagName("TD")
for(j2 = 0; j2 < msabl.length; j2++)
{if (msabl[j2].substr(0,1)=="+")   //
{if (ozag=="")
{ozag=mobjj[j2].innerHTML}
else
{ozag=ozag+" / "+mobjj[j2].innerHTML}}}
window.top.document.getElementById('zags').innerHTML=ozag
sac=fl[1].document.getElementById("form").action
msac=sac.split('tabl=')
sac=msac[1]
msac1=sac.split('/')
num2=fl[2].selected3.replace("3s","")     //

if (num2=="") 
{num2="1.txt"}
else
{num2=num2+".txt"}
tabl7=fl[1].objj.getElementsByTagName("TD")[0].innerHTML
if  (tabl7.indexOf("-")>0)                                   //
{tabl7=tabl7.split("-")[1]+"/"+num2                          //
mtd_2=objj.getElementsByTagName("TD")                        //
mtd_2_0=mtd_2[0].innerHTML.split(":")[1].split("-")[0]       //
window.top.tabl_2_server_zag=mtd_2_0
}
else                                                      //
{tabl7=fl[0].objj.getElementsByTagName("TD")[0].innerHTML+"/"+fl[1].objj.getElementsByTagName("TD")[0].innerHTML+
"/"+num2
}
fl[2].document.getElementById("form").action='tables.php?tabl='+tabl7
fl[2].document.getElementById("form").elements["soob"].value="UPDATE completed!"
fl[2].document.getElementById("form").elements["pain"].value="no" 
fl[2].document.getElementById("form").elements["rel"].value="1" 
fl[2].document.getElementById("form").elements["glob"].value="0"   //
fl[2].document.getElementById("h").style.visibility="hidden" 
fl[2].document.getElementById("form").elements["submit"].click()
window.top.document.body.scrollLeft=window.top.document.getElementById("ifr2").offsetLeft
}}
if (mpar.length==1)               //
{}
fl[0].document.getElementById("h").style.visibility="hidden"
if (mpar.length==2)              //
{fl[1].document.getElementById("h").style.visibility="hidden"
}}
//****************************************
function pro1(p)    // 
//****************************************
{if (window.top.document.body.scrollLeft==0) return
document.getElementById("repo").innerHTML="To the parent "
form.elements["glob"].value=0
if (mpar.length==2)              //
{window.top.document.body.scrollLeft=0}
if (mpar.length==3)              //
{window.top.document.body.scrollLeft=window.top.document.getElementById("ifr1").offsetLeft
}}

//*****************************************************************************
function pro2(p)                                   // 
//*****************************************************************************
{fl=window.top.frames
pr11=fl[2].document.getElementById("h").style.visibility=="hidden"    // 
pr122=window.top.document.getElementById("ifr2").style.visibility
pr12=pr122=="visible" || pr122==""                                    // 
if (pr11 && pr12)                                   // 
{                                                   // 
window.top.document.body.scrollLeft=9999            // 
} 
else
{alert("The transition to the grandson, in the current situation, \r\n is possible only through the son!")}	
}
//*********************************************
function pro3(p)    //
//********************************************
{fl=window.top.frames
fl[0].document.getElementById("repo").innerHTML="Transfer from grandson!" 	
window.top.document.body.scrollLeft=0
}
//********************************************************************
function crz(p)  //
//*******************************************************************
{mss=document.getElementById("std").getElementsByTagName("TD")       //
mst=document.getElementById("t").getElementsByTagName("TR")          //
mstd=mst[0].getElementsByTagName("TD")                               //
objj="";
document.getElementById("rep").innerHTML=""
document.getElementById("s").style.width=document.getElementById("t").clientWidth
document.getElementById("textarea").width=document.getElementById("t").clientWidth
mtextarea=document.getElementById("textarea").getElementsByTagName("TEXTAREA")
for(var i=0; i<mstd.length; i++)                            // 
{mss[i].style.width=mstd[i].clientWidth
}
for(var i=0; i<mstd.length-1; i++)                            //
{if  (mstd[i].clientWidth>0)
{mtextarea[i].style.width=mstd[i].clientWidth-1}}
if (mst.length==1)
{return
}
if (mst[p].style.display=="none")
{for(var i=1; i<mst.length; i++)
{if (mst[i].style.display=="")
  {mst[i].click()        // 
   break}}}
 else
 {mst[p].click()}
ppp= mtextarea[ssort]
ppp.style.background="yellow"
ppp.title="Ok"
if (ssort>0) {mtextarea[0].style.background="#fff8dc"}
obj1.title=""
obj1=ppp
}

//************************************************************** 
function otm2(p)         // 
//*************************************************************
{document.getElementById("tsort").innerHTML=""
mss=document.getElementById("std").getElementsByTagName("TD")   //
mst=document.getElementById("t").getElementsByTagName("TR")     //
mstd=mst[0].getElementsByTagName("TD")                          //
objj=""                                                         //
otm(1)                                                          //
crz(1)                                   //
}
//**********************************************************************************
function clpv(p)  // 
//*********************************************************************************
{mmin=p.parentNode.getElementsByTagName("INPUT")
for(var i=0; i<=mmin.length-1; i++) 
{mmin[i].value=""
mmin[i].title=""
}
select=false 
}
//**********************
function koor(e,p)
//**********************
{ var x = e.offsetX==undefined?e.layerX:e.offsetX;
 p.value=x+"%"
}


//*****************************************************************************************************
function selg(p)     //
//*****************************************************************************************************
{inn2=false                                             //
for(var j = 0; j < table.length; j++)                   //
 {if (table[j][0]=="?")                                 //
 {inn2=true; break }
 if (table[j][table[j].length-1].indexOf('yes.gif')>0) // 
 {inn2=true; break}
}
if (inn2)
{alert("Changes have been made to the table! \r\n But they will be canceled!. \r\nClick the 'Save' button to save.")
//return
}
jdv(0)
if (form.elements["glob"].value==1 )                    // 
{
form.elements["glob"].value=0
window.top.st4=""
window.top.st24=""
window.top.st34=""

document.getElementById("form").action=par.split('.txt')[0]+".txt"
form.elements["soob"].value="Cancellation of selection for all parents!"
form.elements["submit"].click()
if (mpar.length==2)                                     // 
{window.top.tabl_2_server=false                         // 
}
return
}
else                                                    // 
{if (mpar.length==2)                                    // 
{window.top.tabl_2_server=true                          // 
}
form.elements["glob"].value=1                          //  
form.elements["napr"].value=4                           // 
document.getElementById("form").action=par.split('.txt')[0]+".txt&v=9999&beg=1&end=9999"
form.elements["soob"].value="The selection is unconditional for all parents!"
form.elements["submit"].click()
}}


//******************************************
function togr(p)      // 
//******************************************
{if  (form.elements["ggg"].value!="")   //
{document.body.scrollTop=document.getElementById("ifrg"+p).offsetTop
}}


//***********************************************
function bufa(p)           //
//************************************************
{if (p==0)
{document.getElementById("buf").style.display=""
document.getElementById("bod").scrollTop=0
return
}
if (objj=="")
{}
if (document.getElementById("repo").innerHTML=="Added to the end!")
{document.getElementById("repo").innerHTML=="The last row of the table!"
return
}
if (!confirm("BUFFER INSERT: \r\n\r\n When inserting all empty and erroneous values ??\r\n will be replaced with default values! \r\n "+
"\r\n WARNING! If, after memorizing the buffer, there was a change in the table structure (insertion or deletion of columns)," +
"inserting from the buffer may be incorrect! \r\n It is recommended to update the buffer after every change in the table structure!" +
"\r\n\r\n WARNING! When you change the c = column in the header, which determines the value of the next column, \r\n, the value of this column is not automatically changed!" +
"\r\n This leads to an incorrect paste from the buffer! \r\n\r\n To cancel paste, click 'Cancel'."
))
{return}

if (document.getElementById("ta0").value=="?")
{nss=999999999}
else
{nss=parseInt(document.getElementById("ta0").value,10)}
if (p==2) //
{if (!monn && nss<=parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n can insert lines between saved lines \r\n in exclusive mode!")
return
}
obji=parseInt(obji,10)-1
}
else     //
{if (!monn && nss<parseInt(document.getElementById("tmax").innerHTML,10))
{alert("Only the ADMINISTRATOR \r\n can insert lines between saved lines \r\n in exclusive mode!")
return
}}
var mtrr = new Array()       //
mtrr.length=mtip.length+1    // 
document.getElementById("buff").value=document.getElementById("buff").value.replace(/\t/g,"```")
mbuf=document.getElementById("buff").value.split("\n")   // 
kkw=parseInt(obji)
kolos=0
for(var j3 = 0; j3 < mbuf.length-1; j3++)      // 
{mbuf[j3]=mbuf[j3].replace(/\r/g,"")            
mbuff= mbuf[j3].split("```")                   // 
for(var j2 = 0; j2 < mtrr.length-1; j2++)      // 
{mtrr[j2]=""
if (j2==0)
{mtrr[j2]=""}
else
{if  (j2<=mbuff.length)
{if (mbuff[j2-1]!="")                             //
{ddef=false
if (mtip[j2]=="d")                                //
{mbuff[j2-1]=mbuff[j2-1].replace(/,/g,".")
mbuff[j2-1]=mbuff[j2-1].replace(new RegExp("/",'g'),".")
if (!validate_date(mbuff[j2-1]))                  //
{mtrr[j2]=mdef[j2];ddef=true;kolos++}}            //
if (mtip[j2]=="i")                                //
{if (isNaN(parseInt(mbuff[j2-1])))
{mtrr[j2]=mdef[j2];ddef=true;kolos++}}
if (mtip[j2]=="L")                                //
{if (isNaN(parseInt(mbuff[j2-1])))
{mtrr[j2]="1";ddef=true;kolos++}}
if (mtip[j2]=="$")                                //
{if (isNaN(parseFloat(mbuff[j2-1])))
{mtrr[j2]=mdef[j2];ddef=true}}
if (!ddef)
{if (mtip[j2]=="$")
{pzzz=parseFloat(mbuff[j2-1])
mtrr[j2]=pzzz.toFixed(2)}
else
{mtrr[j2]=mbuff[j2-1]
}}}
else
{mtrr[j2]=mdef[j2]
}}
else
{mtrr[j2]=mdef[j2]
}}}
for(var j = 0; j < mtrr.length; j++)       //
{if (j<mtrr.length-1)
{if (j==0) 
{mtrr[j]="?"}
else
{if (mtip[j]=="a")
{if  (form.elements["mob"].value!=1)
{mtrr[j]="<a href=# onclick=ahref(this,event) target=_blank title=" +mtrr[j]+">...</a>"}
else
{mtrr[j]="<a href=# onclick=ahref(this,event) target=_blank  title=" +mtrr[j]+"n>...</a>"}
 }
else
{}
}}
else
{mtrr[j]="<img src=../../../../d~e~f/no.gif onclick1=cb(this,1)><img onclick1=cb(this,2) src=../../../../d~e~f/no.gif>"
}}
var mmtrr=mtrr.slice(0,mtrr.length)   //
table.splice(kkw,0,mmtrr) 
kkw=kkw+1
}
document.getElementById("buf").style.display="none"
document.getElementById("repo").innerHTML="Paste from clipboard! Bugs fixed ="+kolos
obji=kkw
otm(1)
crz(kkw)
}
max_execution_time = 60 
//*******************************************
// 
//*******************************************
function selad(p)
{if (table.length==0) {return}
if (obj1.id=="ta0") {return}
if (obj1.value=="") 
{alert("No value for selection!")
return}
  var txt = '';
  if (txt = window.getSelection) 
  {txt = window.getSelection().toString();} 
  else 
  {txt = document.selection.createRange().text;}
if (txt!="")
{ks=txt
ks=ks.replace(new RegExp(" ",'g'),"")
}
else
{ks=obj1.value}
if (ks.length>20)
{alert("Context length> 20 characters! \r\n Select the search context by \r\ndouble-clicking a word and repeat!")
return
}
ik=parseInt(obj1.id.replace("ta",""),10)
if (mtip[ik]=="a") 
{alert("There is no selection by links!")
return}
fli=document.getElementById("selp").getElementsByTagName("TR") 
flii=fli[ik].getElementsByTagName("INPUT") 
for(var jj = 0; jj < flii.length; jj++)   
{if (flii[jj].name=="spi")
{mvv=flii[jj].value.split('/')     // 
mvvn=true                          // 
for(var jjj = 0; jjj < mvv.length; jjj++)   
{if (mvv[jjj]==ks)
{mvvn=false;break}}
if (mvvn)
{if (mtip[ik]=="t" || mtip[ik]=="d")
{flii[jj].value=flii[jj].value+ks+"/"
}
else if (mtip[ik]=="L")                // 
{flii[jj].value=flii[jj].value+table[obji-1][ik]+"/"
}
else
{flii[jj].value=flii[jj].value+ks+"/"
}}}}
document.getElementById("repo").innerHTML=ks+" ADDED TO SELECTION!"
}
//****************************
function validate_date(value)
//****************************
{  var arrD = value.split(".");
  arrD[1] -= 1;
  var d = new Date(arrD[2], arrD[1], arrD[0]);
  if ((d.getFullYear() == arrD[2]) && (d.getMonth() == arrD[1]) && (d.getDate() == arrD[0])) {
    return true;
  } 
else 
{return false;
  }}

//******************
function fromk()
//*******************
{if (obj1.readOnly)
{return}
if (table.length==0) return
ik=parseInt(obj1.id.replace("ta",""),10)
if (mtip[ik]=="$"  || mtip[ik]=="t" )
{obj1.value=document.getElementById("eva_r").innerHTML}
if (mtip[ik]=="i" )
{ppp2=parseFloat(document.getElementById("eva_r").innerHTML)
obj1.value=ppp2.toFixed()
}}

//****************
function fromc()
//***************
{if (obj1.readOnly)
{return}
if (table.length==0) return
ik=parseInt(obj1.id.replace("ta",""),10)
if (mtip[ik]=="d")
{obj1.value=document.getElementById("cal_td").innerHTML}
if (mtip[ik]=="t")
{devdate=new Date()
y5=devdate.getFullYear()
m5=devdate.getMonth()+1
c5=devdate.getDate()
h5=devdate.getHours()
mi5=devdate.getMinutes()
s5=devdate.getSeconds()
if (m5<=9)
{m5="0"+m5}
if (c5<=9)
{c5="0"+c5}
if (h5<=9)
{h5="0"+h5}
if (mi5<=9)
{mi5="0"+mi5}
if (s5<=9)
{s5="0"+s5}
dp=c5+"."+m5+"."+y5+" "+h5+":"+mi5+":"+s5
obj1.value=dp
}}
//******************
function selall(p)
//******************
{if (!monn)
{alert("Only the ADMINISTRATOR \r\n can delete lines \r\n in exclusive mode!")
return
}
if (table.length==0) {return}
if (p.src.indexOf('no.gif')>0) 
{z100='no';z200='yes';p.src='../../../../d~e~f/yes.gif'}
else
{z100='yes';z200='no';p.src='../../../../d~e~f/no.gif' }
ik=table[0].length-1
for(var j = 0; j < table.length; j++)       //
{if (mpok[j])                               //
{if (table[j][0]!="?")
{mpzz=table[j][ik].split("><")
table[j][ik]=mpzz[0]+"><"+mpzz[1].replace(z100,z200)
}                        //
}}
if (z100=='no')
{document.getElementById("repo").innerHTML="All lines to be deleted!"
}
else
{document.getElementById("repo").innerHTML="Cancel lines to delete!"
}
otm(1)
crz(1)
}
//************************
function clit(p,event)
//************************
{ev = event || window.event
var t = ev.target || ev.srcElement
pp=t.tagName
if (pp=="A" || pp=="a" )
{t.target="_blank"
if (t.title=="?n")
{t.href="../../../../sampl/baza1/net.htm"}
else
{ik=parseInt(t.title.replace("n",""),10)
t.href="../"+mref[ik] 
}}}
//*******************************************************
function jdv(p)      // 
//*******************************************************
{
if (p=="0")   // 
{document.getElementById("h").style.visibility="visible"
document.getElementById("repo").innerHTML="Wait ..."
window.top.document.getElementById('jd').style.display=""   //
if (window.top.document.getElementById('jd1')!=undefined)   //
{window.top.document.getElementById('jd1').style.display=""
}
if (window.top.document.getElementById('jd2')!=undefined)   //
{window.top.document.getElementById('jd2').style.display=""
}}
else        // 
{window.top.document.getElementById('jd').style.display="none"  //
if (window.top.document.getElementById('jd1')!=undefined)
{window.top.document.getElementById('jd1').style.display="none" //
}
if (window.top.document.getElementById('jd2')!=undefined)
{window.top.document.getElementById('jd2').style.display="none"  //
}}}
//******************************************************
function delo(p)    // 
//******************************************************
{if (table.length==0) {return}    // 
// 
ye=0  
for(var i=1; i<mss.length-1; i++)  
{if (mss[i].title=="ERRORS")
{ye=i }
}
if (ye==0)
{alert("The ERRORS column is missing!")
return
}
z100='no';z200='yes';p.src='../../../../d~e~f/yes.gif'
ik=table[0].length-1
for(var j = 0; j < table.length; j++)                           // 
{if (mpok[j] && table[j][ye]=="")                               // 
{if (table[j][0]!="?")
{mpzz=table[j][ik].split("><")
table[j][ik]=mpzz[0]+"><"+mpzz[1].replace(z100,z200)
}}}
document.getElementById("repo").innerHTML="Lines without errors in the group are marked for deletion!"
otm(1)
crz(1)
}
//*******************************************************************
//
//*******************************************************************
function pods()
{
document.getElementById("pods33").src="../../../../reddoc.php?&utf8=0&im=100&tip=new&fol=100"
document.getElementById("pods33").style.display=""
delta=document.body.offsetHeight/10
for(var j = 0; j < 11; j++)
{document.body.scrollTop=document.body.scrollTop+delta
}
}

//*******************************************************************
// 
//*******************************************************************
function r_b(insText )    // 
{if (insText=="61")
{insText=Date()}
input=document.getElementById("zii2t")
if (input.createTextRange ) 
{ if (document.selection.createRange().text=="")
{alert("No selection! \r\nHighlight the text and repeat!") 
 return
} 
if (insText=="3")
{document.selection.createRange().text="«"+document.selection.createRange().text+"»"
}
else if(insText=="1")
{document.selection.createRange().text=document.selection.createRange().text.toUpperCase()
}
else if(insText=="2")
{document.selection.createRange().text=document.selection.createRange().text.toLowerCase()
}
else
{document.selection.createRange().text += insText
}}
 else if(input.setSelectionRange ) 
{ var len = input.selectionEnd;
 var len2 = input.selectionStart;
 if (len==len2)
{ alert("No selection! \r\nHighlight the text and repeat!") 
 return
 }
 if (insText=="3")
{input.value = input.value.substr( 0, len2 )+"«"+input.value.substr(len2,len-len2)+"»"+input.value.substr(len)
}
else if(insText=="1")
{input.value = input.value.substr( 0, len2 )+input.value.substr(len2,len-len2).toUpperCase()+input.value.substr(len)
}
else if(insText=="2")
{input.value = input.value.substr( 0, len2 )+input.value.substr(len2,len-len2).toLowerCase()+input.value.substr(len)
}
else
{ input.value = input.value.substr( 0, len )
 + insText + input.value.substr( len );
 input.setSelectionRange(len+insText.length,len+insText.length);
}} 
 else 
 {input.value += insText; }
 }

 
 //*********************************************************************************************
 function uz(z)   // 
//********************************************************************************************** 
{
muuu=z.getElementsByTagName("OPTION")
p=muuu[z.selectedIndex].value                                     
if (z.selectedIndex==0)                                           //
{
//alert(z.parentNode.id)
if (z.parentNode.id!="select_create")                            // 
{document.getElementById("select_cancel").click()
return
}
}
for(var i=0; i<muuu.length; i++)        // 
{if (muuu[i].outerHTML.indexOf('selected')>0)
{document.getElementById("fort").value=muuu[document.getElementById("suu").selectedIndex].innerHTML
}}
muuu=document.getElementById("selp").getElementsByTagName("INPUT") //
for(var i=0; i<muuu.length-1; i++)                                // 
{muuu[i].value=""                                                          
muuu[i].title=""
}
mmm=document.getElementById("selp").outerHTML                     // 
muuu=document.getElementById("selp").getElementsByTagName("TR")   // 
muu=p.split("#")                                                  // 
for(var i=0; i<muu.length-1; i++)                                 // 
{muu2=muu[i].split("~")                                           // 
if (mmm.indexOf(muu2[1])>0)                             // 
{for(var ii=1; ii<muuu.length; ii++)                              // 
{muuu2=muuu[ii].getElementsByTagName("TD")                        // 
if (muu2[0]==muuu2[1].innerHTML)                                  // 
{if (muu2[1]==muuu2[2].innerHTML)                                 // 
{muuu3=muuu2[3].getElementsByTagName("INPUT")                     // 
for(var iii=0; iii<muuu3.length; iii++)                           // 
{
if (muu2[iii+2].indexOf("+++")>0)
{
muu22=muu2[iii+2].split("+++")
muuu3[iii].value=muu22[0]
muuu3[iii].title=muu22[1]
}
else
{
muuu3[iii].value=muu2[iii+2]
}
}}}}}}
if (z.parentNode.id!="select_create")
{document.getElementById("group_only").click()}
}

//*******************************************************************************************************
function ud(p)        //
//******************************************************************************************************
{unam=document.getElementById("fort").value
if (unam=="" && p!=3)
{alert("Enter the name in the input field!")
return}
mmm=document.getElementById("suu").outerHTML
if (p!=3)
{if (mmm.indexOf(">"+unam+"<")>0) 
{alert("There is already one on the list! \r\nEnter a different name in the input field.")
return}}
mopt=document.getElementById("suu").getElementsByTagName("OPTION")
if ((p==1 || p==2) && document.getElementById("suu").selectedIndex==0)
{alert("No choice made! Insertion relative to selection not possible.")
return
}
vsel2=mopt[document.getElementById("suu").selectedIndex].innerHTML
muu=document.getElementById("selp").getElementsByTagName("TR")
mzu=""
mzu22=""
for(var ii=1; ii<muu.length; ii++)  
{muu2=muu[ii].getElementsByTagName("TD")
mzu=mzu+muu2[1].innerHTML+"~"+muu2[2].innerHTML
muu3=muu2[3].getElementsByTagName("INPUT")
mzu2="~"
for(var j=0; j<muu3.length; j++)  
{if (j==0)
{mzu2=mzu2+muu3[j].value
}
else
{mzu2=mzu2+"~"+muu3[j].value
}
if (muu3[j].title!="" && muu2[2].innerHTML=="L")
{mzu2=mzu2+"+++"+muu3[j].title
}
}
mzu=mzu+mzu2+"#"
mzu22=mzu22+mzu2
}
mzu22=mzu22.replace(/~/g,"")
if (mzu22=="")
{alert("No selection data!")
return}
mzuu=mzu
mzu='<OPTION value="'+mzu+'">'+unam+"</OPTION>"
if (p==0)
{mmm=mmm.replace("</select>","</SELECT>")
mmm=mmm.replace("</SELECT>",mzu+"</SELECT>")
mmm5="added"
}
else
{news2='<SELECT id=suu  onchange="uz(this)"  value="">'
for(var ii=0; ii<mopt.length; ii++)  
{if  (mopt[ii].innerHTML==vsel2)
{if (p==1)  // 
{news2=news2+mzu+mopt[ii].outerHTML
mmm5="inserted before"
}
if (p==2)  //
{news2=news2+mopt[ii].outerHTML+mzu
mmm5="inserted after"
}
if (p==3)  // 
{mopt[ii].innerHTML=unam                       // 
mopt[ii].value=mzuu                            // 
news2=news2+mopt[ii].outerHTML
mmm5="changed"
}}
else
{news2=news2+mopt[ii].outerHTML
}}
news2=news2+"</SELECT>"
mmm=news2
}
document.getElementById("suu").outerHTML=mmm
alert("Selection  "+mmm5+" !\r\n To remember the updated list of conditions \r\n, click the save button (the last in the row) ")
}
//******************************************************
function uu()    // 
//******************************************************
{muuu=document.getElementById("suu").getElementsByTagName("OPTION")
pu=document.getElementById("suu").selectedIndex
if (pu==0)
{alert("No choice made!");return}
if (confirm("ATTENTION ! The conditions of the selected \r\nlist item will be permanently deleted! \r\n Click 'Cancel' to cancel. ")) 
{muu2=document.getElementById("suu").getElementsByTagName("OPTION")
ue=""
for(var i=1; i<muu2.length; i++)  
{if (pu==i)
{ue=muu2[i].outerHTML}
}
mmm=document.getElementById("suu").outerHTML
mmm=mmm.replace(ue,"")
document.getElementById("suu").outerHTML=mmm
alert("Removed from the list!")
}}
//************************************************
function uz2() //
//*************************************************
{if (confirm("ATTENTION ! ALL conditions in the list will be deleted permanently! \r\n Click 'Cancel' to cancel. ")) 
{document.getElementById("suu").outerHTML='<SELECT id=suu  onchange="uz(this)" value="">'+
'<OPTION selected value=>SELECTIONS:</OPTION>'+
'</SELECT>'
}}
//**********************************************************
function us()          // 
//**********************************************************
{if (form.elements["glob"].value==1)
{alert("After canceling the \r\nglobal selection, repeat!")
selg(0)
return
}
if (table[0][0]=="?")
 {for(var j = 0; j < table.length; j++)
 {if (table[j][0]!="?")
 {rvs=table[j][0]-1
 break
 }}}
else
{rvs=table[0][0]-1
}
jdv(0)
rvs=parseInt(rvs)
beg=rvs+1
end=beg+table.length-1
vv=table.length
document.getElementById("form").elements["com"].value=3
select_new=document.getElementById("suu").outerHTML                  // 
select_new=select_new.replace("selected","")                         // 
select_new=select_new.replace(">SELECTIONS:"," selected>SELECTIONS:")      // 
document.getElementById("form").elements["st1"].value=select_new     //
form.elements["napr"].value=4                                        //
document.getElementById("form").action=par.split('.txt')[0]+".txt&v="+vv+"&beg="+beg+"&end="+end
form.elements["soob"].value="Selection list saved!"
form.elements["submit"].click()
}
//**********************************************************
function vtp(p)     //
//**********************************************************
{if (confirm('THERE IS:'+p.value+'\r\nWILL BE:'+document.getElementById('fort').value+" \r\n Click 'Cancel' to cancel."))
{p.value=document.getElementById('fort').value}   
}
//**********************************************************************
function sort2(p2,p)  // 
//**********************************************************************
{if (vpoi!="")
{vpoi.style.background="" }
if (olds3!="")
{olds3.parentNode.style.background="#ffefd5"
olds3=""
}
if (olds2!="")
{olds2.parentNode.style.background="#e0ffff"
olds2=""
}
olds=""
//************************************
if (p==4)   // 
{ik=parseInt(obj1.id.replace("ta",""),10)
p22=p2.replace("*",ik)
mas=document.getElementById(p22).getElementsByTagName("TABLE")
mtr=mas[0].outerHTML.replace(/DISPLAY/g,"ALT")
mtr=mtr.replace(/display/g,"ALT")
mas[0].outerHTML=mtr
return
}
//************************************
if (p==5)   // 
{ik=parseInt(obj1.id.replace("ta",""),10)
p22=p2.replace("*",ik)
mas=document.getElementById(p22).getElementsByTagName("TABLE")
mtr=mas[0].outerHTML.replace(/ALT/g,"DISPLAY")
mtr=mtr.replace(/alt/g,"display")
mas[0].outerHTML=mtr
return
}
//****************************************
if (p==44)   // 
{if (winz=="") return
mas=winz.getElementsByTagName("TABLE")
mtr=mas[0].outerHTML.replace(/DISPLAY/g,"ALT")
mtr=mtr.replace(/display/g,"ALT")
mas[0].outerHTML=mtr
return
}
//*****************************************
if (p==54)   // 
{if (winz=="") return
mas=winz.getElementsByTagName("TABLE")
mtr=mas[0].outerHTML.replace(/ALT/g,"DISPLAY")
mtr=mtr.replace(/alt/g,"display")
mas[0].outerHTML=mtr
return
}
//*********************************************
if (p==1 || p==2)
{// 
var mss = new Array();        // 
is2=isort                     // 
mas=itz.getElementsByTagName("TR")
if (isort2=="0" || isort2=="i" || isort2=="L"  )      // 
{for(var j = 1; j <mas.length ; j++)
{mas2=mas[j].getElementsByTagName("TD")
tt=mas2[is2].innerHTML
tt2="0000000"+tt
tt2=tt2.substr(parseInt(tt.length))
mss[j]=tt2+mas2[0].innerHTML+"##"+j
}}
else if (isort2=="a" || isort2=="t") // 
{for(var j = 1; j <mas.length; j++)
{mas2=mas[j].getElementsByTagName("TD")
mss[j]=mas2[is2].innerHTML.toUpperCase()+mas2[0].innerHTML+"##"+j
}}
else if (isort2=="d") //
{for(var j = 1; j <mas.length; j++)
 {mas2=mas[j].getElementsByTagName("TD")
  tt=mas2[is2].innerHTML
  mtt=tt.split(".")
  tt2=mtt[2]+mtt[1]+mtt[0]
  mss[j]=tt2+mas2[0].innerHTML+"##"+j
 }}
else if (isort2=="$") //
{for(var j = 1; j <mas.length; j++)
{mas2=mas[j].getElementsByTagName("TD")
  tt=mas2[is2].innerHTML 
  mtt=tt.split(".")
  tt2="0000000"+mtt[0]
  tt2=tt2.substr(parseInt(tt.length))
  mss[j]=tt2+mas2[0].innerHTML+"##"+j
}}
mss=mss.sort()
mtr="<table border=1 width=100%>"+mas[0].outerHTML
if (p==1)
{for(var j = 0; j < mas.length-1; j++)
{sss=mss[j].split("##")
iii=parseInt(sss[1])
mtr=mtr+mas[iii].outerHTML
}}
else
{for(var j = mas.length-2; j>=0; j--)
{sss=mss[j].split("##")
iii=parseInt(sss[1])
mtr=mtr+mas[iii].outerHTML
}}
itz.outerHTML=mtr+"</table>"
if (mtip[is2]=="L")                                             // 
{iss="list"+(is2)                                               // 
mssl=document.getElementById(iss).getElementsByTagName("TR")    // 
spis[is2].length=mssl.length                                    // 
for(var ii = 0; ii < mssl.length; ii++)                         // 
{mmssl=mssl[ii].getElementsByTagName("TD")                      // 
spis[is2][ii]=mmssl[1]                                 // 
//alert(mmssl[1].innerHTML)
}}
else
{spis[is2].length=1                                    //
spis[is2][0]=""
}
}
else if (p==3)   // 
{}
} 
//*********************************************
function izs(p)
//*********************************************
{if (p.src.indexOf('no.gif')>0) 
{p.src='../../../../d~e~f/yes.gif'}
else
{p.src='../../../../d~e~f/no.gif'
ttt2=""
if (p.id=="kvib")     //
{ttt2=document.getElementById("ref1")
}
else if (p.id=="kvibp")  // 
{ttt2=document.getElementById("listdiv")
}
else if (p.id=="kvibz")  // 
{ttt2=document.getElementById("lisdiv")
}
if (ttt2!="")
{mtr2=ttt2.getElementsByTagName("TR")      // 
for(var jj2 = 0; jj2 <= mtr2.length-1; jj2++)  
{if (byellow(mtr2[jj2].style.background))
{mtr2[jj2].style.background=""}}
}}}
//*********************************************
function tnd(p)  // 
//*********************************************
{winz.scrollTop=p}
//*********************************************
function tnd2(p)  //
//*********************************************
{if (document.getElementById('list').style.display=="" && iks!=0)    // 
{ik=iks}                                                            //
else
{ik=parseInt(obj1.id.replace("ta",""),10)                           //
}
document.getElementById('list'+ik).scrollTop=p
}

//**********************************************
function spc3(event)    // 
//*********************************************
{event = event || window.event
var t = event.target || event.srcElement
if (t.tagName=="TD")
{ssp=t.parentNode.getElementsByTagName("TD")
for(var jj = 0; jj < ssp.length; jj++) 
{ssp[jj].style.background="#4682b4";
ssp[jj].style.color="white";
}
if (olds4!="")
{olds4.parentNode.style.background="#e6e6fa"
olds4=""
}
itz=document.getElementById('tref')    // 
isort=parseInt(t.title)
t.style.background="yellow"
t.style.color="brown"
isort=t.title 
isort2=t.lang 
if (document.getElementById("ksort3").src.indexOf('no.gif')>0)
{sort22("ref1",2)
}
else
{sort22("ref1",1)
}}}
//********************************************************
function sort22(p2,p)  // 
//********************************************************
{if (vpoi!="")
{vpoi.style.background="" }
var mss = new Array();                   // 
is2=isort                               // 
mas=itz.getElementsByTagName("TR")
for(var j = 0; j <=mas.length-1; j++)
{mas2=mas[j].getElementsByTagName("TD")
if (is2=="0")                           // 
{tt=mas2[is2].innerHTML
tt2="0000000"+tt
tt2=tt2.substr(parseInt(tt.length))
mss[j]=tt2+mas2[0].innerHTML+"##"+j
}
else
{mss[j]=mas2[is2].innerHTML.toUpperCase()+mas2[0].innerHTML+"##"+j}
}
mss=mss.sort()
mtr="<table id=tref border=1 width=100%>"
if (p==1)
{for(var j = 0; j <= mas.length-1; j++)
{sss=mss[j].split("##")
iii=parseInt(sss[1])
mtr=mtr+mas[iii].outerHTML
}}
else
{for(var j = mas.length-1; j>=0; j--)
{sss=mss[j].split("##")
iii=parseInt(sss[1])
mtr=mtr+mas[iii].outerHTML
}}
itz.outerHTML=mtr+"</table>"
}

//********************************************************
function vss(p,event)  //  
//********************************************************
{event = event || window.event
var t = event.target || event.srcElement
if (t.tagName=="TH")
{mas=t.getElementsByTagName("A")
if (mas.length==0)
{return}
t=mas[0]
}
if (t.tagName!="A" || t.title!="" ) return
mas=p.getElementsByTagName("TEXTAREA")
qwa=mas[0].value
qwa=qwa.replace("_"," ")
mas[0].value=qwa+t.innerHTML
pin=" "+winp.id
if (pin.indexOf('ref')>0)
{document.getElementById('poi2').click()}
else if (pin.indexOf('list')>0)
{document.getElementById('poi3').click()}
else if (pin.indexOf('lis-')>0)
{document.getElementById('poi').click()}
}

vpoi=""
//********************************************************
function vss2(p)  // 
//********************************************************
{if (vpoi!="")
{vpoi.style.background="" }
pin=" "+winp.id
if (pin.indexOf('ref')>0)
{if (olds4!="")
{olds4.parentNode.style.background="#e6e6fa"}
idz="zref"
}
else if (pin.indexOf('list')>0)
{
idz="z"+winp.id
if (olds3!="")
{olds3.parentNode.style.background="#ffefd5"}
}
else if (pin.indexOf('lis-')>0)                                         // 
{idz="z"+winp.id
if (olds2!="")                                       					// 
{olds2.parentNode.style.background="#e0ffff"}        					// 
}
mas=document.getElementById(idz).getElementsByTagName("TD")
for(var j = 0; j <=mas.length-1 ; j++)
{if (byellow(mas[j].style.background))
{ isort=j
break
}}
if (parseInt(isort,10)>=0)
{}
else
{alert("No sorting! Click the text in \r\nthe header and repeat! ")
return
}
mas=p.parentNode.parentNode.getElementsByTagName("TEXTAREA")
if (mas[0].value=="")
{alert("No search context!")
return
}
mas[0].value=mas[0].value.toUpperCase()

kont=mas[0].value
mas2=winp.getElementsByTagName("TR")
for(var j = 0; j <=mas2.length-1 ; j++)
{mas22=mas2[j].getElementsByTagName("TD")
tt2=mas22[isort].innerHTML.substr(0,kont.length)
if (tt2.toUpperCase()==kont  && mas2[j].style.display=="")
{if (form.elements["mob"].value==1) 
{window.document.body.scrollTop=mas2[j].offsetTop}
  else
  {winp.scrollTop=mas2[j].offsetTop}
mas22[isort].style.background="yellow"
vpoi=mas22[isort]
break
}}}
//**********************
function byellow(p)  // 
//**********************
{ppp=" "+p;
if (ppp.indexOf('yellow')>0)
{return true;}
else
{return false;}
}
//*******************************************************
// 
function f555()
{
//par=document.getElementById("form").action
par1=par.split('tabl=')
//mpar=par1[1].split('/')

if (par1[1].indexOf("-")<0 )      //
{
document.getElementById("div").style.display="none"
mtdd=document.getElementById("f555").getElementsByTagName("TD")
mtextarea=document.getElementById("textarea").getElementsByTagName("TEXTAREA")
if (mtdd.length<mtextarea.length*2)
{alert("Limiting the number of columns! \r\nContact the developer!")
return
}
newtext=""
i=2
for(var j = 0; j <=mtextarea.length-1 ; j++)
{mtdd[i++].innerHTML=(j+1)+".&nbsp;"+mss[j].title
mtextarea[j].style.background="#fff8dc"
mtdd[i++].innerHTML=mtextarea[j].outerHTML
}
mtextarea2=document.getElementById("f555").getElementsByTagName("TEXTAREA")
for(var j = 0; j <=mtextarea2.length-1 ; j++)
{mtextarea2[j].rows=1
 mtextarea2[j].style.width=200
 mtextarea2[j].value=mtextarea[j].value
}
document.getElementById("f555").style.display=""
}}
//**********************************
// 
function save555()
{mtdd=document.getElementById("f555").getElementsByTagName("TEXTAREA")
mtextarea=document.getElementById("textarea").getElementsByTagName("TEXTAREA")
for(var j = 0; j <=mtextarea.length-1 ; j++)
{mtextarea[j].value=mtdd[j].value
mtextarea[j].name=mtdd[j].name
}
mtdd=document.getElementById("f555").style.display="none"
mtdd=document.getElementById("div").style.display=""
objj.click()
}
//****************************************
function redscript(p)
//****************************************
{aff=document.getElementById('aaa')
aff.target="_blank"
ref=location.href.split("pages")[1].split("tables")[0]
aff.href="../../../../script.php?file=pages"+ref+p
aff.click()
}
//******************************************
function spp(event)
//******************************************
{event = event || window.event
var t = event.target || event.srcElement
if (t.title!="")
{alert(t.innerHTML+":\r\n"+t.title)
}}
//*****************************************
function xboct()
//*****************************************
{if (confirm("In all subordinate tables, \r\n folders with a name greater than the last N np \r\n in the parent table will be deleted! \r\n Click 'Cancel' to cancel. "))
{form.elements["xboct"].value="delete" 
re(55)     // 
}}
//**********************************************************
//  
//**********************************************************
naydeno=1
oldcon=""
postr2=false
function postr()
{if (document.getElementById("zam1").value=="")
{return
}
if (obj1=="")
{alert("Column not selected!");return}
ik=parseInt(obj1.id.replace("ta",""),10)
if (mtip[ik]=="a")
{alert("The link is not searched!")
return
}
postr2=true
if (oldcon!=document.getElementById("zam1").value)
{ikon=document.getElementById("zam1").value
mikon=ikon.split("/")
naydeno=1
}
else
{ikon=document.getElementById("zam1").value
mikon=ikon.split("/")
}
msnaper=document.getElementById('t').getElementsByTagName("TR")
if (naydeno>msnaper.length)
{naydeno=1
}
for(var j = naydeno; j < msnaper.length; j++)
{stol=msnaper[j].getElementsByTagName("TD")
stol2=" "+stol[ik].innerHTML
for(var j2 = 0; j2 <= mikon.length-1; j2++)
{if (stol2.indexOf(mikon[j2])>0)
{document.getElementById("div").scrollTop=msnaper[j].offsetTop
oldcon=ikon
stol[ik].click()
document.getElementById("list").style.display="none"
naydeno=j+1   //
return
}}}
alert("The end!")
naydeno=1
}
//*************************************
//   
function clea()
{document.getElementById("list").style.display="none"
document.getElementById("lis").style.display="none"
document.getElementById("ref").style.display="none"
ik=parseInt(obj1.id.replace("ta",""),10)
if (ik==0 || mtip[ik]=="L")
{document.getElementById("repo").innerHTML="Cleaning prohibited"
return}
if (mtip[ik]=="a")
{obj1.value="?n"
document.getElementById("repo").innerHTML="Link canceled"
}
else
{if (mss[ik-1].title.indexOf("=")>0 || mss[ik].title.indexOf("^")>0)
{document.getElementById("repo").innerHTML="Cleaning prohibited"
return
}
if (mss[ik].title.indexOf("=")>0)   // 
{mtextarea[ik+1].value=""}
obj1.value=""
document.getElementById("repo").innerHTML="Cell cleared"
}
objj.click()
}
//*****************************************************
//  
//*****************************************************
function bufa2()
{mdbuff=""
 for(var j = 0; j < table.length; j++)                  // 
 {if (table[j][table[j].length-1].indexOf('yes.gif')>0) 
  {mfl=table[j][table[j].length-1].split("><")
  if (mfl[1].indexOf('yes.gif')>0) 
 {for(n = 1; n < table[j].length-1; n++) 
 { if (mtip[n]=="a")
{ mst4=table[j][n].split("=")
 mst5=mst4[1].split(">")
 mst6=mst5[0]
 }
else
{mst6=table[j][n]
}
 if (n==1)
 {mdbuff=mdbuff+mst6
 }
 else
{mdbuff=mdbuff+"```"+mst6
}}
mdbuff=mdbuff+"\r\n" 
}}}
document.getElementById("buff").value=mdbuff
}
//***********************************************************
//  
//***********************************************************
function bufa3()
{document.getElementById("bufv").value=document.getElementById("buff").value
form.elements['bufv2'].click()
}
//***********************************************************
//  
//***********************************************************
function bufa33()
{if (confirm("The paste buffer will be deleted permanently! \r\n Click 'Cancel' to cancel."))
{document.getElementById("bufv").value=""
form.elements['bufv2'].click()
}
}
//********************************************************************
function tabtop()   //
//********************************************************************
{fl=window.top.frames
ref=location.href.split("contents")[1].split("/")[1]
mas2=document.getElementById("t").getElementsByTagName("TR")
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
tnap=tnap+"<b>Website: </b>"+document.getElementById("sname2").innerHTML+"<br><b>Page:&nbsp;&nbsp;&nbsp;</b><?php echo $tablr;?><hr>"
if  (window.top.serv==2)
{document.getElementById("tsel").innerHTML=seltext2.innerHTML
if (form.elements["glob"].value!=0)             // 
{if (mpar.length==1 && window.top.st4!="")
{tnap=tnap+"<b>Server selection(group): straight,</b>"+window.top.st4+"<br>"
}
if (mpar.length==2 && window.top.st24!="")
{tnap=tnap+"<b>Server selection(group): straight,</b>"+window.top.st24+"<br>"
}
if (mpar.length==3 && window.top.st34!="")
{tnap=tnap+"<b>Server selection(group): straight,</b>"+window.top.st34+"<br>"
}
}
select=true
}
if (select) 
{if (document.getElementById("seltext2").innerHTML!="")
{if(psel) 
{tnap=tnap+"<b>Group&nbsp;&nbsp;selection: straight, </b>"+document.getElementById('seltext2').innerHTML
}
else
{tnap=tnap+"<b>Group&nbsp;&nbsp;selection: reverse, </b>"+document.getElementById('seltext2').innerHTML
}}}
else
{tnap=tnap+"<b>Selection:</b> no"}
if (document.getElementById("tsort").innerHTML!="")
{tnap=tnap+"<br><b>Sorted: </b>" + document.getElementById("tsort").innerHTML
}
else
{tnap=tnap+"<br><b>Sorted: </b>no"
}
tnap=tnap+"<hr><table width=100%>"
fl=window.top.frames
tnap=tnap+ref+" / "
tab_n=mpar.length
tab_n2=mpar[0].substr(0,1)
if (par1[1].indexOf("-")>0 )      // 
{if (tab_n2==2)
{tnap=tnap+"  son - "
}
else if (tab_n2==3)
{tnap=tnap+" grandson - "}
}
if (mpar.length==1)                                      // 
{tnap=tnap+document.getElementById("zag").innerHTML}     // 
if (mpar.length==2)                                      // 
{tnap=tnap+fl[0].document.getElementById("zag").innerHTML+" / " +document.getElementById("zag").innerHTML
}
if (mpar.length==3)                                        //
{tnap=tnap+fl[0].document.getElementById("zag").innerHTML+" / " +document.getElementById("zag").innerHTML
}
w7=document.getElementById("tabl_sel")
if (w7!=undefined)
{tnap=tnap+" / "+w7.options[w7.selectedIndex].text}
vib3=""
for(var j2 = 0; j2 <= mas2.length-1; j2++)
{
if (mas2[j2].style.display=="none")                       // 
{}
else
{mas22=mas2[j2].getElementsByTagName("TD")
if (j2==0)
{tnap=tnap+"<tr>"
for(var j3 = 0; j3 <= mas22.length-2; j3++)
{
if (mas22[j3].style.display=="none")
{}
else
{
tnap=tnap+"<td><b><hr>"+mas22[j3].innerHTML+"<hr>"+(j3+1)+"<hr></b></td>"
}
}}
else
{tnap=tnap+"<tr>"
for(var j3 = 0; j3 <= mas22.length-2; j3++)
{if (mtip[j3]=="a")                                            //  
{ikk2=parseInt(mas22[j3].firstChild.title.replace("n",""),10)
if (isNaN(ikk2))
{tnap=tnap+"<td>&nbsp;</td>"}
else
{mtd5=mref1[ikk2].getElementsByTagName("TD")
mttt=mtd5[1].innerHTML+","+ mtd5[2].innerHTML+","+ mtd5[3].innerHTML+"_"+ mtd5[4].innerHTML+" "+ mtd5[5].innerHTML
tnap=tnap+"<td>"+mttt+"</td>"
}}
else
{tnap=tnap+mas22[j3].outerHTML
}
}}
tnap=tnap+"</tr>"
}}
tnap=vib3+" "+tnap+"</table></html>"
dop=window.open("","","");
dop.document.write(tnap)
}

//*******************************************************************************************
function stopr()   // 
//******************************************************************************************
{mas2=document.getElementById("prop1").getElementsByTagName("TR")
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
tnap=tnap+"<b>Website: </b>"+document.getElementById("sname2").innerHTML+"<br><b>Page:&nbsp;&nbsp;&nbsp;</b><?php echo $tablr;?><hr>"
ref=location.href.split("contents")[1].split("/")[1]
tnap=tnap+ref+" / "
if (mpar.length==1) 
{tnap=tnap+document.getElementById("zag").outerHTML
}
if (mpar.length==2) 		  
{tnap=tnap+fl[0].document.getElementById("zag").outerHTML+" / "+document.getElementById("zag").outerHTML
}
if (mpar.length==3)
{tnap=tnap+fl[0].document.getElementById("zag").outerHTML+" / "+document.getElementById("zag").outerHTML
}
tnap=tnap+"<b>, column lookup table  '"+document.getElementById("listsi").innerHTML +"'</b>"
mdiv2=document.getElementById("list").getElementsByTagName("DIV")  //
for(var jj = 1; jj <= mdiv2.length-1; jj++)  
{if  (mdiv2[jj].style.display!="none")          // 
{tnap=tnap+mdiv2[jj].innerHTML
break
}}
tnap=tnap+"</html>"
dop=window.open("","","");
dop.document.write(tnap)
}
//*****************************************************************************
function tabprop()   // 
//*****************************************************************************
{dop=window.open("","","");
mas2=document.getElementById("prop1").getElementsByTagName("TR")
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
tnap=tnap+"<b>Website: </b>"+document.getElementById("sname2").innerHTML+"<br><b>Page:&nbsp;&nbsp;&nbsp;</b><?php echo $tablr;?>,&nbsp;&nbsp;&nbsp;<b>Table:</b>&nbsp;&nbsp;&nbsp;"
fl=window.top.frames
if (mpar.length==1) 
{tnap=tnap+document.getElementById("zag").innerHTML}
if (mpar.length==2) 		  
{tnap=tnap+fl[0].document.getElementById("zag").innerHTML+", son"
}
if (mpar.length==3)
{tnap=tnap+fl[0].document.getElementById("zag").innerHTML+", grandson"
}

w7=document.getElementById("tabl_sel")
if (w7!=undefined)
{tnap=tnap+",  "+w7.options[w7.selectedIndex].text}


tnap=tnap+"<table width=100%><tr><td colspan=7 align=center><b>PROPERTIES:&nbsp;&nbsp;</b></td></tr>"

vib3=""
for(var j2 = 0; j2 <= mas2.length-1; j2++)
{mas22=mas2[j2].getElementsByTagName("TD")
if (j2==0)
{tnap=tnap+"<tr>"
for(var j3 = 0; j3 <= mas22.length-1; j3++)
{if (j3==1)
{tnap=tnap+"<td><b><hr>"+mas22[j3].innerHTML+", template, description<hr></b></td>"
}
else
{tnap=tnap+"<td><b><hr>"+mas22[j3].innerHTML+"<hr></b></td>"
}}}
else
{tnap=tnap+"<tr>"
for(var j3 = 0; j3 <= mas22.length-1; j3++)
{if (j3==1)
{sdob=mas22[j3].title.replace("TEMPLATE:",", ")
sdob=sdob.replace("DESCRIPTION:",", ")
tnap=tnap+"<td><b>"+mas22[j3].innerHTML+"</b>"+sdob+"</td>"}
else
{tnap=tnap+mas22[j3].outerHTML
}}}
tnap=tnap+"</tr>"
}
tnap=vib3+" "+tnap+"</table></html>"
dop.document.write(tnap)
}

iks=0                         //
obju=""                       //
//*****************************************************************
function zus(event) // 
//****************************************************************
{event = event || window.event
var t = event.target || event.srcElement
if (t.tagName!="INPUT")
{return}
mtd4=t.parentNode.parentNode.getElementsByTagName("TD")    
tip5=mtd4[2].innerHTML
if (tip5=="d")                                          // 
{vz=document.getElementById('cal_td').innerHTML}
else if (tip5=="L")                                      //
{
mdiv2=document.getElementById("list").getElementsByTagName("DIV")  // 
for(var jj = 1; jj <= mdiv2.length-1; jj++)  
{mdiv2[jj].style.display=="none"                           // 
}
document.getElementById("list").style.display=""
iks=parseInt(mtd4[0].innerHTML,10)-1
document.getElementById("list"+iks).style.display=""
document.getElementById("pods2").disabled=false
document.getElementById("pods1").disabled=true
document.getElementById("pods3").disabled=true
document.getElementById("pods4").disabled=true
document.getElementById("pods5").disabled=true
document.getElementById("ko1").disabled=true
obju=t
winp=document.getElementById("list"+iks)
return
}
else if (tip5=="i")                                // 
{vz=document.getElementById('eva_r').innerHTML.replace('.00','');
document.getElementById('eva_s').value=''
}
else if (tip5=="$")                                //
{vz=document.getElementById('eva_r').innerHTML 
document.getElementById('eva_s').value=''
}
else if (tip5=="a")                                // 
{return}
else
{vz=document.getElementById('fort').value
if  (vz=="")
{alert("The input field is empty! \r\nEnter the selection list and repeat!")
return
}}
minp=t.parentNode.getElementsByTagName("INPUT")
if (minp.length==3)        // 
{if (t.name=="minn")       // 
{if (t.value==vz)
{t.value=""}
else
{t.value=vz
}}
else if (t.name=="maxx")   // 
{if (t.value==vz)
{t.value=""}
else
{t.value=vz}
}
else if (t.name=="spi")      //
{if (t.value.indexOf(vz)<0)
{t.value=t.value+vz+"/"
}}
else
{return}
}
else
{if (t.value.indexOf(vz)<0)
{t.value=t.value+vz+"/"
}}
select=false 
}

//*************************************************************************************
function seltext()    //
//*************************************************************************************
{ttt5=" "
mtd4=document.getElementById('selp').getElementsByTagName("TR") 
for(var j3 = 1; j3 <= mtd4.length-1; j3++)
{mtd44=mtd4[j3].getElementsByTagName("TD") 
mtd444=mtd44[3].getElementsByTagName("INPUT") 
//************************************************************
if (mtd444.length==1)                                   // 
{if (mtd444[0].value!="")
{if (mtd44[2].innerHTML=="L")
{vals3=mtd444[0].title                                  // 
}
else
{vals3=mtd444[0].value.replace(/\//g,",")               // 
}
vals3=vals3.replace(/(^\s*)|(\s*)$/g, '') 
vals3=vals3.substr(0,vals3.length-1)
ttt5=ttt5+"["+mtd44[1].innerHTML+"] in("+vals3+") & "
}}
//*******************************************************************************
else if (mtd444.length==3)                             //  
{valot=mtd444[0].value                                 // 
 valdo=mtd444[1].value                                 // 
vals=mtd444[2].value.replace(/\//g,",")                // 
vals=vals.substr(0,vals.length-1)
if (valot!="" || valdo!="" || vals!="")                // 
{mmm=mtd44[1].innerHTML                                // 
if (valot!="" && valdo!="" && vals!="")                // 
{ttt5=ttt5+valot+"<=["+mmm+"]<="+valdo+" or in("+vals+") & "}                     
else if  (valot!="" &&  valdo!="" && vals=="")         // 
{ttt5=ttt5+valot+"<=["+mmm+"]<="+valdo+" & "}
else if  (valot!="" && valdo=="" && vals=="")          // 
{ttt5=ttt5+valot+"<=["+mmm+"]"+" & "}
else if  (valot=="" && valdo!="" && vals=="")          // 
{ttt5=ttt5+"["+mmm+"]<="+valdo}
if (valot=="" && valdo=="" && vals!="")                // 
{ttt5=ttt5+"["+mtd44[1].innerHTML+" in("+vals+") & "
}}}
else
{return}
ttt5=ttt5.replace(/(^\s*)|(\s*)$/g, '')             // 
document.getElementById('seltext2').innerHTML=ttt5.substr(0,ttt5.length-1)
}}


//*********************************************************
function tab_sel()                 //   
//*********************************************************
{ev = event || window.event
var t = ev.target || ev.srcElement	
sel_value=t.options[t.selectedIndex].value    // 
//if (t.selectedIndex==0) return
if (sel_value=="2s" || sel_value=="3s")      // 
{sel_value2=sel_value+"1"}                   // 
else                                         // 
{sel_value2=sel_value}                       // 
www=sel_value2.replace("2s","")
www=www.replace("3s","")
www=www+".txt"
mpar0=tab2.split('/')                        // 
mpar0[mpar.length-1]=www                     // 
t_new=mpar0.join("/")
document.getElementById("form").action="?tabl="+t_new+ "&select2="+sel_value
form.elements["submit"].click()
}



setTimeout('crz(1)', 100)
</script>
<iframe id=pods33 style="display:none"  border=1 src="" target=_blank height=100%   width=100%  scrolling="auto" ></iframe>
<?php
$fdo2=getcwd()."/script/~do.htm";            // 
if  (file_exists($fdo2))  
{include $fdo2;
}
?>
</body>
<?php
if ($ggg!="")                                // 
{$wss="";
$nnn=0;
$kkk=0;
foreach ($mmtip as $tipi => $tipl)                     // 
{$mtipl=substr($tipl, 0,1);
if (($nnn>1) and ($mtipl=="i" or $mtipl=="$"))        // 
{if ($kkk%2==0)
{if ($ggg=="2")   // 
{$wss=$wss.'<nobr><iframe  id=ifrg'.$nnn.' border=1 src="" height=70%   width=50%  scrolling="auto" ></iframe>';
}
else
{$wss=$wss.'<iframe  id=ifrg'.$nnn.' border=1 src="" height=100%   width=100%  scrolling="auto" ></iframe>';
}}
else
{if ($ggg=="2")   // 
{$wss=$wss.'<iframe  id=ifrg'.$nnn.' border=1 src="" height=70%   width=50%  scrolling="auto" ></iframe></nobr></br>';
}
else
{$wss=$wss.'<iframe  id=ifrg'.$nnn.' border=1 src="" height=100%   width=100%  scrolling="auto" ></iframe></nobr></br>';
}}
$kkk++;
}
$nnn++;
}
if (substr($wss, strlen($wss)-7,7)=='</nobr>' or ($ggg==""))   //
{}
else
{$wss=$wss.'</nobr>';} 
echo $wss;
}

?>
</html>


