Это старая ошибка.просто я скрипт меняла по всякому.
Вот новый код
<script language="JavaScript" type="text/javascript">
// Îáâîðà÷èâàåì ôóíêöèþ toggle â ëîêàëüíîå çàìûêàíèå:
var toggle = function() {
// Ññûëêà íà òåêóùèé îòêðûòûé div:
var currentDiv = null;
// Ôóíêöèÿ äëÿ "ðàñêðûòèÿ" ýëåìåíòà:
function open(divElement) {
// Òóò ìîæíî äîáàâèòü ýôôåêò "ïëàâíîãî" îòêðûòèÿ:
divElement.style.display = "block";
currentDiv = divElement;
}
// Ôóíêöèÿ äëÿ "çàêðûòèÿ" ýëåìåíòà:
function close(divElement) {
// Òóò ìîæíî äîáàâèòü ýôôåêò "ïëàâíîãî" çàêðûòèÿ:
divElement.style.display = "none";
currentDiv = null;
}
// Âîçâðàùàåì ôóíêöèþ, êîòîðàÿ áóäåò âûçûâàòüñÿ ïî toggle()
return function(divID) {
// Ïîëó÷àåì ýëåìåíò èç DOM
var divElement = document.getElementById(divID);
// Åñëè îòêðûò äðóãîé div, òî çàêðûâàåì è îòêðûâàåì òåêóùèé:
if(currentDiv != null) {
close(currentDiv);
open(divElement);
}
// Åñëè òàêîé åñòü:
else if (divElement) {
// Åñëè óæå îòêðûò ýòîò div, òî ïðîñòî çàêðûâàåì.
if (divElement === currentDiv) {
close(currentDiv);
// Åñëè îòêðûò äðóãîé div, òî çàêðûâàåì è îòêðûâàåì òåêóùèé:
} else if(currentDiv != null) {
close(currentDiv);
open(divElement);
// Èíà÷å - ïðîñòî îòêðûâàåì:
} else open(divElement);
}
}
// Âûçûâàåì íàøó "îáåðòêó", òåïåðü toggle() âûçûâàåò ôóíêöèþ, îïèñàííóþ ïî "return"
}();
</script>
if ($i == 1)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
//echo $day_sel;
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel; ?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
elseif ($i == 2)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel; ?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
elseif ($i == 3)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
elseif ($i == 4)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.0'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
elseif ($i == 5)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.0'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
elseif ($i == 6)
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.0'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}
else
{
echo '<tr><TD width="39" height="39" nowrap align="center" valign="middle">';
//echo $day_sel;
?>
<A href="javascript://" onClick="toggle('<? echo $day_sel?>');return false;" class="c"><div class="data1"><br><? echo $day_now.'.0'; echo $month_now; ?></div></a>
<?
echo '</TD></tr>';
}