// Scripts for artifiche.ch
// Author: hada.ch
// Created 2009-01-02
// Modified: 2009-04-06


/* functions for poster search box */

function defaultSearch(display){
    if(display=="advanced"){
        displayAdvanced();
    } else{
        displayBrowse();
    }
}

function displayBrowse() {
    showOn("search_browse");
    showOff("search_advanced");
    document.getElementById("search1").className = "active";
    document.getElementById("search1").style.color = "#cc0000";
    document.getElementById("search1").style.backgroundColor = "#ddddff";
    document.getElementById("search2").className = "inactive";
    document.getElementById("search2").style.color = "#000066";
    document.getElementById("search2").style.backgroundColor = "#eeeeff";
    document.keywordsform.ke.focus();
}

function displayAdvanced() {
    showOff("search_browse");
    showOn("search_advanced");
    document.getElementById("search1").className = "inactive"; 
    document.getElementById("search1").style.color = "#000066";
    document.getElementById("search1").style.backgroundColor = "#eeeeff";
    document.getElementById("search2").className = "active";
    document.getElementById("search2").style.color = "#cc0000";
    document.getElementById("search2").style.backgroundColor = "#ddddff";
    document.searchform_a.ke.focus();
}

function showOn(id) {
    document.getElementById(id).style.display = "block";
}
function showOff(id) {
    document.getElementById(id).style.display = "none";
}

function toggleSection(divId){
    var currentState=document.getElementById(divId).style.display;
    if(currentState=="none"){
        showOn(divId);
    } else {
        showOff(divId);
    }
}

function imgSwitch(id1, id2){
    if(document.getElementById(id1).style.display == "none"){
        showOff(id2);
        showOn(id1);
    } else {
        showOff(id1);
        showOn(id2);
    }
}

/* function for collection selection */

function Go(x) {
    if(x == "nothing") {
        document.forms[0].reset();
        document.forms[0].elements[0].blur();
    return;
    }
    else if(x == "end")
        top.location.href = parent.frames[1].location;
    else {
        location.href = x;
        document.forms[0].reset();
        document.forms[0].elements[0].blur();
    }
}

