
        function showw(id){
                el = document.getElementById(id);
                if(el.style.display=='block'){
                        el.style.display = 'none';
                }else{
                        el.style.display = 'block';
                }
        }

function ImgShw(ID, width, height, alt)
{
        var scroll = "no";
        var top=0, left=0;
        if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
        if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
        if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
        width = Math.min(width, screen.width-10);
        height = Math.min(height, screen.height-28);
        var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
        wnd.document.write(
                "<html><head>"+
                "<"+"script type=\"text/javascript\">"+
                "function KeyPress()"+
                "{"+
                "        if(window.event.keyCode == 27) "+
                "                window.close();"+
                "}"+
                "</"+"script>"+
                "<title>"+(alt == ""? "Картинка":alt)+"</title></head>"+
                "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">"+
                "<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\" />"+
                "</body></html>"
        );
        wnd.document.close();
}

startList=function(){if(document.all&&document.getElementById){navRoot=document.getElementById("cssmenu1");
for(i=0;i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];
if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over";};node.onmouseout=function(){this.className=this.className.replace(" over", "");}}}}};window.onload=startList;

var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
var submenuoffset=0 //Offset of submenus from main menu. Default is -2 pixels.

function createcssmenu(){
for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    var spanref=document.createElement("span")
                spanref.className="arrowdiv"
                ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    ultags[t].parentNode.onmouseover=function(){
    this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
    this.getElementsByTagName("ul")[0].style.display="block"
    }
    ultags[t].parentNode.onmouseout=function(){
    this.getElementsByTagName("ul")[0].style.display="none"
    }
    }
  }
}




if (window.addEventListener)
window.addEventListener("load", createcssmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu)

function newBg(img){document.getElementById("TableMenu").style.backgroundImage="url(/img/formenu/"+img+".jpg)";}