function showMainContent(content_id,cat_id)
{
  if(content_id == -1) return;
  window.location = "index.php?command=hideall_content;menu:show_content_maincategorybox;menu:setmaincategory_"+cat_id+";editor:show_content_preview;editor:setcontent_"+content_id;
}

function nop()
{
}

function gallery_enter()
{
  window.location = "index.php?command=hideall_content,picturegallery:show_content_default";
}

function showContent(content_id,menu_id)
{
  window.location = "index.php?command=hideall_content;menu:setcategory_"+menu_id+";editor:show_content_preview;editor:setcontent_"+content_id;
}
function showContent2(content_id)
{
  window.location = "index.php?command=hideall_content;editor:show_content_preview;editor:setcontent_"+content_id;
}
function goto_gallery(id)
{
	window.location="index.php?command=hideall_content;picturegallery:show_content_gallery;picturegallery:set_"+id;
}

function showWeekProg()
{
    window.location = "index.php?command=hideall_content;program:show_content_default";
}

function showLink(cat_id)
{
    window.location = "index.php?command=hideall_content;link:setcategory_"+cat_id+";link:show_content_default;";
}
function showtoplist(cat_id)
{
    window.location = "index.php?command=hideall_content;toplist:setcategory_"+cat_id+";toplist:show_content_default;";
}

function showdownload()
{
    window.location = "index.php?command=hideall_content;download:show_content_default;";
}

function showNews(cat_id)
{
    if(cat_id == 6)
      window.location = "index.php?command=hideall_content;news:setcategory_"+cat_id+";news:initnav;news:show_content_default";
    else
      window.location = "index.php?command=hideall_content;news:setcategory_"+cat_id+";news:initnav;news:show_content_default;navigation:show_content_default;";
}


function showNewsDetail(id)
{
    window.location = "index.php?command=hideall_content;news:setitem_"+id+";news:show_content_detailed;";
}

function showAlbumDetail(id)
{
    window.location = "index.php?command=hideall_content;album:setitem_"+id+";album:show_content_default;";
}

function showEvent(cat_id)
{
    window.location = "index.php?command=hideall_content;event:setcategory_"+cat_id+";event:show_content_default;event:setint_1";
}
function showAllEvent(cat_id)
{
    window.location = "index.php?command=hideall_content;event:setcategory_"+cat_id+";event:show_content_default;event:setint_4";
}



function editContent(id)
{
    var u = "index.php?command=style:editor;hideall;editor:show_content_editor;editor:setcontent_"+id+";&popup=1"

    window.open(u,'editor','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=100,left=100,width=838,height=600');
}



function saveContent()
{
  document.editorform.style_a.value = styleArray;
  document.editorform.submit();
}

function changeContent()
{
  document.content.command.value = "editor:changecontent";
  document.content.submit();
}

function newContent()
{
  if(document.content.content_name.value == "") return;
  document.content.command.value = "content:newcontent";
  document.content.submit();
}

function modContent(id)
{
  if(document.content.content_name.value == "") return;
  document.content.command.value = "content:modify_"+id;
  document.content.submit();

}

function delContent(id)
{
  window.location = "index.php?command=content:del_"+id;
}

function changeGallery()
{
  document.gallery.command.value = "picturegallery:changegallery";
  document.gallery.submit();
}

function newGallery()
{
  if(document.gallery.gallery_name.value == "") return;
  document.gallery.command.value = "picturegallery:newgallery";
  document.gallery.submit();
}

function modGallery(id)
{
  if(document.gallery.gallery_name.value == "") return;
  document.gallery.command.value = "picturegallery:modify_"+id;
  document.gallery.submit();

}

function delGallery(id)
{
  window.location = "index.php?command=picturegallery:del_"+id;
}


function showGallery(id)
{
    var u = "index.php?command=style:popup;hideall;picturegallery:show_content_gallery;picturegallery:set_"+id+";&popup=1"

    window.open(u,'gallery','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=100,left=100,width=760,height=510');
}


