isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
  isOpera=isOpera5=window.opera && isDOM //Opera 5+
  isOpera6=isOpera && window.print //Opera 6+
  isOpera7=isOpera && document.readyState //Opera 7+
  isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
  isMSIE5=isDOM && isMSIE //MSIE 5+
  isNetscape4=document.layers //Netscape 4.*
  isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*

  var menuopened;
  var num=5;

  preload=new Array();
  preload[1]=new Image();
  preload[1].src="images/menulab.gif";
  preload[2]=new Image();
  preload[2].src="images/menulabop.gif";
  preload[3]=new Image();
  preload[3].src="images/submenulab.gif";

  function menu(id){
  	if(document.getElementById){
  //		for(i=0;i<document.all.tags("TR").length;i++){
  		for(i=0;i<num;i++){
  			elid=id+""+i;
  			if(document.getElementById(elid)){
  				el=document.getElementById(elid).style;
  				el.display=(el.display=="") ? "none" : "";
  			}
  		}
  		labimg=document.getElementById("menu"+id).src;
  		labimg=labimg.substring(labimg.lastIndexOf("/")+1, labimg.length);
  		document.getElementById("menu"+id).src=(labimg=="menulab.gif") ? "images/menulabop.gif" : "images/menulab.gif";

  		if((menuopened)&&(menuopened!="")&&(menuopened!=id)){
  		for(i=0;i<num;i++){
  			elid=menuopened+""+i;
  			if(document.getElementById(elid)){
  				el=document.getElementById(elid).style;
  				el.display=(el.display=="") ? "none" : "";
  			}
  		}
  		labimg=document.getElementById("menu"+menuopened).src;
  		labimg=labimg.substring(labimg.lastIndexOf("/")+1, labimg.length);
  		document.getElementById("menu"+menuopened).src=(labimg=="menulab.gif") ? "images/menulabop.gif" : "images/menulab.gif";
  		}

  		if(id==menuopened) menuopened="";
  		else menuopened=id;
  	}
  }
  
  
  

	function menu_svs(id) {

		preload=new Array();
		preload[1]=new Image();
		preload[1].src="/images/menulab.gif";
		preload[2]=new Image();
		preload[2].src="/images/menulabop.gif";
		preload[3]=new Image();
		preload[3].src="/images/submenulab.gif";

		menu_style = document.getElementById("menu"+id).style;
		if (menu_style.display == 'none') {
			menu_style.display = "block";
			document.getElementById("imgmenu"+id).src="/images/menulabop.gif";
		}
		else { 
			menu_style.display = "none";
			document.getElementById("imgmenu"+id).src="/images/menulab.gif";
		}
	}
	
	
	  function resize(img) {
  	newwin=window.open('/admin/cm/_imageop.html','','width=1,height=1,location=no,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=yes');
  	newwin.document.open();
  	newwin.document.write("<html><head><title>Карта проезда</title><meta http-equiv='Content-Type' content='text/html; charset=Windows-1251'><link rel='STYLESHEET' type='text/css' href='styles.css'></head><body bgcolor='#FFFFFF' text='#000000' link='#000000' vlink='#000000' alink='#000000' marginwidth='0' marginheight='0' leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0' onload='resizewin();'>");

  	newwin.document.write("\n<script language='javascript'>\n");
  	newwin.document.write("function resizewin(){\n");
  	newwin.document.write("var i=0;\n");
  	newwin.document.write("if (navigator.appName == 'Netscape') i=40;\n");
  	newwin.document.write("if (document.images[0]) window.resizeTo(document.images[0].width+10, document.images[0].height+30-i);\n");
  	newwin.document.write("window.self.focus();}\n");
  	newwin.document.write("<\/script>\n");

  	newwin.document.write("<center><img src='"+img+"' border='0' alt=''></center>");
  	newwin.document.write("</body></html>");
  	newwin.document.close();
  }