<?php
header('Content-Type: text/html; charset=windows-1251');
/************************************************************* 
 



*************************************************************/
//--------------
include "f.php";   // 
//--------------
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Site structure</title>
<style>
a {color:#254A6C;font-family:tahoma;font-size:12px;font-weight:normal;}
.redlink {color:#B92327;font-family:tahoma;font-size:11px;font-weight:normal;}
.bluelink {color:#254A6C;font-family:tahoma;font-size:11px;font-weight:normal;}
a:hover {color:white;font-family:tahoma;font-size:12px;font-weight:normal;background:black}
</style>
</head>
<?php
if (file_exists(getcwd ( )."/otd/2.txt"))
{
echo '<body leftMargin=0 id=bod topMargin=0  style="overflow:hidden;background:silver;">';
echo '<table id=monoz  border=0 style="width:100%;height:100%;
z-index:3;position:absolute;top:0px;left:0px;">
<tr ><td width=30%>&nbsp;</td><td width=30%  valign=center align=center>
<table border=0 width=400 style="background:white" >
<tr><td><IMG height=60 border=0 src="d~e~f/pas.jpg"></td>
<td  height=30px ><center><b style="color:red" >Attention !'.
'</b></center><br>
<ol>
<li> The administrator has closed the site for work on its reorganization!
<li> Site will be available after completion of work!
<li> For information, please contact your administrator!
<li> Close site.
<li> Open the site later!</ol>
</td></tr>
</table>
</td><td width=30%>&nbsp;</td></tr></table></body></html>';
die;
}
?>
<body background="d~e~f/bkg4.gif" leftMargin=0 id=bod topMargin=0 style="overflow:hidden;visibility:hidden;" width=100% height=100%>
<table id=h style="z-index:2;opacity:0.3;visibility:hidden;height:110%;width:110%;position:absolute;top:0;left:0;background:black;filter:alpha(opacity=30)"><tr><td>&nbsp;&nbsp;&nbsp;</td><tr></table> 
<form id=form action="menu.php" method="post" enctype="multipart/form-data" >
<?php
//
if (isset($_GET['utf8']))
{$utf8=$_GET['utf8'];}
else
{$utf8="";}
$os=""; //
$repo=""; // 
$qw="";
// 
if (isset ($_REQUEST['stru']))
{$utf8=$_REQUEST['utf8'];
$stt=explode("\r\n", trim($_REQUEST['stru']));    //
$filename=getcwd ( )."/menu/pages.txt";
$h = fopen($filename, 'w+') or exit;	        //
if ($stt[count($stt)-1]!='***')                 //
{//
}
{foreach ($stt as $li => $lin)
{//
 {if (trim($lin)=="")
  {}  // 
  else
  {
  if  (substr($lin, 0, 1)=="*")
  {$qw=$lin."\r\n";}
  else
  {
  $qw=trim(str_replace(" ","_", $lin))."\r\n"; //
  }
  fwrite($h,$qw);     
 }}}}
 fclose($h); 					//
} 
// 
// 
if (isset($_GET['new']))
{
ini_set('max_execution_time', 900);
$pw=getcwd ( )."/pages";
$s =scandir($pw);	                      //
$gr=""; //
$pgr=""; // 
$str="#";         						  //
$sstr="#";         						  //
//*************************************************************************************
// 
//*************************************************************************************
foreach ($s as &$val) 			         
{if ($val != "." && $val != "..")      // 
 {if  (strstr($val, '.php'))           // 
  {$sstr=$sstr.trim(str_replace(".php","", $val))."#";
  }}
}

$gr=""; // 
$pgr=""; //

//*********************************************************************************
// 
//**********************************************************************************
$n = file(getcwd ( )."/menu/pages.txt");  // 
foreach ($n as &$val) 			         
{if (strpos(" ".$val,">")>0 or substr($val,0,1)=="*" or substr($val,0,1)=="*")
 {if (strpos($val,'/')>0) 				 //
  {list($im1, $tit) = explode('/',$val);
   $tit=trim($tit);}
  else
   {$im1=trim($val);$tit="";}
    if (substr($im1,0,1)==">")  //
  {
    $gr=substr($im1,1)."_"; $pgr="";$pgr1="";$gr1=$gr;
	if (strpos($im1,"=")>0) 
  {
  list($gr1, $gr) = explode('=',$gr);
  } // 
 } 
  if (substr($im1,0,2)=="^>") //
  {
   $pgr=substr($im1,2)."_";
   $pgr1=$pgr;
   if (strpos($pgr,"=")>0) {list($pgr1, $pgr) = explode('=',$pgr); $pgr1=$pgr1."_";} //
   } 
} // 
else
{if (strpos($val,'/')>0) 				 //
{list($im, $tit) = explode('/',$val);
$tit=trim($tit);}
else
{$im=$val;$tit="";}
$im=trim($im);
$im2=$im;
if (strpos($im,"=")>0)                   // 
{
list($im2, $im) = explode('=',$im); 

}     // 
// 
//

if (substr($val,0,4)=="^^^^")
{$ksv=substr($val,4);//echo $ksv."<br>";
}
else if (substr($val,0,1)=="^")
{$ksv=substr($val,1); //echo $ksv."<br>";
}
else
{$ksv=$val;}

if (strpos(" ".$ksv,'^')>0) 				 //
{$repo=$repo."<b style='color:red'>The ^ symbol cannot be in the text!</b><br> ".$ksv.", remove it. <hr>";}
else
{

if (substr($im2,0,1)!="^") {$gr=""; $pgr=""; $gr1="";$pgr1="";} //
$im=str_replace("^","",$im);
$im2=str_replace("^","",$im2);
$nn=$gr.$pgr.$im;
$nn1= $gr1.$pgr1.$im2;
$nn1=tr($nn1);
$fnn1=$gr.$pgr.str_replace("^","",$im);

if (strpos(" ".$str,'#'.$fnn1.'#')>0)  //
{
$repo=$repo."<b style='color:red'>Name duplication is not allowed.</b><br> ".$fnn1.". <hr>";
}
else
{
//echo $fnn1."<hr>";

if  (substr($fnn1, 0, 1)=="*")
{
$ndps="";
}
else
{
$ndps=ktex($fnn1);
}
if ($ndps<>"")
{
$repo=$repo.'<b style="color:red">take away '.$ndps." in </b>".$fnn1."<hr>";
}
else
{

$str=$str.$fnn1."#";                    //
$fnn1=tr($fnn1);                        //
$str=$str.$fnn1."#";                    //

if ($im==$im2)
{
$str=$str."?#";                    // 
}
else
{
$str=$str.$im2."#";                    //
}
}
}}
}}
if ($repo=="")
{
//echo $sstr."<br><br>";  //
//echo $str."<br><br>";   //

//*******************************************************************************
// 
//*******************************************************************************
// 
$mass=explode("#", $sstr);              // 
foreach ($mass as &$val)              // 
{
if (strpos(" ".$str,'#'.$val.'#')>0)  // 
{}
else                                  // 
{
 $pw=getcwd ( ).'/pages/'.$val;       // 
 if (file_exists ($pw))
  {if ($val!="") 
   {full_del_dir($pw);               // 
    $pw=$pw.'.php';			         // 
	if (file_exists ($pw)) 
     {unlink ($pw);                  // 
     } 
$repo=$repo."deleted ".$val."<br>";
}}}}
$filename=getcwd ( )."/otd/page.txt";
$hh = fopen($filename, 'w+') or exit;	        //
fwrite($hh,"Page name/page file\r\n");
// 
$mas=explode("#", $str);              // 
//echo $str; 
//$masr=explode("#", $strr);              // 
$k=count($mas)-2;
// 
for ($i = 1; $i <= $k; $i++) 
{
//echo $mas[$i]."/".$mas[$i+1]."<br>";
if ($mas[$i+2]!="?")   //
{fwrite($hh,$mas[$i+2]."=".$mas[$i]."/".$mas[$i+1].".htm\r\n");}
else
{fwrite($hh,$mas[$i]."/".$mas[$i+1].".htm\r\n");
}
$pw2=getcwd ( ).'/pages/';                   // 
$w = fopen($pw2.$mas[$i+1].".php", 'w') or exit;	 //

if ($mas[$i+2]!="?")   // 
{
//echo $mas[$i+2]."<br>";
$zi=$mas[$i+2];}
else
{$zi=$mas[$i];}
$zi=str_replace("_"," ",$zi);
fwrite($w, 	    
$d=
'<?php '."\r\n".
'include "../begin.htm";'."\r\n".
'echo "'.$zi.'";'."\r\n".
'include "../begin1.htm";'."\r\n".
'echo "'.$zi.'";'."\r\n".
'include "../page_begin.htm";'."\r\n".
'$os="";'."\r\n".
'$ff=getcwd ( )'.".'/".$mas[$i+1]."/".$mas[$i+1].".php';"."\r\n".
'include "../time.php";'."\r\n".
'include "../end.php";'."\r\n".
'?>'
);
fclose($w);                              //

if (strpos(" ".$sstr,'#'.$mas[$i+1].'#')>0)        //
{}
else                                         //
{
$pw=getcwd ( ).'/pages/'.$mas[$i+1];     // 
if (file_exists ($pw))
{
$repo=$repo.'<b style="color:red">Name double.'.$mas[$i+1]."</b><br>";
}
else
{
mkdir($pw);                              //
$pw1=$pw.'/'.$mas[$i+1];                //
$pw2=$pw.'/contents';                   //
mkdir($pw2);                            //
mkdir($pw1);
$w = fopen($pw1."/".$mas[$i+1].".htm", 'w') or exit; fclose($w);
$w = fopen($pw."/".$mas[$i+1].".php", 'w') or exit;	  //
fclose($w);
$repo=$repo."created ".$mas[$i+1]."<br>";
}
}
$i++;
$i++;
}
fclose($hh);                            //
}  //
}
?>
<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> 
<table id=tab border=0 width=100% height=100%><tbody>
<tr><td id=zag colspan=3 align=center height=40 style="color:white;background:brown">
<b style=color:yellow>WEBSITE:</b> <b style=color:yellow id=sname2>
<?php
include "plan/name.txt";
?>
</b><br>

<b><big>Adding, removing pages shown in the center of the main page (internal pages), changing the structure (tree) of the site.</big></b>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a  href="help/4.htm#41" target=_blank style="color:white">&nbsp;Help&nbsp;</a>
</td></tr>
<tr>
<td align = center width = 240 style = "background: brown; color: white"> <b> Structure (view) </b> </td>
<td align = center width = 100% style = "background: brown; color: white"> <b> Structure file (edit) </b> </td>
<td align = center width = 240 style = "background: brown; color: white"> <b> Tutorial (study) </b> </td></tr>
<tr><td valign=top>
<DIV id=k style="OVERFLOW: scroll; HEIGHT: 400; width:100%" align=left scrollTop=0>
<nobr>
<?php
if (isset ($_REQUEST['vis']))
{$vis=$_REQUEST['vis'];}
else
{$vis=";0";}
if (isset ($_REQUEST['r']))
{$r=$_REQUEST['r'];}
else
{$r="";} 
if (strpos($vis,$r.';')>0)  //
{$vis=str_replace($r.';','',$vis);}
else
{$vis=$vis.$r.';';}
$kat=getcwd ( );		 		// 
$l = file($kat."/menu/pages.txt");
$k=count($l)-1;
//******************************
// 
//*****************************
$gr="";  //
$pgr=""; // 
$start=false;
$mg[]="";                        // 
$tgr="";                         // 

for ($i = 0; $i <= $k; $i++)     // 
{
 if (strpos($l[$i],'/')>0)       // 
  {list($im, $tit) = explode('/',$l[$i]);
   $tit=trim($tit);}
 else                            // 
  {$im=$l[$i];$tit="";}         
  $im=trim($im);$im=str_replace('^','',$im);$im=str_replace('>','',$im); //
  
  if (strpos($im,"=")>0)         // 
   {list($im, $im1) = explode('=',$im);}  // 
  else                           //
   {$im1=$im;}                   //
   if (substr($l[$i],0,1)=="*")  //
    {}
   else if (substr($l[$i],0,2)=="^>")  // 
    {$pgr=$im1."_";                    // 
//echo $pgr;
    if (true)     // 
     {$tt='&nbsp;&nbsp<nobr><IMG onClick=c("menu.php?r='.$i.'&vis='.$vis.'&utf8='.$utf8.'")  title="'.$tit.'" src="d~e~f/minus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
     echo $tt; }
    else  // 
     {$tt='&nbsp;&nbsp<IMG onClick=c("menu.php?r='.$i.'&vis='.$vis.'&utf8='.$utf8.'") title="'.$tit.'"  src="d~e~f/plus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b><br>';  
     echo $tt;
     for ($ii = $i+1; $ii <= $k; $ii++) 
      {if (substr($l[$ii],0,4)!="^^^^")  {$i=$ii-1;  break;}}}}  // 
       else if (substr($l[$i],0,1)==">")  //  
        {$gr=$im1."_";$pgr="";
        if (true)
         {$tt='<nobr><IMG onclick=c("menu.php?r='.$i.'&vis='.$vis.'&utf8='.$utf8.'") title="'.$tit.'" src="d~e~f/minus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
          $gr=$im1."_";$pgr="";
          echo $tt; }
        else
         {$tt='<IMG language=JavaScript onclick=c("menu.php?r='.$i.'&vis='.$vis.'&utf8='.$utf8.'") title="'.$tit.'" src="d~e~f/plus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b><br>';
         echo $tt;
         for ($ii = $i+1; $ii <= $k; $ii++) 
          {if (substr($l[$ii],0,1)!="^")  
		    {$i=$ii-1;$pgr="";break;}}}}  //  
           else  // 
            {
            if (substr($l[$i],0,1)!="^")  {$$gr=""; $pgr="";}
             $kp=strrpos($l[$i],'^'); //
             if ($kp===false) 
              {
              if (substr($tit,0,1)!="*")
               {
               $tt='<nobr><A onclick=q1(this) title="'.$tit.'" target=_blank href="pages/'.tr($im1).'.php">'.$im.'</A></nobr><br>';
               echo $tt;
               }
               }
              else
               {
               if ($kp==0)
   {echo str_repeat('&nbsp;', $kp+3);}
   else
    {echo str_repeat('&nbsp;', $kp+3);}
   if (substr($tit,0,1)!="*")
	{$tt='<nobr><A  onclick=q1(this) title="'.$tit.'" target=_blank href="pages/'.tr($gr).tr($pgr).tr($im1).'.php">'.$im.'</A></nobr><br>';
	echo $tt; }
	}
	}}

	
//***************************************************************************************************
// 
//
//***************************************************************************************************
$h = fopen("plan/bce.htm", 'w+') or exit;	//
$h1 = fopen("plan/bce1.htm", 'w+') or exit;	//
fwrite($h1,'<div id=z0 style="display:none;OVERFLOW: scroll;height:400px;width:250px"><table border=0><tbody><tr><td>&nbsp</td><td id=zz0>'."\r\n");
$kat=getcwd ( );		 		// 
$l = file($kat."/menu/pages.txt");
$k=count($l)-1;
$gr="";  //
$pgr=""; // 
$start=false;
$mz = array();
$iii=0;
$kk=0;
for ($i = 0; $i <= $k; $i++)    //
{
 if (strpos($l[$i],'/')>0)       //
  {list($im, $tit) = explode('/',$l[$i]);
  $tit=trim($tit);}
 else                           // 
  {$im=$l[$i];$tit="";}
  $im=trim($im);$im=str_replace('^','',$im);$im=str_replace('>','',$im);  //
  if (strpos($im,"=")>0)                      // 
   {list($im, $im1) = explode('=',$im);}
  else
  {$im1=$im;}
  if (substr($l[$i],0,1)=="*")                // 
   {}
   //*********************************
   //
   //*********************************
  else if (substr($l[$i],0,2)=="^>")          
   {
   if ($pgr!="")                              //
    { $w= '</div>';                            //
    fwrite($h,$w);}
    $pgr=$im1."_";
    $w='&nbsp;&nbsp<nobr><IMG id=ss'.$kk.' onclick="c('."'s".$kk."',this".')" title="'.$tit.'" src="../d~e~f/plus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
    fwrite($h,$w."\r\n");
    $w='&nbsp;&nbsp<nobr><IMG title="'.$tit.'" src="../d~e~f/minus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
    fwrite($h1,$w."\r\n");
    $w= '<div id=s'.$kk++.' style="display:none">';
    fwrite($h,$w."\r\n");
    }  
    //**************
    //  
    //**************
   else if (substr($l[$i],0,1)==">")           //
    {
    if ($gr!="")                               //
    {$w= '</div>';                            // 
     fwrite($h,$w);
	}
    if ($pgr!="")                              //
    {
	 $w= '</div>';                            // 
     fwrite($h,$w);
	}
    $gr=$im1."_";$pgr="";
    $mmm=explode('/',$l[$i]);
    if (count($mmm)>=3)                      // 
    {
     $mz[$iii++]=$im; $im=$im."_";
    }
//$w= '<b></b><nobr><IMG id=gg'.$kk.' onclick="c('."'g".$kk."',this".')"  title="'.$tit.'" src="../Default.aspx_files/plus.gif" border=0>&nbsp;<b><u>'.$im.'</u></b></nobr><br>';
    $w= '<nobr><IMG id=gg'.$kk.' onclick="c('."'g".$kk."',this".')"  title="'.$tit.'" src="../d~e~f/plus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
    fwrite($h,$w."\r\n");
    $w= '<b></b><nobr><IMG  title="'.$tit.'" src="../d~e~f/minus.gif" border=0>&nbsp;<b><u title="'.$tit.'">'.$im.'</u></b></nobr><br>';
    fwrite($h1,$w."\r\n");
    $w= '<div id=g'.$kk++.' style="display:none">';
    fwrite($h,$w."\r\n");
    } 
    //*****************
    //  
    //*****************
   else  
   {
    if (substr($l[$i],0,1)!="^")  //
    {
    if ($pgr!="")                 //
    {$w= '</div>';                //
     fwrite($h,$w);}
     if ($gr!="")                 //
     {                           
      fwrite($h,"</div>");        //
      fwrite($h1,"<b></b>\r\n");
     }  
     $gr=""; $pgr="";             //
    }
    if (substr($tit,0,1)!="*")    //
    {
	$kp=strrpos(' '.$l[$i],'^');     // 
	
	if ($kp!=0)                  //
     {
	 //echo $kp;
	 if ($kp==4)
	 {$w= str_repeat('&nbsp;', $kp+2); }
	 else
	 {
      $w= str_repeat('&nbsp;', $kp+3); //
      }
	  fwrite($h,$w);
      fwrite($h1,$w);
     }
  //{
	$w= '<nobr><A  class=menul href="#" title="'.$tit.'" onclick="q1('. "'".'../pages/'.tr($gr.$pgr.$im1).'.php'."'".',this)">'.$im.'</A></nobr><br>';
	fwrite($h,$w."\r\n");
	fwrite($h1,$w."\r\n");
}}}
if ($pgr!="")                 //
{
fwrite($h,'</div>'."\r\n");
}
if ($gr!="")                 // 
{
fwrite($h,'</div>'."\r\n");
}
//fwrite($h,'</div></div>'."\r\n");
fclose($h); 					//
fwrite($h1,'<b></b></td><td>&nbsp;</td></tr></tbody></table></div>'."\r\n");
fclose($h1); 					//
	

//******************************************
//  
//******************************************
$pln = fopen(getcwd ( )."/plan/plan.htm", 'w') or exit;	//
$i=0;
fwrite($pln,'<a class=menu href=#><b  onclick="pgm('.$i++.')" title="Site `s map.">&nbsp;ALL&nbsp;</b></a>'."\r\n");
foreach ($mz as $val) 
{
fwrite($pln,'<a class=menu href=#><b onclick="pgm('.$i++.')">&nbsp;'.$val.'&nbsp;</b></a>'."\r\n");
}
fclose($pln);
//**************************************************
// 
//***************************************************
$ww= file_get_contents ($kat."/plan/bce1.htm");
$mgm=explode("<b></b>",$ww);
$k=count($mgm)-1;
$h2 = fopen("plan/bce2.htm", 'w+') or exit;	//
$ngm=1;
for ($i = 1; $i <= $k-1; $i++) 
{
if (strpos($mgm[$i], '_</u></b></nobr><br>')>0)
{
fwrite($h2,'<div id=z'.$ngm++.' style="display:none;OVERFLOW: scroll;height:400px;;width:250px"><table border=0><tbody><tr><td>&nbsp</td><td id=zz0>'."\r\n");
fwrite($h2,$mgm[$i]);
fwrite($h2,'</td><td>&nbsp</td><tr></tbody></table></div>'."\r\n");
}
}
fclose($h2);



?>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</nobr>




</div>

</td>

<td valign=top id=cen>
<textarea id=cent name=stru wrap=off id=stru >
<?php 

include "menu/pages.txt"; ?>
</textarea>
<center>
<button form="" style=width:30 onclick=ptab()>P</button>

<input style="background:brown;color:white" type="submit" value="save" 
title="click me after finishing editing the file to save your changes.">&nbsp;&nbsp;&nbsp;
<?php echo '<A title="Click me to change the site structure based on the modified structure file." href="menu.php?new=1&utf8='.$utf8.'"><b style=color:white;background:brown  onclick=rep2()>Accept the modified site structure.</b></a>'; ?></center>
<input type=hidden name="r" value="<?php  echo $r; ?>">
<input type=hidden name="vis" value="<?php  echo $vis; ?>">
<input type=hidden name="utf8" value="<?php  echo $utf8; ?>">
</form>
</td>
<td width=100%  valign=top>
<DIV id=left1 style="OVERFLOW: scroll; HEIGHT: 200" align=left>
<b style = "color: brown; width: 100%"> TO ADD, DELETE, CHANGE PAGES, EDIT THE STRUCTURE FILE. </b>
<hr>
<li> The structure consists of the following objects: <b> PAGES, GROUPS, GROUPS, COMMENTS </b>.
<li> <b> PAGE: </b> the line in which the page name is entered from the beginning of the line.
<li> <b> GROUP: </b>> group name.
<li> <b> GROUP PAGES: </b> ^ page name.
<li> <b> SUBGROUPS: </b> ^> name of the subgroup.
<li> <b> SUBGROUP PAGES: </b> ^^^^ page name.
<li> <b> COMMENT </b>: text that starts with *.
<li> <b> POP-UP CLIP: </b> /the text of the prompt.
<li> <b> Use an underscore instead of a space in all names. </b><hr>
<center> <b style = "color: brown; width: 100%"> IF NECESSARY: </b> </center>
<li> Add lines of pages, groups, subgroups.
<li> Delete lines with deleted pages, groups, subgroups.
<li> Change the order of the lines.
<li> To hide the page (exclude from the structure without deleting it), enter the first character of the hint *.
<li> To place the group name on the horizontal menu bar, after, or instead of the tooltip, enter the / symbol.
<li> Save your changes by clicking the "Save" button.
<li> Click "Accept Changed Site Structure".<hr>
<center> <b style = "color: brown; width: 100%"> IMPORTANT: </b> </center>
<li> SYMBOL = USE ONLY TO SEPARATE NEW AND OLD NAME
<li> IN THE NAMES, the SPACEBAR IS REPLACED BY THE SYMBOL _.
<li> IT IS FORBIDDEN TO LOCATE SUBGROUPS OUTSIDE GROUPS AND PAGES IN GROUPS, BUT OUTSIDE SUBGROUPS.<hr>
<b style = color: brown> WARNING! </b>
<li> Deleted pages cannot be restored!
<li> When changing the names in the structure file, the objects of the structure with the old names will be REMOVED FOREVER!
<li> To CORRECTLY CHANGE the NAME of an existing object, change the name as follows:
new name = old name </div><big style="background:brown;color:white;width:240px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  M E S S A G E S:</big>
<DIV id=left2 style="OVERFLOW: scroll; HEIGHT: 200" align=left id=rep2>
<?php
if ($os!="") {echo "<font color=red size=4>Change Rejected - The following errors were found:</font><li>"; 
echo $os; echo "<font color=red size=4>Correct errors and try again to change the structure</font>";}
else
{if ($repo!="") {echo $repo;} else {echo "<b>Name changes completed!</b><br>";}}
?>
</div>

</TD>
</td>
</tr></tbody></table>

<a id=per target=_blank style="visibility:hidden" href=#>+++</a>
</body>

<script  type="text/javascript">
//*******************************
window.onload=function ()
//******************************
{h2=document.getElementById("h").offsetHeight
w2=document.getElementById("h").offsetWidth

document.getElementById("cent").style.height=(h2-200)+"px"
document.getElementById("cent").style.width=(w2-600)+"px"
document.getElementById("k").style.height=(h2-200)+"px"
document.getElementById("k").style.width="240px"
document.getElementById("left1").style.width="240px"
document.getElementById("left1").style.height=(h2-200)/2+"px"
document.getElementById("left2").style.height=(h2-200)/2+"px"

w=<?php   if (isset($_GET['scr'])) {echo trim($_GET['scr']);} else {echo "0";} ?>;
obj=document.getElementById("k");
obj.scrollTop=w;
i=0;
while (obj.scrollTop!=w)
{obj.scrollTop=w; i=i+1; if (i>17) {break;} 
}
document.getElementById("bod").style.visibility="visible"
document.getElementById("stru").style.height=cen.offsetHeight-40
document.getElementById("stru").style.width=cen.offsetWidth
}



function c(p)
{
}

function q1(jj)
{devdate=new Date();
var dy="";
//
dy=devdate.getFullYear()
var dm="";
//
dm=devdate.getMonth()+1
var dc="";
//
dc=devdate.getDate();
var cd="";
//
dd=devdate.getDay();
var dp=""
dp=dy+"-"+dm+"-"+dc+"-"+dd
jj.href=jj.href+"?td="+ dp
}

function rep2()
{document.getElementById("h").style.visibility="visible"
}

//********************************************************************
function ptab() //
//********************************************************************
{newstr2="<b>Website: </b>"+document.getElementById("sname2").innerHTML
newstr2=newstr2+"<h2 style='text-align:center'>Structure</h2>"
w=document.getElementById("cent").value.replace(/\r/g,"")
w=w.replace(/\n/g,"<br>")
newstr2=newstr2+w
dop=window.open("","","");
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head><BLOCKQUOTE>"
tnap=tnap+newstr2+"</BLOCKQUOTE></html>"
dop.document.write(tnap)
}

</script>

</html>