function CheckAll2(ch,i)
{
					var a;
					for(j=0;j<=i;j++)
						{   a = document.getElementById(j);
							if(a != null ) a.checked=ch.checked;
				       	}

}
function CheckAll1(ch)
{
window.close();
}

function popup_picture(url,width,height) {
 picwin=window.open("", "new", "width="+width+",height="+height+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1");
 picwin.document.open();
 picwin.document.writeln("<html><head><title>Картинка</title></head><body bgcolor=#ffffff>");
 picwin.document.writeln("<table width=100% height=100% border=0><tr><td align=center valign=middle><img src='"+url+"'></td></tr></table>");
 picwin.document.writeln("</body></html>");
 picwin.document.close();
 picwin.window.focus();
}

function popup_printnews(id,width,height) {
 picwin=window.open("/news/print.html?id="+id, "", "width="+width+",height="+height+",toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1");
}

var IE = (navigator.appName == "Microsoft Internet Explorer") ? 1 : 0; 
var NS = (navigator.appName == "Netscape") ? 1 : 0; 

isDOM=document.getElementById;
isMSIE=document.all && document.all.item;
isNetscape4=document.layers;
isOpera=window.opera;
isOpera5=isOpera && isDOM;
isMSIE5=isDOM && isMSIE;
isMozilla=isNetscape6=isDOM && (navigator.appName=="Netscape");

function getForIeX(El) { 
var X = 0; 
do { X += El.offsetLeft } while ((El = El.offsetParent) != null); 
return X; 
} 

function getForIeY(El) { 
var Y = 0; 
do { Y += El.offsetTop } while ((El = El.offsetParent) != null); 
return Y; 
} 

function ShowX(Num){ 
// if(IE) return getForIeX(document.getElementById(Num));
 if(isMSIE || isOpera || isNetscape6) return getForIeX(document.getElementById(Num));
 if(NS) return document.images[Num].x;
 return -1;
} 

function ShowY(Num){ 
// if(IE) return getForIeY(document.getElementById(Num));
 if(isMSIE || isOpera || isNetscape6) return getForIeY(document.getElementById(Num));
 if(NS) return document.images[Num].y;
 return -1;
} 

var over_menu=new Array();
var over_pmenu=new Array();
var menu_items=new Array(); 

for(i=1;i<=10;i++) {
  over_menu[i]=0;
  over_pmenu[i]=0;
  menu_items[i]=0;
} 


function getlayer(layerName) {
  if(document.getElementById) return document.getElementById(layerName); 
  if(document.all) return document.all[layerName];
  if(document.layers) return document.layers[layerName];
  return null;
}

function createlayer(layerName,layerId,layerBody) {
  if(isMSIE || isOpera || isNetscape6) {
   document.write('<div id="'+layerName+'" style="position:absolute;top:0;left:0;width:175;visibility:hidden;filter:alpha(opacity=100);z-index:5;" onmouseover="over_pmenu['+layerId+']=1;" onmouseout="chM('+layerId+',0);over_pmenu['+layerId+']=0;">'+layerBody+'</div>');
  }
  if(isNetscape4) {
//   document.write("<layer id='"+layerName+"' top=0 left=0 visibility='hide'  onmouseover='over_pmenu["+layerId+"]=1;' onmouseout='chM("+layerId+",0);over_pmenu["+layerId+"]=0;'><table border=0 cellpadding=0 cellspacing=0><tr><td rowspan=3 width=24 valign=top><img src=img/lmenu/l-llt.gif></td><td colspan=2 height=6 align=right background=img/lmenu/l-tbg.gif><img src=img/lmenu/l-rt.gif></td><td width=7 height=6 align=right><img src=img/lmenu/l-rrt.gif></td></tr><tr><td width=5 bgcolor=#ffffff><img src=img/_bl.gif></td><td bgcolor=#ffffff class=wm><div style='padding-left:5px;padding-right:4px;padding-top:8px;padding-bottom:3px;'>"+layerBody+"</div></td><td width=7 background=img/lmenu/l-rm.gif><img src=img/_bl.gif></td></tr><tr><td width=5 height=7 align=left><img src=img/lmenu/l-lb.gif></td><td height=7 background=img/lmenu/l-bbg.gif><img src=img/_bl.gif></td><td width=7 height=7 align=right><img src=img/lmenu/l-rb.gif></td></tr></table></layer>");
   document.write("<layer id='"+layerName+"' top=0 left=0 visibility='hide'  onmouseover='over_pmenu["+layerId+"]=1;' onmouseout='chM("+layerId+",0);over_pmenu["+layerId+"]=0;'>"+layerBody+"</layer>");
  }
}

function chM(id,mode) {
  if(mode) eval("setTimeout(\"pmon("+id+");\",0)");
  else eval("setTimeout(\"pmoff("+id+");\",0)");
}                                          

function pmon(id) {
  if(over_menu[id]) {
    var d=getlayer('pmenu'+id);
    if(isMSIE || isOpera || isNetscape6){ d.style.visibility='visible'; }
    if(isNetscape4) d.visibility='show';
      document.getElementById("ID_MENU_ITEM"+id).style.backgroundColor="#828687";
      document.getElementById("ID_MENU_ITEM_LED"+id).style.backgroundColor="#828687";
      if(document.images)
        document["MENU_ITEM_LED_IMG"+id].src="images/pimporange.gif";
  }
}
 
function pmoff(id) {
  if(!over_pmenu[id]&&!over_menu[id]) {
    var d=getlayer('pmenu'+id);
    if(isMSIE || isOpera || isNetscape6) d.style.visibility='hidden';
    if(isNetscape4) d.visibility='hide';
      document.getElementById("ID_MENU_ITEM"+id).style.backgroundColor="#E6E7E7";
      document.getElementById("ID_MENU_ITEM_LED"+id).style.backgroundColor="#E6E7E7";
      if(document.images)
        document["MENU_ITEM_LED_IMG"+id].src="images/empty.gif";
  }
}

function chI(key,mode) {

  if(mode=='on') {
    if(menu_items[key]==1) {
      var d=getlayer('pmenu'+key);
      if(isMSIE || isNetscape6) {
        d.style.left=ShowX("ID_MENU_ITEM"+key)+173;
        d.style.top=ShowY("ID_MENU_ITEM"+key);
      }
      if(isNetscape4) {
        d.top=ShowY("coord"+key);
        d.left=ShowX("coord"+key)+173;
      }
      chM(key,1);
      over_menu[key]=1;
    }
    else {
      document.getElementById("ID_MENU_ITEM"+key).style.backgroundColor="#828687";
      document.getElementById("ID_MENU_ITEM_LED"+key).style.backgroundColor="#828687";
      if(document.images)
        document["MENU_ITEM_LED_IMG"+key].src="images/pimporange.gif";
    }
  }
  else {
    if(menu_items[key]==1) {
      chM(key,0);
      over_menu[key]=0;
    }
    else {
      document.getElementById("ID_MENU_ITEM"+key).style.backgroundColor="#E6E7E7";
      document.getElementById("ID_MENU_ITEM_LED"+key).style.backgroundColor="#E6E7E7";
      if(document.images)
        document["MENU_ITEM_LED_IMG"+key].src="images/empty.gif";
    }
  }
}
function switch_info(elm,id){
td = document.getElementById(id);
if(td.style.display == "none"){
   td.style.display = "block";
   elm.innerHTML = " &mdash; ";
}else{
   td.style.display = "none";
   elm.innerText = " + ";
};
};
