var shorts = {
PH : "právní historie",
O : "občanské právo",
OB : "obchodní právo",
P : "pracovní právo",
R : "rodinné právo",
HP : "hospodářské právo",
Ú : "ústavní právo a státověda",
S : "správní právo",
F : "finanční právo",
T : "trestní právo",
A : "právo duševního vlastnictví (patenty, autorské atd…)",
M : "mezinárodní právo ",
MPS : "mezinárodní právo soukromé",
ŽP : "právo životního prostředí a pozemkové právo",
OS : "ostatní (právní filosofie, sociologie…)",
PSZ : "právo sociálního zabezpečení",
}
var actArticles = []
var authors = []
function showMainSection(sid) {
document.getElementById(sid).style.display = "block"
document.getElementById("tab_" + sid).className = "actual"
if (sid == "browser") {
document.getElementById("searcher").style.display = "none"
document.getElementById("tab_searcher").className = ""
}
else {
document.getElementById("browser").style.display = "none"
document.getElementById("tab_browser").className = ""
}
}
function showSubsection(nodeId) {
var tabs = document.getElementById(nodeId).parentNode.getElementsByTagName("li");
for (var i = 0; i < tabs.length; i++) {
var tid = tabs[i].id
var sid = tid.substring(tid.indexOf("_") + 1);
if (tid == nodeId) {
document.getElementById(tid).className = "actual"
document.getElementById(sid).style.display = "block"
}
else {
document.getElementById(tid).className = ""
document.getElementById(sid).style.display = "none"
}
}
}
/******** vyhledavani, ovladani formulare ******/
function toggleAllCats(){
var list = document.getElementById("search_cats");
var inputs = list.getElementsByTagName("input");
var isChecked = document.getElementById("cats_all").checked;
for (var i = 1; i < inputs.length; i++) {
inputs[i].checked = isChecked;
//if (isChecked)
inputs[i].disabled = isChecked;
}
}
var searchResults = []
function search() {
var sc = {}
sc.author = document.getElementById("search_author").value;
sc.author = sc.author.replace(/\*/g, ".*")
sc.author = sc.author.replace(/\?/g, ".")
sc.title = document.getElementById("search_title").value;
sc.title = sc.title.replace(/\*/g, ".*")
sc.title = sc.title.replace(/\?/g, ".")
sc.publ = document.getElementById("search_publication").value;
sc.from = parseInt(document.getElementById("search_year_from").value);
if (isNaN(sc.from)) sc.from = 1989
sc.to = parseInt(document.getElementById("search_year_to").value );
if (isNaN(sc.to)) sc.to = 1918
sc.cats = [];
if (document.getElementById("cat_ph").checked) sc.cats.push("PH")
if (document.getElementById("cat_a").checked) sc.cats.push("A")
if (document.getElementById("cat_f").checked) sc.cats.push("F")
if (document.getElementById("cat_hp").checked) sc.cats.push("HP")
if (document.getElementById("cat_m").checked) sc.cats.push("M")
if (document.getElementById("cat_mps").checked) sc.cats.push("MPS")
if (document.getElementById("cat_ob").checked) sc.cats.push("OB")
if (document.getElementById("cat_o").checked) sc.cats.push("O")
if (document.getElementById("cat_p").checked) sc.cats.push("P")
if (document.getElementById("cat_psz").checked) sc.cats.push("PSZ")
if (document.getElementById("cat_r").checked) sc.cats.push("R")
if (document.getElementById("cat_s").checked) sc.cats.push("S")
if (document.getElementById("cat_t").checked) sc.cats.push("T")
if (document.getElementById("cat_u").checked) sc.cats.push("Ú")
if (document.getElementById("cat_zp").checked) sc.cats.push("ŽP")
if (document.getElementById("cat_os").checked) sc.cats.push("OS")
sc.langs = [];
if (document.getElementById("lang_cs").checked) sc.langs.push("cze");
if (document.getElementById("lang_sk").checked) sc.langs.push("slo");
if (document.getElementById("lang_pl").checked) sc.langs.push("pol");
if (document.getElementById("lang_de").checked) sc.langs.push("ger");
if (document.getElementById("lang_ru").checked) sc.langs.push("rus");
if (document.getElementById("lang_fr").checked) sc.langs.push("fre");
if (document.getElementById("lang_it").checked) sc.langs.push("ita");
if (document.getElementById("lang_en").checked) sc.langs.push("eng");
searchResults = [];
document.getElementById("results_search").innerHTML = ""
if (sc.publ == "all") {
searchJournals(sc);
searchProcs(sc);
}
if (sc.publ == "s_all") searchProcs(sc);
if (sc.publ == "j_all") searchJournals(sc);
if (sc.publ.charAt(0) == "j" && sc.publ.charAt(2) != "a") {
var index = parseInt(sc.publ.substring(2));
searchJournal(index, sc);
}
if (sc.publ.charAt(0) == "s" && sc.publ.charAt(2) != "a") {
var index = parseInt(sc.publ.substring(2));
searchProc(index, sc);
}
listSearchResults();
}
function searchJournals(sc) {
for (var i = 0; i < casopisy.length; i++)
searchJournal(i, sc)
}
function searchJournal(index, sc) {
var jrnl = casopisy[index]
for (var i = 0; i < jrnl.volumes.length; i++) {
var vol = jrnl.volumes[i];
if (vol.articles && vol.articles.length > 0) {
for (var j = 0; j < vol.articles.length; j++) {
var art = vol.articles[j]
art.j = index;
art.vol = i;
if (checkArticle(art, sc) ) {
searchResults.push(art);
}
}
}
if (vol.issues && vol.issues.length > 0) {
for (var j = 0; j < vol.issues.length; j++) {
for (var k = 0; k < vol.issues[j].articles.length; k++) {
var art = vol.issues[j].articles[k];
art.j = index;
art.vol = i;
art.issue = j;
if (checkArticle(art, sc)) {
searchResults.push(art);
}
}
}
}
}
}
function searchProcs(sc) {
for (var i = 0; i < sborniky.length; i++)
searchProc(i, sc)
}
function searchProc(index, sc) {
var proc = sborniky[index]
for (var i = 0; i < proc.volumes.length; i++) {
var vol = proc.volumes[i];
if (vol.articles && vol.articles.length > 0) {
for (var j = 0; j < vol.articles.length; j++) {
var art = vol.articles[j]
art.p = index;
art.vol = i;
if (checkArticle(art, sc) ) {
searchResults.push(art);
}
}
}
}
if (proc.articles && proc.articles.length > 0) {
for (var j = 0; j < vol.articles.length; j++) {
var art = proc.articles[j]
art.p = index;
if (checkArticle(art, sc) ) {
searchResults.push(art);
}
}
}
}
function checkArticle(art, sc) {
var isOK = true;
var publ = (art.j != undefined) ? casopisy[art.j] : sborniky[art.p]
var fraze = "";
if (sc.author != "" && sc.author != undefined ) {
fraze = new RegExp(sc.author, "i")
if (art.author.join(",").search(fraze) == -1 ) isOK = false;
}
if (sc.title != "") {
fraze = new RegExp(sc.title, "i")
if (art.title.search(fraze) == -1 ) isOK = false;
}
if (sc.cats.length < 15 && art.cats != undefined) {
var hasCat = false;
for (var k = 0; k < sc.cats.length; k++) {
for(l = 0; l < art.cats.length; l++) {
if (sc.cats[k] == art.cats[l]) hasCat = true;
}
}
isOK = (sc.cats.length == 0) ? isOK : isOK && hasCat;
}
if (sc.cats.length > 0 && !art.cats) isOK = false;
var isLang = true;
if (sc.langs.length > 0) {
isLang = false;
for(l = 0; l < sc.langs.length; l++) {
if (sc.langs[l] == art.lang) isLang = true;
}
}
isOK = isOK && isLang;
//if (sc.langs.length > 0 && !art.lang) isOK = false;
//if (sc.cats.length == 0) isOK = true;
var year = publ.volumes[art.vol].year
if (year < sc.from || year > sc.to ) isOK = false;
return isOK;
}
function listSearchResults() {
var vystup = "
Zadaným kritériím nevyhovují žádné články.
"
//vystup += "
Zpět na seznam sborníků
"
// vystup += "
Zpět na seznam roků
"
//vystup += "
Ročník " + actVolume.year + "
"
if (searchResults.length > 0) {
vystup = "
Celkem nalezeno článků: " + searchResults.length + "
"
vystup += "
"
vystup += "
"
vystup += "
"
vystup += "
Autor
"
vystup += "
Název článku
";
vystup += "
Publikace
";
vystup += "
Rok
";
vystup += "
Jazyk
";
//vystup += "
Cats
";
vystup += "
Str.
";
//vystup += "
Str.
";
vystup += "
"
vystup += "
"
for (var i = 0; i < searchResults.length; i++) {
var art = searchResults[i];
var publ = (art.j != undefined) ? casopisy[art.j] : sborniky[art.p]
vystup += "
"
}
var sd = document.getElementById("results_search")
sd.style.display = "block"
sd.innerHTML = vystup
}
function sortResults(prop, asc) {
if (prop == "author") {
searchResults.sort(authorSorter);
if (!asc) searchResults.reverse();
}
if (prop == "pages") {
searchResults.sort(pageSorter);
if (!asc) searchResults.reverse();
}
if (prop == "title") {
searchResults.sort(titleSorter);
if (!asc) searchResults.reverse();
}
if (prop == "publ") {
searchResults.sort(publSorter);
if (!asc) searchResults.reverse();
}
if (prop == "year") {
searchResults.sort(yearSorter);
if (!asc) searchResults.reverse();
}
listSearchResults()
}
function listCitations() {
var vystup = ""
vystup += "
Celkem nalezeno článků: " + searchResults.length + "
"
for (var i = 0; i < searchResults.length; i++) {
var art = searchResults[i];
vystup += createCitation(art)
}
var sd = document.getElementById("results_search")
sd.style.display = "block"
sd.innerHTML = vystup
}
function createCitation(art) {
var vystup = ""
vystup += "
"
if (art.j != undefined) { // clanek v casopisu
var name = art.author[1].toUpperCase() + ", " + art.author[0];
if (art.author.length > 3) {
name += " a " + art.author[2] + " " + art.author[3].toUpperCase()
}
if (name != ", " && name != "-, " ) {
vystup += name;
if (vystup.charAt(vystup.length-1) != "." ) vystup += ".";
vystup += " "
}
vystup += art.title.replace(/\s+$/, "") + ". ";
var publ = casopisy[art.j]
vystup += "" + publ.title + "" + ". "
if (art.vol != undefined) {
var vol = publ.volumes[art.vol]
vystup += vol.year + ", roč. " + vol.no;
if (art.issue != undefined && vol.issues[art.issue] != undefined) {
vystup += ", č. " +vol.issues[art.issue].no
}
vystup += "."
}
var strany = art.pages[0]
if (strany != undefined) vystup += " s. " + strany + "."
//vystup += " s. " + art.pages.join("-") + "."
}
else {
//STEHLIK, Marek a Jarmoir TAUCHEN. NazevClanku. In: NazevSborniku. MistoVydani: Nakladatelstvi, RokVydani, s. 1-100. ISBN 0-1-0-2.
var name = art.author[1].toUpperCase() + ", " + art.author[0];
if (art.author.length > 3) {
name += " a " + art.author[2] + " " + art.author[3].toUpperCase()
}
if (name != ", " && name != "-, " ) {
vystup += name;
if (vystup.charAt(vystup.length-1) != "." ) vystup += ".";
vystup += " "
}
vystup += art.title.replace(/\s+$/, "") + ". ";
var publ = sborniky[art.p]
vystup += "In: " + publ.title + "" + ". "
vystup += publ.town + ": " + publ.publisher
if (art.vol != undefined) {
var vol = publ.volumes[art.vol]
vystup += ", " + vol.year
}
var strany = art.pages[0]
//strany = strany.replace(/\s/g, "")
if (strany != undefined) vystup += ", s. " + strany + "."
}
vystup += "
"
for (var i = half; i < sborniky.length; i++) {
var title = sborniky[i].title;
if (sborniky[i].subtitle) title += ": " + sborniky[i].subtitle
vystup += "
"
if (jr.volumes[volume].articles != undefined) {
for (var i = 0; i < arts.length; i++) {
var art = arts[i];
art.j = actPubl;
art.vol = actVolume;
vystup += "
" ;
}
}
if (letters == "c") {
if (
authors[i].surname.charAt(0).toLowerCase() == "c"
&& authors[i].surname.charAt(1).toLowerCase() != "h"
) {
selAuthors.push(authors[i])
//
}
}
}
var colCount = 6;
var rowCount = Math.ceil(selAuthors.length/colCount)
var vystup = ""
for (var i = 0; i < colCount; i++) {
vystup += ""
for (var j = 0; j < rowCount; j++) {
if (selAuthors[i*rowCount + j] ) {
var author = selAuthors[i*rowCount + j]
vystup += "
" + author.surname + ", " + author.name + "
" ;
}
}
vystup += ""
}
document.getElementById("list_authors").innerHTML = vystup;
}
var authorArticles = [];
function showArticlesByAuthor(sname, fname) {
document.getElementById("alphabet_authors").style.display = "none";
document.getElementById("list_authors").style.display = "none";
authorArticles = [];
for (var i = 0; i < casopisy.length; i++) {
for (var j = 0; j < casopisy[i].volumes.length; j++) {
var volume = casopisy[i].volumes[j];
if (volume.articles != undefined) {
for (var k = 0; k < volume.articles.length; k++) {
var art = volume.articles[k];
if ((art.author[0].toLowerCase() == fname.toLowerCase() && art.author[1] == sname) ||
(art.author.length > 2 && art.author[2].toLowerCase() == fname.toLowerCase() && art.author[3] == sname))
authorArticles.push(art);
art.j = i;
art.vol = j;
}
}
if (volume.issues != undefined) {
for (var k = 0; k < volume.issues.length; k++) {
for (var l=0; l < volume.issues[k].articles.length; l++) {
var art = volume.issues[k].articles[l];
if ( (art.author[0].toLowerCase() == fname.toLowerCase() && art.author[1] == sname) ||
(art.author.length > 2 && art.author[2].toLowerCase() == fname.toLowerCase() && art.author[3] == sname)
) authorArticles.push(art);
art.j = i;
art.vol = j;
art.issue = k;
}
}
}
}
}
for (var i = 0; i < sborniky.length; i++) {
for (var j = 0; j < sborniky[i].volumes.length; j++) {
var volume = sborniky[i].volumes[j];
if (volume.articles != undefined) {
for (var k = 0; k < volume.articles.length; k++) {
var art = volume.articles[k];
if ((art.author[0].toLowerCase() == fname.toLowerCase() && art.author[1] == sname) ||
(art.author.length > 2 && art.author[2].toLowerCase() == fname.toLowerCase() && art.author[3] == sname))
authorArticles.push(art);
art.p = i;
art.vol = j;
}
}
}
}
listAuthorResults()
}
function sortAuthResults(prop, asc) {
if (prop == "author") {
authorArticles.sort(authorSorter);
if (!asc) authorArticles.reverse();
}
if (prop == "pages") {
authorArticles.sort(pageSorter);
if (!asc) authorArticles.reverse();
}
if (prop == "title") {
authorArticles.sort(titleSorter);
if (!asc) authorArticles.reverse();
}
if (prop == "publ") {
authorArticles.sort(publSorter);
if (!asc) authorArticles.reverse();
}
if (prop == "year") {
authorArticles.sort(yearSorter);
if (!asc) authorArticles.reverse();
}
listAuthorResults()
}
function listAuthCitations() {
var vystup = ""
vystup += ""
vystup += "
Celkem nalezeno článků: " + authorArticles.length + "
"
for (var i = 0; i < authorArticles.length; i++) {
var art = authorArticles[i];
vystup += createCitation(art)
}
var sd = document.getElementById("results_authors")
sd.style.display = "block"
sd.innerHTML = vystup
}
function listAuthorResults() {
var vystup = ""
//vystup += "
Celkem nalezeno článků: " + authorArticles.length + "
"
vystup += "
"
vystup += "
"
vystup += "
"
vystup += "
Autor
"
vystup += "
Název článku
";
vystup += "
Publikace
";
vystup += "
Rok
";
vystup += "
Jazyk
";
//vystup += "
Cats
";
vystup += "
Str.
";
//vystup += "
Str.
";
vystup += "
"
vystup += "
"
for (var i = 0; i < authorArticles.length; i++) {
var art = authorArticles[i];
var publ = (art.j != undefined) ? casopisy[art.j] : sborniky[art.p]
vystup += "