/* vk-conf: */

/*
Syntaxprüfung mit jslint:
java -cp jslint/rhino-1.7.jar \
  org.mozilla.javascript.tools.shell.Main jslint/jslint.js vk-conf.js
*/

/*jslint newcap: false */
/*global $: false, alert: false
 */


/*
nach index.html verlegt:
var vkConfMatViewEnable = function () {
    //return (true);
    return (false);
};
*/


var vkStyles = null;


var vkConfMatsDefault = function () {
    return ([]);
};


var vkConfDatesY = function () {
    return ('y');
};


var vkConfDatesYI = function () {
    return ('yi');
};


var vkConfMatsPica = function () {
    return (['book', 'periodical', 'olper', 'binary', 'article']);
};


var vkConfIqUrl = function (catId) {
    var fach = (catId === 'iqA') ? 'alle'
    : (catId === 'iqKMW') ? 'medien'
    : (catId === 'iqT') ? 'theater'
    : (catId === 'iqF') ? 'film' : '';
    return ('/internetquellen/LuceneQuery/domain=' + fach);
};


var vkConfHitFieldsDefault = function () {
    return ([['title', 'Titel'],
             //['subtitle', 'Untertitel'],
             ['au', 'Autor'],
             ['author', 'Autor'],
             /*
             ['beteiligt', 'Beteiligt', {isSearchLink: true,
                                         internal: true,
                                         searchAttr: "all",
                                         pName: "{(.*?)}",
                                         pVal: "^(\\S+)"}],
             */
             ['beteiligt', 'Beteiligt', {isSearchLink: true,
                                         searchAttr: "person",
                                         pRm: '\\s*\\[.*?\\]'}],
             ['periodical', 'Zeitschrift'],
             ['place', 'Verlagsort'],
             ['pub', 'Verlag'],
             ['date', 'Erscheinungsjahr'],
             ['umfang', 'Umfang'],
             ['remark', 'Anmerkung'],
             ['hochschulschrift', 'Hochschulschrift'],
             ['in2', 'In', {isSearchLink: true,
                            internal: true,
                            searchAttr: "all",
                            pName: "{(.*?)}",
                            pVal: "^(\\S+)"}],
             ['chronLink', 'Frühere/Spätere Titel', {isSearchLink: true,
                                                     internal: true, 
                                                     searchAttr: "all",
                                                     pName: "{(.*?)}",
                                                     pVal: "^(\\S+)"}],
             ['horzLink', 'Weitere Titelhinweise', {isSearchLink: true,
                                                    internal: true,     
                                                    searchAttr: "all",
                                                    pName: "{(.*?)}",
                                                    pVal: "^(\\S+)"}],
             ['isbn', 'ISBN'],
             ['issn', 'ISSN'],
             ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
             ['toc', 'Hinweise zum Inhalt', {isExtLink: true,
                                             name: 'Inhaltsverzeichnis'}],
             ['abstract', 'Abstract']]);
};


var vkConfHitFieldsNat = function () {
    return ([['title', 'Titel'],
             //['subtitle', 'Untertitel'],
             ['au', 'Autor'],
             ['author', 'Autor'],
             /*
             ['beteiligt', 'Beteiligt', {isSearchLink: true,
                                         internal: true,
                                         searchAttr: "all",
                                         pName: "{(.*?)}",
                                         pVal: "^(\\S+)"}],
             */
             ['beteiligt', 'Beteiligt', {isSearchLink: true,
                                         searchAttr: "person",
                                         pRm: '\\s*\\[.*?\\]'}],
             ['periodical', 'Zeitschrift'],
             ['place', 'Verlagsort'],
             ['pub', 'Verlag'],
             ['date', 'Erscheinungsjahr'],
             ['umfang', 'Umfang'],
             ['remark', 'Anmerkung'],
             ['hochschulschrift', 'Hochschulschrift'],
             ['in2', 'In', {isSearchLink: true,
                            internal: true,
                            searchAttr: "all",
                            pName: "{(.*?)}",
                            pVal: "^(\\S+)"}],
             ['chronLink', 'Frühere/Spätere Titel', {isSearchLink: true,
                                                     internal: true,     
                                                     searchAttr: "all",
                                                     pName: "{(.*?)}",
                                                     pVal: "^(\\S+)"}],
             ['horzLink', 'Weitere Titelhinweise', {isSearchLink: true,
                                                    internal: true,     
                                                    searchAttr: "all",
                                                    pName: "{(.*?)}",
                                                    pVal: "^(\\S+)"}],
             ['isbn', 'ISBN'],
             ['issn', 'ISSN'],
             ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
             ['toc', 'Hinweise zum Inhalt', {isExtLink: true,
                                             name: 'Inhaltsverzeichnis'}],
             ['abstract', 'Abstract'],
             ['issue', 'Zeitschrift']]);
};


