
function popup(theURL,winName,features)
{
navgtr = window.open(theURL,winName,features);
navgtr.focus();
}

window.onerror = null;

rollmenu = {
    img_path     : "/i/",
    img_menu_dir : "menu",
    img_ext      : ".gif",
    r_img_suffix : "__",
    a_img_suffix : "_",
    preload : function (file){
      var image = new Image();
      image.src = rollmenu.img_path + rollmenu.img_menu_dir + "/" + file + rollmenu.img_ext;
    },
    s : function(e){
      var el = window.event ? window.event.srcElement : e.currentTarget;
      el.src = el.rollsrc;
    },
    h : function(e){
      var el = window.event ? window.event.srcElement : e.currentTarget;
      el.src = el.defsrc;
    },
    init : function(){
      if (document.images){
        var img_item = r = null;
        var str = rollmenu.img_menu_dir + "\\/(\\w+)\\" + rollmenu.img_ext;
        var re = new RegExp(str, "i");
        var rexp = new RegExp (rollmenu.img_ext + "$","");
        for (var i = 0; (img_item = document.getElementsByTagName("img").item(i)); i++){
          r = img_item.src.match(re);
          if (!r) continue;
          if (img_item.getAttribute("links") && document.location.pathname.match(new RegExp(img_item.getAttribute("links"), "i"))){
            img_item.src = img_item.src.replace(new RegExp(rollmenu.img_ext), rollmenu.a_img_suffix + rollmenu.img_ext);
          } else {
            rollmenu.preload(r[1] + rollmenu.a_img_suffix);
            rollmenu.preload(r[1] + rollmenu.r_img_suffix);
            img_item.rollsrc = img_item.src.replace(rexp, rollmenu.r_img_suffix + rollmenu.img_ext);
            img_item.defsrc = img_item.src;
            rollmenu.l(img_item,"mouseover", rollmenu.s);
            rollmenu.l(img_item,"mouseout", rollmenu.h);
          }
        }
      }
    },
    l : function(o, e, a){
      if (o.addEventListener) return o.addEventListener(e, a, false);
      else if (o.attachEvent) return o.attachEvent("on" + e, a);
      else return false;
    }
}

rollmenu.l(window.addEventListener || window.attachEvent ? window : document.addEventListener ? document : null, "load", rollmenu.init);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function sw() {
	var ind=document.all.item('bxod').alt;
	if (ind == "Свернуть") {
		document.all.item('d').style.display='none';
		document.all.item('bxod').src='../i/login.gif';
		document.all.item('bxod').alt='Развернуть';
	}
	else {
		document.all.item('d').style.display='none';
		document.all.item('bxod').src='../i/login.gif';
		document.all.item('bxod').alt='Развернуть';

		document.all.item('d').style.display='block';
		document.all.item('bxod').src='../i/login.gif';
		document.all.item('bxod').alt='Свернуть';
	}
}

function openPicture(src, alt, width, height)
{
var img = "<img src='" + src + "' height='" + height + "' width='" + width + "' alt='" + alt + "'>";
var body = "<html>\n<head>\n<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>\n<title>" + alt + "</title>\n</head>\n\n<body leftmargin='0' topmargin='0' marginheight='0' marginwidth='0' onload='focus()' onclick='window.close()'>\n" + img + "\n</body>\n</html>";
var params = "width=" + width + ",height=" + height + ",status=no,toolbar=no,menubar=no,scrollbar=yes";
PictureWindow = open("", "_blank", params);
PictureWindow.document.write(body);
PictureWindow.document.close();
}
