function fo(id){return document.getElementById(id)}

function hide_child(obj){
  for(i=0;i<obj.items.length;i++){
    obj_item = obj.items[i];
	for(j=0;j<obj.items.length;j++)     
      obj.items[i].hide();
  }
}

function hideAndShow(hide_obj,show_obj){
  hide_obj.hide();
  show_obj.show();
}
  
function change_view(obj){
  if (obj.isVisible()){ 
    obj.hide();
	obj.style.position="absolute";
  }
  else{
    obj.style.position="relative";
    obj.show();
  }
}

function m_menu_item_show_active(obj,color){
  obj=layer(obj);
  obj.setBgColor(color);
  active_element=true;
}

function m_menu_item_show_not_active(obj,color){
  temp=new layer(obj);
  temp.setBgColor(color);
  active_element=false;
  d=new Date();
  last_menu_action=d.getTime();
}

function check_stars(obj,pos,form){
  if (form) e=form.elements;
  else e=obj.form.elements;
  nd=0;
  ch=0;
  for(i=0;i<e.length;i++){
    if (e[i].name=="stars["+pos+"]"){
	  if (e[i].value==2) {
	    if (stars[obj.value][2]){
		  e[i].disabled=false;
		  nd=e[i];
		} else {
		  e[i].disabled=true;
		  if (e[i].checked) ch=e[i];
		}
	  }
	  if (e[i].value==3) {
	    if (stars[obj.value][3]){
		  e[i].disabled=false;
		  nd=e[i];
	    } else {
		  e[i].disabled=true;
		  if (e[i].checked) ch=e[i];
		}
	  }
	  if (e[i].value==4) {
	    if (stars[obj.value][4]){
		  e[i].disabled=false;
		  nd=e[i];
	    } else {
		  e[i].disabled=true;
		  if (e[i].checked) ch=e[i];
		}
	  }
	  if (e[i].value==5) {
	    if (stars[obj.value][5]){
		  e[i].disabled=false;
		  nd=e[i];
	    } else {
		  e[i].disabled=true;
		  if (e[i].checked) ch=e[i];
		}
	  }
	}
  }
  if (ch.disabled) nd.checked=true; 
}
function pic(imgurl,wid,heg,alt) {
	wtop = (screen.height/2-heg/2);
	wleft = (screen.width/2-wid/2);
	blank = window.open('','_blank','status=0,width='+ wid +',height='+ heg +',top=' + wtop + ',left='+ wleft);
	page =	 '<html><head><title>'+ alt +'</title></head><body style="padding:0;margin:0; background:#6E849B 50% 50% no-repeat">'+
			 '<img alt="Кликните, чтобы закрыть" src="' + imgurl +'" width="'+ wid +'" height="'+ heg +'" style="cursor:pointer;cursor:hand" onclick="self.close()" />'+
			 '</body></html>';
	blank.document.open();
	blank.document.write(page);
	blank.document.close();
	return false;
}