var vkConfHitFieldsIQ_All = function () {
    // ['title', 'Titel'],
    return ([['titlealternative', 'Titel alternativ'],
             ['link', 'URL/Identifizierer', {isExtLink: true,
                                             name: 'zur Webseite'}],
             ['identifieralternative', 'Identifizierer alternativ'],
             ['typeViFaKoMFiT', 'Quellenart'],
             ['creator', 'Urheber'],
             ['contributor', 'Mitarbeiter'],
             ['publisher', 'Verleger'],
             ['placeofpublication', 'Veröffentlichungsort'],
             ['dateissued', 'Veröffentlichungsdatum'],
             ['edition', 'Version'],
             ['extent', 'Umfang'],
             ['subjectSWDTheSozKMW', 'Schlagworte KMW'],
             ['subjectSWDTW', 'Schlagworte TW'],
             ['subjectSWDFW', 'Schlagworte FW'],
             ['subjectFreeKMW', 'Freie Schlagworte KMW'],
             ['subjectFreeTW', 'Freie Schlagworte TW'],
             ['subjectFreeFW', 'Freie Schlagworte FW'],
             ['description', 'Beschreibung'],
             ['tableofcontents', 'Inhaltsverzeichnis/Struktur'],
             ['subjectFSKMW', 'Themen KMW'],
             ['subjectFSTW', 'Themen TW'],
             ['subjectFSFW', 'Themen FW'],
             ['subjectRVKKMW', 'RVK KMW'],
             ['subjectRVKTW', 'RVK TW'],
             ['subjectRVKFW', 'RVK FW'],
             ['subjectRVKfree', 'Klassifikation RVK Zusatz' ],
             ['subjectDDCKMW', 'DDC KMW'],
             ['subjectDDCTW', 'DDC TW'],
             ['subjectDDCFW', 'DDC FW'],
             ['subjectDDCfree', 'Klassifikation DDC Zusatz'],
             ['spatialcoverage', 'geographischer Bezug'],
             ['temporalcoverage', 'zeitlicher Bezug'],
             ['language', 'Sprache'],
             ['accessrights', 'Zugriffsrechte'],
             ['notes', 'Anmerkungen zur Ressource']]);
};


var vkConfHitFieldsIQ = function () {
    return ([['typeViFaKoMFiT', 'Quellenart'],
             ['creator', 'Urheber'],
             ['dateissued', 'Veröffentlichungsdatum'],
             ['subjectSWDTheSozKMW', 'Schlagworte KMW'],
             ['subjectSWDTW', 'Schlagworte TW'],
             ['subjectSWDFW', 'Schlagworte FW'],
             ['subjectFreeKMW', 'Freie Schlagworte KMW'],
             ['subjectFreeTW', 'Freie Schlagworte TW'],
             ['subjectFreeFW', 'Freie Schlagworte FW'],
             ['link', 'URL/Identifizierer', {isExtLink: true}],
             ['identifieralternative', 'Identifizierer alternativ']]);
};


var vkConfHitFieldsDissonline = function () {
    return ([['title', 'Titel'],
             ['au', 'Autor'],
             /*
             ['place', 'Verlagsort'],
             ['pub', 'Verlag'],
             ['date', 'Erscheinungsjahr'],
             */
             ['description', 'Hochschulschrift'],
             ['urn', 'URN'],
             ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
             ['sg', 'Sachgruppe(n)']]);
};


