<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

<meta http-equiv="Content-Language" content="ru">

<title>Выберите раздел - shopwm.ru </title>

<link rel="stylesheet" href="/antsoft.css" type="text/css">

</head>



<script language="javascript">

function showtree(id){

	var menu = 'table' + id;

	var folder = 'folder' + id;

	var node = 'node' + id;

	if(document.all(menu) != null){

		if(document.all(menu).style.display == 'none'){

			document.all(menu).style.display = '';

			document.images[folder].src = 'img/open.gif';

			document.images[node].src = 'img/node_minus.gif';

		}

		else{

			document.all(menu).style.display = 'none';

			document.images[folder].src = 'img/closed.gif';

			document.images[node].src = 'img/node_plus.gif';

		}

	}

}



function selectr(id_r, razdel){

	window.top.opener.parent.document.all.id_r.value = id_r;

	window.top.opener.parent.document.all.razdel.value = razdel;

	window.parent.close();

}

</script>



<body topmargin="0" leftmargin="0">

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr>

   <td width="100%" bgcolor="#F0F0F0">

    <p align="left"><b>Добавление нового товара &gt;&gt; Выбор раздела</b></p>

   </td>

  </tr>

</table>

<p><img id="pic1" border="0" src="img/pic_razdel_load.gif" width="80" height="20"></p>



<table border=0 cellspacing=0 cellpadding=0>



<?

$fr = file("tx/razdel.txt");



//$tmp = "";

//$tmp2 = "";

//$tmp3 = "";

$pos = 0;

for ($i = 0; $i < count($fr); $i++) {

 $pos2 = $pos+1;

 $pos3 = $pos2+1;

 $pos4 = $pos3+1;

 $ifs = false;



 $ar0 = explode("^", trim($fr[$i-1]));

 $ar = explode("^", trim($fr[$i]));

 $ar2 = explode("^", trim($fr[$i+1]));

//первое вложение begin

 If ($ar[1] <> "") {

  If ($ar[1] <> $tmp) {

   If ($ar[2] == "") {

    echo "

<tr><td><img src='/pixel.gif' width=15 height=15></td>

<td nowrap><img src='img/doc.gif' width=16 height=16 border=0> <a href=\"javascript:selectr('$ar[0]', '$ar[1]');\" class='cap2'>$ar[1]</a></td></tr>

<td></td><td>";

   }

   Else {

    echo "

<tr><td><img id=node$pos src='img/node_plus.gif' width=15 height=15 onClick=\"showtree($pos)\"></td>

<td nowrap><img id=folder$pos src='img/closed.gif' width=16 height=14> $ar[1]</td></tr>

<tr><td></td><td>";

   }

   $tmp = $ar[1];

  }

  Else {

   If ($ar2[1] <> $ar[1]) {

    echo "</td></tr>";

   }

  }

 $ifs = true;

 }

//первое вложение end



//второе вложение begin

 If ($ar[2] <> "") {

  If ($ar[2] <> $tmp2) {

   If ($ar0[1] <> $ar[1]) { echo "<table border=0 CELLSPACING=0 CELLPADDING=0 style='display: none' id=table$pos>"; }

    If ($ar[3] == "") {

     echo "

<tr><td><img src='/pixel.gif' width=15 height=15></td>

<td nowrap><img src='img/doc.gif' width=16 height=16 border=0> <a href=\"javascript:selectr('$ar[0]', '$ar[1] > $ar[2]');\" class='cap2'>$ar[2]</a></td></tr>

<td></td><td>";

    }

    Else {

     echo "

<tr><td><img id=node$pos2 src='img/node_plus.gif' width=15 height=15 onClick=\"showtree($pos2)\"></td>

<td nowrap><img id=folder$pos2 src='img/closed.gif' width=16 height=14> $ar[2]</td></tr>

<tr><td></td><td>";

    }

   $tmp2 = $ar[2];

  }

  Else {

   If ($ar2[2] <> $ar[2]) {

    echo "</td></tr>";

   }

  }

  If ($ar2[1] <> $ar[1]) {

   echo "</table>";

  }

 $ifs = true;

 }

//второе вложение end



//третее вложение begin

 If ($ar[3] <> "") {

  If ($ar[3] <> $tmp3) {

   If ($ar0[2] <> $ar[2]) { echo "<table border=0 CELLSPACING=0 CELLPADDING=0 style='display: none' id=table$pos2>\n"; }

    If ($ar[4] == "") {

     echo "

<tr><td><img src='/pixel.gif' width=15 height=15></td>

<td nowrap><img src='img/doc.gif' width=16 height=16 border=0> <a href=\"javascript:selectr('$ar[0]', '$ar[1] > $ar[2] > $ar[3]');\" class='cap2'>$ar[3]</a></td></tr>

<td></td><td>\n";

    }

    Else {

     echo "

<tr><td><img id=node$pos3 src='img/node_plus.gif' width=15 height=15 onClick=\"showtree($pos3)\"></td>

<td nowrap><img id=folder$pos3 src='img/closed.gif' width=16 height=14> $ar[3]</td></tr>

<tr><td></td><td>";

    }

   $tmp3 = $ar[3];

 }

  Else {

   If ($ar2[3] <> $ar[3]) {

    echo "</td></tr>";

   }

  }

  If ($ar2[2] <> $ar[2]) {

   echo "</table>";

  }

 $ifs = true;

 }

//третее вложение end



//четвертое вложение begin

 If ($ar[4] <> "") {

  If ($ar[4] <> $tmp4) {

   If ($ar0[3] <> $ar[3]) { echo "<table border=0 CELLSPACING=0 CELLPADDING=0 style='display: none' id=table$pos3>\n"; }

    If ($ar[5] == "") {

     echo "

<tr><td><img src='/pixel.gif' width=15 height=15></td>

<td nowrap><img src='img/doc.gif' width=16 height=16 border=0> <a href=\"javascript:selectr('$ar[0]', '$ar[1] > $ar[2] > $ar[3] > $ar[4]');\" class='cap2'>$ar[4]</a></td></tr>

<td></td><td>\n";

    }

    Else {

     echo "

<tr><td><img id=node$pos4 src='img/node_plus.gif' width=15 height=15 onClick=\"showtree($pos4)\"></td>

<td nowrap><img id=folder$pos4 src='img/closed.gif' width=16 height=14> $ar[4]</td></tr>

<tr><td></td><td>";

    }

   $tmp4 = $ar[4];

 }

  Else {

   If ($ar2[4] <> $ar[4]) {

    echo "</td></tr>";

   }

  }

  If ($ar2[3] <> $ar[3]) {

   echo "</table>";

  }

 $ifs = true;

 }

//четвертое вложение end





 If ($ifs == true) {

  $pos = $pos+2;

 }

}





?>

</td>

</tr>

</table>



</body>

</html>



<script> document.all.pic1.style.display = 'none'; </script>