function GetCurrentStyle(el, val) { if(el.currentStyle) return el.currentStyle[val]; return document.defaultView.getComputedStyle(el, '')[val]; } /* function findPosX(obj) { var curleft = 0; while(obj.offsetParent && GetCurrentStyle(obj, 'position')!="absolute") { curleft+=obj.offsetLeft obj=obj.offsetParent; } return curleft; } function findPosY(obj) { var curtop = 0; while (obj.offsetParent) // && GetCurrentStyle(obj, 'position')!="absolute" { curtop+=obj.offsetTop obj=obj.offsetParent; } return curtop; } */ function findPosX(obj){ var curleft = 0; if (obj.offsetParent){ while (obj.offsetParent){ curleft += obj.offsetLeft obj = obj.offsetParent; } } return curleft; } function findPosY(obj){ var curtop = 0; if (obj.offsetParent){ while (obj.offsetParent){ curtop += obj.offsetTop obj = obj.offsetParent; } } return curtop; } var HideQueue=[]; function HideProc() { var n=HideQueue.shift(); if(!n) return false; window.clearTimeout(n.timeout); n=n.node.smenu; if(n.x_visible==0) n.style.display="none"; return true; } var ShowQueue=[]; function ShowProc() { var n=ShowQueue.shift(); window.clearTimeout(n.timeout); var par=n.node; var node=par.smenu; if(!node) return false; if(node.x_visible==1) { if(node.style.display=='' || node.style.display=='none') while(HideProc()); node.style.display="block"; if(par.className=="rmenu" || par.className=="lmenu") { var yoffs=(findPosY(par)-par.offsetTop)-(findPosY(node)-node.offsetTop); if(par.className=="rmenu") node.style.left=(findPosX(par)+par.offsetWidth-1)+"px"; else node.style.left=(findPosX(par)-node.offsetWidth+1)+"px"; node.style.top=(par.offsetTop+yoffs)+"px"; } else { node.style.left=findPosX(par)+"px"; node.style.top=(findPosY(par)+par.offsetHeight)+"px"; } while(HideProc()); } return true; } function RemoveClass(e, c) { var re=new RegExp(c+' *'); e.className=e.className.replace(re, ""); } function AddClass(e, c) { e.className+=" "+c; } function TestClass(e, c) { var re=new RegExp('\\b'+c+'\\b'); return (e && e.className && e.className.match(re)); } AttachEvent(window, 'load', function() { var all=document.getElementsByTagName("body")[0].getElementsByTagName("*"); for(var i=0; i