var vkConfHitFieldsSLW = function () {
    return ([['title', 'Titel'],
             ['au', 'Person', {isSearchLink: true,
                               searchAttr: "person",
                               pRm: '\\s*\\[.*?\\]'}],
             ['place', 'Verlagsort'],
             ['pub', 'Verlag'],
             ['date', 'Erscheinungsjahr'],
             ['institution', 'Körperschaft'],
             ['subject', 'Schlagwort', {isSearchLink: true,
                                        searchAttr: "subject",
                                        pRm: '\\s*\\[.*?\\]'}],
            ['gesamttitel', 'Gesamttitel', {isSearchLink: true,
                                            internal: true,
                                            searchAttr: "id",
                                            pName: "{(.*?)}",
                                            pVal: "^(\\S+)"}],
             ['baende', 'Bände/Stücke', {isSearchLink: true,
                                         internal: true,
                                         searchAttr: "all",
                                         pName: "{(.*?)}",
                                         pVal: "^(\\S+)"}],
             ['isbn', 'ISBN'],
             ['issn', 'ISSN'],
             ['umfang', 'Umfang']]);
};


var vkConfHitFieldsBase = function () {
    return ([['title', 'Titel'],
             ['au', 'Autor'],
             /*
             ['place', 'Verlagsort'],
             */
             ['subject', 'Schlagwörter'],
             ['description', 'Inhalt'],
             ['pub', 'Verlag'],
	     ['person', 'Mitwirkende'],
             ['date', 'Erscheinungsjahr'],
             ['type', 'Dokumentart'],
             ['issue', 'Quelle'],
             ['relation', 'Beziehung'],
             ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}]]);
};