function changeLink()
{
  document.link.command.value = "link:changelink";
  document.link.submit();
}

function newLink()
{
  document.link.command.value = "link:newlink";
  document.link.submit();
}
function changetoplist()
{
  document.toplist.command.value = "toplist:changetoplist";
  document.toplist.submit();
}

function newtoplist()
{
  document.toplist.command.value = "toplist:newtoplist";
  document.toplist.submit();
}

function changedownload()
{
  document.download.command.value = "download:changedownload";
  document.download.submit();
}

function newdownload()
{
  document.download.command.value = "download:newdownload";
  document.download.submit();
}

function changeNews()
{
  document.news.command.value = "news:changenews";
  document.news.submit();
}

function newNews()
{
  document.news.command.value = "news:newnews";
  document.news.submit();
}

function newProgram()
{
  document.program.command.value = "program:newprogram";
  document.program.submit();
}

function delProgram(id)
{
  document.program.command.value = "program:del_"+id;
  document.program.submit();
}

function modLink(id)
{
  document.link.command.value = "link:modify_"+id;
  document.link.submit();
}
function modtoplist(id)
{
  document.toplist.command.value = "toplist:modify_"+id;
  document.toplist.submit();
}
function moddownload(id)
{
  document.download.command.value = "download:modify_"+id;
  document.download.submit();
}
function modNews(id)
{
  document.news.command.value = "news:modify_"+id;
  document.news.submit();
}

function delNews(id)
{
  window.location = "index.php?command=news:del_"+id;
}

function delLink(id)
{
  window.location = "index.php?command=link:del_"+id;
}

function showLink(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;link:show_content_default;link:setcategory_"+id;
}
function deltoplist(id)
{
  window.location = "index.php?command=toplist:del_"+id;
}

function showtoplist(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;toplist:show_content_default;toplist:setcategory_"+id;
}
function deldownload(id)
{
  window.location = "index.php?command=download:del_"+id;
}

function showdownload(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;download:show_content_default;download:setcategory_"+id;
}

function changeOrganization()
{
  document.organization.command.value = "organization:changeorganization";
  document.organization.submit();
}

function newOrganization()
{
  document.organization.command.value = "organization:neworganization";
  document.organization.submit();
}

function modOrganization(id)
{
  document.organization.command.value = "organization:modify_"+id;
  document.organization.submit();

}

function delOrganization(id)
{
  window.location = "index.php?command=organization:del_"+id;
}

function showOrganization(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;organization:show_content_default;organization:setcategory_"+id;
}

function changeInstitution()
{
  document.institution.command.value = "institution:changeinstitution";
  document.institution.submit();
}

function newInstitution()
{
  document.institution.command.value = "institution:newinstitution";
  document.institution.submit();
}

function modInstitution(id)
{
  document.institution.command.value = "institution:modify_"+id;
  document.institution.submit();

}

function delInstitution(id)
{
  window.location = "index.php?command=institution:del_"+id;
}

function showInstitution(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;institution:show_content_default;institution:setcategory_"+id;
}

function changeEvent()
{
  document.event.command.value = "event:changeevent";
  document.event.submit();
}

function newEvent()
{
  document.event.command.value = "event:newevent";
  document.event.submit();
}

function modEvent(id)
{
  document.event.command.value = "event:modify_"+id;
  document.event.submit();

}

function delEvent(id)
{
  window.location = "index.php?command=event:del_"+id;
}

function showEvent(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;event:show_content_default;event:setcategory_"+id;
}



function changeReport()
{
  document.report.command.value = "report:changereport";
  document.report.submit();
}

function newReport()
{
  document.report.command.value = "report:newreport";
  document.report.submit();
}

function modReport(id)
{
  document.report.command.value = "report:modify_"+id;
  document.report.submit();

}

function delReport(id)
{
  window.location = "index.php?command=report:del_"+id;
}

function showReport(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;report:show_content_default;report:setcategory_"+id;
}

