Логин:

Пароль:

Форумы
Общие вопросы
Document Object Model
Обсуждаем конференцию
Web Usability (test)

Общие вопросы

Помогите разобраться со слоями!

Нужно сделать выпадающую менюшку. Написала такой текст и выдается куча ошибок. Что делать?
<script LANGUAGE="JavaScript">
<!-- Begin
dom = (document.getElementById)? true : false;
nn4 = (document.layers)? true : false;
ie4 = (!dom && document.all)? true : false;
var last_elem, g_iFadeTimer, g_iMenuLeft, g_iMenuRight, g_iMenuBottom;
function fnShowMenu(oMenuLink, oMenuDiv){

.window.clearTimeout(g_iFadeTimer);
.HideMenu();
.if (dom)
. {
. document.getElementById(oMenuDiv).style.offsetWidth = document.getElementById(oMenuLink).style.offsetWidth;
. document.getElementById(oMenuDiv).style.filter = "alpha(opacity=100)";
. document.getElementById(oMenuDiv).style.left = document.getElementById(oMenuLink).style.offsetLeft;
. document.getElementById(oMenuDiv).style.visibility = "visible";
. alert(document.getElementById(oMenuDiv).style.left);
. }
else if (ie4)
. {
. document.all[oMenuDiv].style.offsetWidth = document.all[oMenuLink].style.offsetWidth;
. document.all[oMenuDiv].style.filter = "alpha(opacity=100)";
. document.all[oMenuDiv].style.left = document.all[oMenuLink].style.offsetLeft;
. document.all[oMenuDiv].style.visibility = "visible";
}
.last_elem = oMenuDiv;
}

function FadeMenu(){
.var iCursorLeft, iCursorTop, bInsideToolbar, bInsideMenu;

.if(last_elem != null){
..iCursorLeft = window.event.clientX;
..iCursorTop = window.event.clientY;

..bInsideToolbar = ((iCursorLeft > popup_menu.offsetLeft + 26) && (iCursorLeft < document.body.offsetWidth - 12) && (iCursorTop > 2));
..bInsideMenu = ((iCursorLeft > g_iMenuLeft) && (iCursorLeft < g_iMenuRight) && (iCursorTop < g_iMenuBottom));

..if(!bInsideToolbar || !bInsideMenu){
..if (dom) { document.getElementById(last_elem).style.filter = "alpha(opacity=50)";}
else if (ie4) { document.all[last_elem].style.filter = "alpha(opacity=50)";}
...g_iFadeTimer = window.setTimeout("HideMenu();", 50);
..}
.}
}
function HideMenu(){
.if(last_elem != null){
.if (dom) { document.getElementById(last_elem).style.visibility = "hidden"; document.getElementById(last_elem).style.filter = "alpha(opacity=0)";}
else if (ie4) { document.all[last_elem].style.visibility = "hidden"; document.all[last_elem].style.filter = "alpha(opacity=0)";}
..last_elem = null;
.}}
</head>
<body>
<div id="popup_menu">
<span id="father" onmouseout="FadeMenu();" onmouseover="fnShowMenu('father', 'child');" style="BACKGROUND:#cbcbcb"><font size=2 color=#0033cc><b>Пункт1</b></font></span></div>
<div id="submenu">
<div id="child" onmouseover="fnShowMenu('father', 'child');" onmouseout="HideMenu();" style="background:#dcdcdc;position:absolute; width:85px">Подпункт1</div></div>
СообщениеАвторДата
mania13.02.2003 13:27
Maniac13.02.2003 18:02
comhunt16.10.2005 18:28
mania13.02.2003 19:07
Maniac14.02.2003 11:41
mania18.02.2003 13:20
Maniac18.02.2003 15:21