function c_submit(page,action,actionid,are_you){
  if(are_you && !confirm('Are you sure ?!!')){
    return;

  }
  if(page!='')document.forms.mainform.c_page.value=page;
  if(action!=''){
    document.forms.mainform.c_action.value=action;
  }else{
    document.forms.mainform.c_action.value='show';
  }
  if(actionid)document.forms.mainform.c_actionid.value=actionid;
  document.forms.mainform.submit();
}

function isempty(nr){
  var str;
  str='menu_'+nr;
  return document.getElementById(str).value.length;
}

function oc_menu(wich){
  if(document.forms.mainform.menu.value==wich){
    document.forms.mainform.menu.value=0;
    c_submit('menusave','',wich);
  }else{
    document.forms.mainform.menu.value=wich;
    c_submit('menuedit','',wich);
  }
}


function ShowHide(id,nr,obj){
var mydivs= new Array('nyitott','csukott');
var str;
           for(var i=0;i<2;i++){
              str=mydivs[i]+'_'+nr+'_'+obj;
              if(id!=i){
                  document.getElementById(str).style.display='none';
              }else{
                  document.getElementById(str).style.display='block';
              }
           }
}
function open_m(nr,text){
var str;
var str2;
  str='menu'+nr;
  //str2='menu'+document.forms.mainform.m_id.value;
  //document.getElementById('fejlec').innerHTML=text;
  //document.getElementById(str2).style.display=='none';
  if(document.getElementById(str)==null)return;
  if(document.getElementById(str).style.display=='block'){
    document.getElementById(str).style.display='none';
    document.forms.mainform.m_id.value='';
  }else{
    document.getElementById(str).style.display='block';
    document.forms.mainform.m_id.value=nr;
  }
}




