

function showSearchBox()
{
    showInfoBox(200,150);
    
    loadAnimation();
    
     dojo.xhrGet({
        url: url + "searchbox",
        load: function(response, ioArgs)
        {
            stopLoadAnimation();
            dojo.byId("infobox").innerHTML = response;

             //Dojo recommends that you always return(response); to propagate
             //the response to other callback handlers. Otherwise, the error
             //callbacks may be called in the success case.
             return response;
        },
    error: function(error)
        {
            dojo.byId("infobox").innerHTML =
            "Fehler: Der Boxinhalt konnte nicht geladen werden.<br>" + error +"<br><a href='javascript:hideInfoBox()'>Schlie&szlig;en</a>";
            return response;
        }


    });

    
    
}

function showSearchResult(string)
{
    showInfoBox(300,500);
    
    loadAnimation();

     dojo.xhrGet({
        url: url + "searchbox/"+string,
        load: function(response, ioArgs)
        {
            stopLoadAnimation();
            
            dojo.byId("infobox").innerHTML = response;

            resPages();
            
             //Dojo recommends that you always return(response); to propagate
             //the response to other callback handlers. Otherwise, the error
             //callbacks may be called in the success case.
             return response;
        },
    error: function(error)
        {
            dojo.byId("infobox").innerHTML =
            "Fehler: Der Boxinhalt konnte nicht geladen werden.<br>" + error +"<br><a href='javascript:hideInfoBox()'>Schlie&szlig;en</a>";
            return response;
        }


    });
    
    
}

function submitSearch()
{
    var string = dojo.byId("searchstring").value;

    if(string.length >= 3)
    {
        showSearchResult(string)
    }
    else
    {
        dojo.byId("error").innerHTML = "Der Suchbegriff muss mindestens 3 Zeichen lang sein!";
    }
}

function resPages()
{
    hide();
    dojo.style("resPages","visibility", "visible");
}

function resDocuments()
{
    hide();
    dojo.style("resDocuments","visibility", "visible");
}

function resImages()
{
    hide();
    dojo.style("resImages","visibility", "visible");
}

function resVideos()
{
    hide();
    dojo.style("resVideos","visibility", "visible");
}

function hide()
{
    dojo.style("resPages","visibility", "hidden");
    dojo.style("resDocuments","visibility", "hidden");
    dojo.style("resImages","visibility", "hidden");
    dojo.style("resVideos","visibility", "hidden");
}
