// JavaScript Document
//============================obsługa kategorii aktualności===================
var people = new People(reviewCallback);

//============================obsługa programu================================
function standard_people_perform(result){
	hideloading();
	if (result == '0') showpeople(category, order, search_);
	else alertmsg(result);
}
function loadpeoplegallery(){
	showpeople(category, order, search_);
}
function showpeople(cat, ord, ser, ret){
	if (action != people_action){
		action = people_action;
		resetvariables();
	}
	else {
		category = cat;
		order = ord;
		search_ = ser;
	}
	action = people_action;
	showloading();
	people.showpeople(category, order, search_, ret);
}
function jmpshowpeople(jmp, cat, ord, ser, ret){
	category = cat;
	order = ord;
	search_ = ser;
	action = people_action;
	showloading();
	people.jmpshowpeople(jmp, category, order, search_, ret);
}
function showpeople_reload(cat){
	showloading();
	category = cat;
	people.showpeople_reload(cat);
}
function showpeople_find(){
	showpeople(category, order, $('search_us').value);
}
function addpeople(ret){
	showloading();
	people.addpeople(ret);
}
function doaddpeople(form){
	showloading();
	people.doaddpeople(getPayload(form));
}
function lockpeople(id){
	showloading();
	people.lockpeople(id);
}
function unlockpeople(id){
	showloading();
	people.unlockpeople(id);
}
function editpeople(id, ret){
	showloading();
	people.editpeople(id, ret);
}
function doeditpeople(form){
	showloading();
	people.doeditpeople(getPayload(form));
}
function rempeople(id){
	var answer = confirm("Na pewno chcesz usunąć osobę?");
	if (answer){
		showloading();
		people.rempeople(id);
	}
}
