
var popupWindow = null;

function popup(url,width,height) {

 if(popupWindow!=null)
  {
  if (typeof(popupWindow) == "object")
   popupWindow.close();
//   popupWindow = null;
  }
        var width=width;
        var height=height;
        var top  = (screen.height - height) / 2;
        var left = (screen.width  - width)  / 2;
        $popup='popup'+width+'x'+height;
    popupWindow = window.open(url,$popup,'toolbar=no,menubar=no,scrollbars=no,resize=no,titlebar=no,resizable=no,width='+width+',height='+height+',top='+top+',left='+left+'');
        popupWindow.focus();
}

function showsel(obj,name,arr_id) {
 var id;
//		  alert(arr_id.length);
    for(j=0; j< arr_id.length; j++){
 document.getElementById(name+arr_id[j]).style.display='none';
 }
 id=obj.options[obj.selectedIndex].value;
 document.getElementById(name+id).style.display='';
 document.getElementById('sel'+name+id).click();
}

function show_hide(el)
 {
 	if(document.getElementById('div_'+el).style.display == "") {
//		document.getElementById(el).className="menu";
//		document.getElementById('td_'+el).className="";
		document.getElementById('sub_'+el).src="/img/plus.gif";
		document.getElementById('sub_'+el).alt="Раскрыть подменю";
		document.getElementById('div_'+el).style.display="none";
	} else {
	    document.getElementById(el).className="menuact";
//		document.getElementById('td_'+el).className="submenu";
		document.getElementById('sub_'+el).src="/img/minus.gif";
		document.getElementById('sub_'+el).alt="Свернуть подменю";
		document.getElementById('div_'+el).style.display="";
	}
 }