function changeInformation()
{
  document.information.command.value = "information:changeinformation";
  document.information.submit();
}

function newInformation()
{
  document.information.command.value = "information:newinformation";
  document.information.submit();
}

function modInformation(id)
{
  document.information.command.value = "information:modify_"+id;
  document.information.submit();

}

function delInformation(id)
{
  window.location = "index.php?command=information:del_"+id;
}

function showInformation(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;information:show_content_default;information:setcategory_"+id;
}



function changeEducation()
{
  document.education.command.value = "education:changeeducation";
  document.education.submit();
}

function newEducation()
{
  document.education.command.value = "education:neweducation";
  document.education.submit();
}

function modEducation(id)
{
  document.education.command.value = "education:modify_"+id;
  document.education.submit();

}

function delEducation(id)
{
  window.location = "index.php?command=education:del_"+id;
}

function showEducation(id)
{
  window.location = "index.php?command=hideall_content;menu:show_content_categorybox;education:show_content_default;education:setcategory_"+id;
}



function newPicture()
{
  var v = "";
  var e = 0;
  if(document.picture.picture.value == "")  { v = "Adja meg a feltĂ¶lteni kĂ­vĂˇnt kĂ©pet!"; e = 1; }
  if(document.picture.picture_descr.value == "") { if(e == 1) {v += "\n"}; v += "Adja meg a kĂ©palĂˇĂ­rĂˇst!"; }
  if(e == 1) { alert(v); return }

  document.picture.command.value = "picturegallery:upload";
  document.picture.submit();

}

function delPicture(id)
{
  document.picture.command.value = "picturegallery:delpicture_"+id;
  document.picture.submit();
}


function goLevel(id_category, level)
{
  if(level == "") window.location =  "index.php?command=hideall_content;content:show_content_contentlist;content:setcategory_"+id_category
	if(level == 2) window.location =  "index.php?command=hideall_content;content:show_content_contentlist"+level+";content:setcategory_"+id_category
	if(level == 3) window.location =  "index.php?command=hideall_content;content:show_content_contentlist"+level+";content:setsubcategory_"+id_category

}

function authorize(id, t)
{
if(t == 1)   window.location =  "index.php?command=content:authorize_"+id;
else         window.location =  "index.php?command=content:cancel_"+id;
}

function authorizeEducation(id, t)
{
if(t == 1)   window.location =  "index.php?command=education:authorize_"+id;
else         window.location =  "index.php?command=education:cancel_"+id;
}

function authorizeInformation(id, t)
{
if(t == 1)   window.location =  "index.php?command=information:authorize_"+id;
else         window.location =  "index.php?command=information:cancel_"+id;
}

function authorizeReport(id, t)
{
if(t == 1)   window.location =  "index.php?command=report:authorize_"+id;
else         window.location =  "index.php?command=report:cancel_"+id;
}

function showRequest()
{
  window.location =  "index.php?command=hideall_content;request:show_content_admin";
}
function showSzieszta()
{
  window.location =  "index.php?command=hideall_content;szieszta:show_content_admin";
}
function showBday()
{
  window.location =  "index.php?command=hideall_content;bday:show_content_admin";
}
function showOf()
{
  window.location =  "index.php?command=hideall_content;of:show_content_admin";
}
function showWish()
{
  window.location =  "index.php?command=hideall_content;wish:show_content_admin";
}

function showMix()
{
  window.location =  "index.php?command=hideall_content;mix:show_content_admin";
}

function showStatic(t,menu_id)
{
  window.location = "index.php?command=hideall_content;menu:setcategory_"+menu_id+";static:show_content_default;static:setpage_"+t+";";
}
function showStatic2(t)
{
  window.location = "index.php?command=hideall_content;static:show_content_default;static:setpage_"+t+";";
}


function ifEnter(field,event,actionstring) {
  var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
  if (theCode == 13){
    eval(actionstring);
    return false;
  }
  else
  return true;
}