var vkConfCats = {

    'hebis': {
        name: 'HeBIS Verbundkatalog',
        nameShort: 'hebis',
        url: 'http://cbsopac.rz.uni-frankfurt.de/',
        mats: vkConfMatsPica(),
        hitFields: vkConfHitFieldsDefault()
    },
    'fra': {
        name: 'UB Frankfurt (PSI2)',
        nameShort: 'fra',
        url: 'http://lbsopac.rz.uni-frankfurt.de/',
        mats: vkConfMatsPica(),
        hitFields: vkConfHitFieldsDefault()
    },
    'gbv': {
        name: 'GBV Verbundkatalog',
        nameShort: 'gbv',
        url: 'http://gso.gbv.de/',
        mats: vkConfMatsPica(),
        hitFields: vkConfHitFieldsDefault()
    },
    'swb': {
        name: 'SWB Verbundkatalog',
        nameShort: 'swb',
        url: 'http://swb.bsz-bw.de/',
        mats: vkConfMatsPica(),
        hitFields: vkConfHitFieldsDefault()
    },

    'bre35': {
        name: 'Fachkatalog Publizistik, Journalismus, ' +
        'Pressewesen der SuUB Bremen (SSG-Bibliothek bis 1998)',
        nameShort: 'bre35',
        url: 'http://opac.suub.uni-bremen.de/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'fra35': {
        name: 'UB Frankfurt Fachkatalog Funk, Fernsehen (-1998)',
        nameShort: 'fra35',
        url: 'http://lbsopac.rz.uni-frankfurt.de/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'swb35': {
        name: 'UB Leipzig Fachkatalog Kommunikations- und ' + 
        'Medienwissenschaft. Publizistik (1998-)',
        nameShort: 'swb35',
        url: 'http://swb.bsz-bw.de/DB=2.253/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'hbi': {
        name: 'Bibliothek Hans-Bredow-Institut für Medienforschung',
        nameShort: 'hbi',
        url: 'http://www.hans-bredow-institut.de/bibliothek/bib-online.htm',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: [['title', 'Titel'],
                    ['au', 'Autor'],
                    ['author', 'Autor'],
                    ['beteiligt', 'Beteiligt', {isSearchLink: true,
                                                searchAttr: "person",
                                                pRm: '\\s*\\[.*?\\]'}],
                    ['periodical', 'Zeitschrift'],
                    ['place', 'Verlagsort'],
                    ['pub', 'Verlag'],
                    ['date', 'Erscheinungsjahr'],
                    ['umfang', 'Umfang'],
                    ['remark', 'Anmerkung'],
                    ['hochschulschrift', 'Hochschulschrift'],
                    ['in2', 'In', {isSearchLink: true,
                                   internal: true,
                                   searchAttr: "all",
                                   pName: "{(.*?)}",
                            pVal: "^(\\S+)"}],
                    ['chronLink', 'Frühere/Spätere Titel', {isSearchLink: true,
                                                            internal: true, 
                                                            searchAttr: "all",
                                                            pName: "{(.*?)}",
                                                            pVal: "^(\\S+)"}],
                    ['horzLink', 'Weitere Titelhinweise', {isSearchLink: true,
                                                           internal: true,     
                                                           searchAttr: "all",
                                                           pName: "{(.*?)}",
                                                           pVal: "^(\\S+)"}],
                    ['isbn', 'ISBN'],
                    ['issn', 'ISSN'],
                    ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
                    ['toc', 
                     'Hinweise zum Inhalt', {isExtLink: true,
                                             name: 'Inhaltsverzeichnis'}],
                    ['abstract', 'Abstract'],
                    ['subject', 'Themen']],
        windowOpen: "Fenster2Oeffnen",
        noDetails: false
    },

    'wien_100': {
        name: 'UB Wien - FB Publizistik und Kommunikationswissenschaft',
        nameShort: 'wien_100',
        url: 'http://aleph.univie.ac.at/F/?local_base=A100',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'wien_106': {
        name: 'UB Wien - FB Theater-, Film- und Medienwissenschaft',
        nameShort: 'wien_106',
        url: 'http://aleph.univie.ac.at/F/?local_base=A106',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'fes': {
        name: 'Bibliothek Friedrich-Ebert-Stiftung',
        nameShort: 'fes',
        url: 'http://library.fes.de/cgi-bin/populo/marx.pl?t_maske',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault(),
        noDetails: true
    },

    'fra93': {
        name: 'UB Frankfurt Fachkatalog Theater- und Filmwissenschaft',
        nameShort: 'fra93',
        url: 'http://lbsopac.rz.uni-frankfurt.de/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'fraZK': {
        name: 'UB Frankfurt Zettelkatalog (alle Fächer, -1986)',
        nameShort: 'fraZK',
        url: 'http://retro.hebis.de/cgi-bin/suche_menue.pl?katnum=16',
        mats: vkConfMatsDefault(),
        hitFields: vkConfHitFieldsDefault()
    },

    'dtm': {
        name: 'Deutsches Theatermuseum München',
        nameShort: 'dtm',
        url: 'http://katalog.bib-bvb.de/avanti/dtm/opac.html',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesY(),
        hitFields: vkConfHitFieldsDefault()
    },

    'slw': {
        name: 'Theaterwissenschaftliche Sammlung Schloss Wahn',
        nameShort: 'slw',
        // url: 'http://kug.ub.uni-koeln.de/',
        url: 'http://www.schloss-wahn.de/bestaende.html',
        mats: ['binary', 'article'],
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsSLW()
    },

    'vkf': {
        name: 'Verbundkatalog Film',
        nameShort: 'vkf',
        url: 'http://www.kobv.de/nutzer_vkfilm.html',
        mats: vkConfMatsDefault(),
        hitFields: vkConfHitFieldsDefault(),
        isExtern: true
    },

    'dissonline': {
        name: 'dissonline.de – Digitale Dissertationen im Internet (ab 1998)',
        nameShort: 'dissonline',
        url: 'http://www.dissonline.de/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDissonline()
    },

    'dissonline_kmw': {
        name: 'dissonline.de – Digitale Dissertationen im Internet (ab 1998)' +
            ' - Medien',
        nameShort: 'dissonline_kmw',
        url: 'http://www.dissonline.de/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDissonline()
    },

    'dissonline_t': {
        name: 'dissonline.de – Digitale Dissertationen im Internet (ab 1998)' +
            ' - Theater',
        nameShort: 'dissonline_f',
        url: 'http://www.dissonline.de/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDissonline()
    },

    'dissonline_f': {
        name: 'dissonline.de – Digitale Dissertationen im Internet (ab 1998)' +
            ' - Film',
        nameShort: 'dissonline_t',
        url: 'http://www.dissonline.de/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDissonline()
    },

    'ism': {
        name: 'Informationssystem Medienpädagogik / ISM',
        nameShort: 'ism',
        url: 'http://www.ism-info.de/ism-info.html?form=erweitert&qdb=ism',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: [['au', 'Person'],
                    ['title', 'Titel'],
                    ['source', 'Quelle'],
                    ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
                    ['date', 'Erscheinungsjahr'],
                    ['isbn', 'ISBN'],
                    ['mat', 'Dokumenttyp'],
                    ['subject', 'Schlagworte'],
                    ['herkunft', 'Herkunft']]
    },

    /*
    'ism_teil': {
        name: 'Informationssystem Medienpädagogik / ISM - ohne HBI und IZI',
        nameShort: 'ism_teil',
        url: 'http://www.ism-info.de/ism-info.html?form=erweitert&qdb=ism',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: [['au', 'Person'],
                    ['title', 'Titel'],
                    ['source', 'Quelle'],
                    ['url', 'URL', {isExtLink: true, name: 'zum Volltext'}],
                    ['date', 'Erscheinungsjahr'],
                    ['isbn', 'ISBN'],
                    ['mat', 'Dokumenttyp'],
                    ['subject', 'Schlagworte'],
                    ['herkunft', 'Herkunft']]
    },
    */

    'base': {
        name: 'BASE - Bielefeld Academic Search Engine',
        nameShort: 'base',
        url: 'http://www.base-search.net/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesY(),
        hitFields: vkConfHitFieldsBase()
    },

    'iqA': {
        name: 'Internetquellen-Führer alle Fächer',
        nameShort: 'iqA',
        url: vkConfIqUrl('iqA'),
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsIQ(),
        windowOpen: "Fenster2Oeffnen"
    },

    'iqKMW': {
        name: 'Internetquellen-Führer Kommunikations- und ' +
        'Medienwissenschaft. Publizistik',
        nameShort: 'iqKMW',
        url: vkConfIqUrl('iqKMW'),
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsIQ(),
        windowOpen: "Fenster2Oeffnen"
    },

    'iqT': {
        name: 'Internetquellen-Führer Theaterwissenschaft',
        nameShort: 'iqT',
        url: vkConfIqUrl('iqT'),
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsIQ(),
        windowOpen: "Fenster2Oeffnen"
    },

    'iqF': {
        name: 'Internetquellen-Führer Filmwissenschaft',
        nameShort: 'iqF',
        url: vkConfIqUrl('iqF'),
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsIQ(),
        windowOpen: "Fenster2Oeffnen"
    },

    'olc_kmw_gbv': {
        name: 'Aufsatzdatenbanken Kommunikations- und Medienwissenschaft ' +
        'Publizistik (OLC)',
        nameShort: 'olc_kmw_gbv',
        url: 'http://gso.gbv.de/DB=2.149/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'olc_fut_hebis': {
        name: 'Aufsatzdatenbanken Theater- und Filmwissenschaft (OLC)',
        nameShort: 'olc_fut_hebis',
        url: 'http://cbsopac.rz.uni-frankfurt.de/DB=3.6/',
        mats: vkConfMatsPica(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsDefault()
    },

    'fli': {
        name: 'FLI Online - Film Literature Index / 1976 - 2001',
        nameShort: 'fli',
        url: 'http://webapp1.dlib.indiana.edu/fli/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: [
            ['title', 'Titel'],
            ['author', 'Autor'],
            ['periodical', 'Zeitschrift']
        ],
        windowOpen: "Fenster2Oeffnen",
        noDetails: true
    },

    'nat_pio': {
        name: 'Periodicals Index Online / PIO 1739 - 2000',
        nameShort: 'nat_pio',
        url: 'http://pio.chadwyck.co.uk/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsNat(),
        noDetails: true
    },

    'nat_pao': {
        name: 'Periodicals Archive Online / PAO 1802 - 2000',
        nameShort: 'nat_pao',
        url: 'http://pao.chadwyck.co.uk/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        hitFields: vkConfHitFieldsNat(),
        noDetails: true
    },

    'teso': {
        name: 'Teatro Español del Siglo de Oro / TESO',
        nameShort: 'teso',
        url: 'http://teso.chadwyck.co.uk/',
        mats: vkConfMatsDefault(),
        dates: vkConfDatesYI(),
        //hitFields: vkConfHitFieldsNat(),
        hitFields: [['title', 'Titel'],
                    ['au', 'Autor'],
                    ['pub', 'Erschienen'],
                    ['page', 'Band/Seite']],
        noDetails: true
    }
};


var vkConfCatsTree = null;
var vkConfQueryFields = [["all", "Überall"],
                         ["title", "Titel"],
                         ["person", "Person"],
                         ["subject", "Schlagwort"],
                         ["id", "Nummer"]];


var vkConfDissonlineCatId = function (fach) {
    var catId = (fach === 'medien') ? 'dissonline_kmw' :
    (fach === 'theater') ? 'dissonline_t' :
    (fach === 'film') ? 'dissonline_f' : 'dissonline';
    return (catId);
};


var vkConfCatsTreeInit = function () {
    var bibCats, dbCats, suchCats, iqCats, aufCats, natCats, fach, id, sel,
    fsel,
    refCats, test;
    test = false;
    fach = $.getFach();
    refCats = {
        name: 'Vergleichskataloge für Testzwecke',
        catIds: ['hebis',
                 'fra',
                 'gbv',
                 'swb']
    };
    bibCats = {
        name: 'Bibliothekskataloge',
        catIds: ['bre35',
                 'fra35',
                 // 'leip35',
                 'swb35',
                 'hbi',
                 'wien_100',
                 'wien_106',
                 'fes',
                 'fra93',
                 'fraZK', 
                 'dtm', 
                 'slw',
                 'vkf',
                 vkConfDissonlineCatId(fach),
                 'ism'
                 /*,'ism_teil'*/
                 ]
    };
    /*
    dbCats = {
        name: 'Datenbanken',
        catIds: [
                 'ism',
                 ]
    };
    */
    suchCats = {
        name: 'Suchmaschinen',
        catIds: ['base']
    };
    iqCats = {
        name: 'Internetquellen',
        catIds: ['iqA',
                 'iqKMW',
                 'iqT',
                 'iqF']
    };
    aufCats = {
        name: 'Aufsatzdatenbanken',
        catIds: ['olc_kmw_gbv',
                 //'olc_fut_gbv',
                 'olc_fut_hebis',
                 'fli']
    };
    natCats = {
        name: 'Nationallizenzen',
        catIds: ['nat_pio',
                 'nat_pao',
                 'teso']
    };

    if ($.getVKType() === 'all') {
        vkConfCatsTree = {
            name: 'Alle',
            children: []
        };
        if (test) {
            vkConfCatsTree.children.push(refCats);
        }
        vkConfCatsTree.children.push(bibCats);
        //vkConfCatsTree.children.push(dbCats);
        vkConfCatsTree.children.push(suchCats);
        vkConfCatsTree.children.push(iqCats);
        vkConfCatsTree.children.push(aufCats);
        vkConfCatsTree.children.push(natCats);
    }
    else if ($.getVKType() === 'bib') {
        vkConfCatsTree = bibCats;
    }
    else if ($.getVKType() === 'auf') {
        vkConfCatsTree = aufCats;
    }
    else if ($.getVKType() === 'nat') {
        vkConfCatsTree = natCats;
        vkConfQueryFields = [["all", "Überall"],
                             ["title", "Titel"],
                             ["person", "Person"],
                             //["subject", "Schlagwort"],
                             ["id", "Nummer"]];
    }

    sel = (fach === 'alle') ? {
        'bre35': 1,
        'fra35': 1,
        'fra93': 1,
        'swb35': 1,
        'hbi': 1,
        'fes': 1,
        'iqA': 1,
        'fraZK': 1,
        'dtm': 1,
        'vkf': 1,
        'olc_kmw_gbv': 1,
        'olc_fut_gbv': 1,
        'olc_fut_hebis': 1,
        'nat_pao': 1,
        'nat_pio': 1,
        'teso': 1,
        'base': 1,
        'fli': 1,
        'wien_100': 1,
        'wien_106': 1,
        'dissonline' : 1,
        'slw' : 1,
        'ism' : 1
        /*,'ism_teil' : 1*/
    } 
    : (fach === 'medien') ? {
        'bre35': 1,
        'fra35': 1,
        'swb35': 1,
        'hbi': 1,
        'fes': 1,
        'iqKMW': 1,
        'fraZK': 1,
        'olc_kmw_gbv': 1,
        'nat_pao': 1,
        'nat_pio': 1,
        'base': 1,
        'wien_100': 1,
        'wien_106': 1,
        'dissonline_kmw': 1,
        'ism' : 1
        /*,'ism_teil' : 1*/
    } 
    : (fach === 'theater') ? {
        'fra93': 1,
        'iqT': 1,
        'fraZK': 1,
        'dtm': 1,
        'olc_fut_gbv': 1,
        'olc_fut_hebis': 1,
        'nat_pao': 1,
        'nat_pio': 1,
        'teso': 1,
        'base': 1,
        'wien_106': 1,
        'dissonline_t': 1,
        'slw' : 1
    } 
    : (fach === 'film') ? {
        'fra93': 1,
        'iqF': 1,
        'fraZK': 1,
        'vkf': 1,
        'olc_fut_gbv': 1,
        'olc_fut_hebis': 1,
        'nat_pao': 1,
        'nat_pio': 1,
        'base': 1,
        'fli': 1,
        'wien_106': 1,
        'dissonline_t': 1
    } 
    : {};
    for (id in vkConfCats) {
        if (vkConfCats.hasOwnProperty(id)) {
            vkConfCats[id].preselected = false;
        }
    }
    fsel = function (tree, sel) {
        var i, id, subtree;
        if (tree.catIds) {
            for (i = 0; i < tree.catIds.length; i += 1) {
                id = tree.catIds[i];
                if (sel[id] === undefined) {
                    vkConfCats[id].preselected = false;
                }
                else {
                    vkConfCats[id].preselected = true;
                }
            }
        }
        if (tree.children) {
            for (i = 0; i < tree.children.length; i += 1) {
                subtree = tree.children[i];
                fsel(subtree, sel);
            }
        }
    };
    fsel(vkConfCatsTree, sel);
};


var vkConfHits = {
    packageLength: 10
};


var vkConfIASLURLs = {
    rezURL: 'http://www.iaslonline.de/index.php?vorgang_id=',
    title: 'IASL-Online'
};


var vkConfEZBURLs = {
    img: "http://ezb.uni-regensburg.de/ezeit/vascoda/get_image.php",
    //img: "/modules/mes2/ezb-image/",
    openURL: 'http://ezb.uni-regensburg.de/ezeit/vascoda/openURL',
    title: 'Elektronische Zeitschriftenbibliothek (EZB)'
};


var vkConfSUBITOURLs = {
    img: "/metasuche/images/links/subito.png",
    openURL: 'http://www.subito-doc.de/order/openurl.php',
    title: 'Bei subito bestellen (kostenpflichtig)'
};


var vkConfZDBURLs = {
    img: "/metasuche/images/links/zdb.png",
    url: 'http://dispatch.opac.ddb.de/DB=1.1/PRS=HOL/CMD?ACT=SRCHA&IKT=8506&SRT=LST_ty&TRM=',
    title: 'ZDB: Besitznachweise der Bibliotheken'
};


var vkConfEzToLink = {
    ids: ['kvk', 'ezb', 'subito', 'zdb', 'worldcat'],
    kvk: {
        title: 'KVK',
        img: 'images/links/kvk.png'
    },
    ezb: {
        title: 'EZB',
        img: 'images/links/'
    },
    subito: {
        title: 'Subito',
        img: 'images/links/subito.png'
    },
    zdb: {
        title: 'ZDB',
        img: 'images/links/zdb.png'
    },
    worldcat: {
        title: 'Worldcat',
        img: 'images/links/worldcat.png'
    }
};


var vkConfForms = {
    book: { name: "Bücher", img: "images/mat/book.png"},
    periodical: { name: "Zeitschriften/Serien",
                  img: "images/mat/periodical.png"},
    olper: { name: "Online-Zeitschriften", img: "images/mat/olper.png"},
    binary: { name: "Online-Publikationen", img: "images/mat/binary.png"},
    article: { name: "Aufsätze", img: "images/mat/article.png"}
};
