function focusSearch()
{
    sval = document.search.fullsearch.value;
    if (sval=="Suchbegriff")
        document.search.fullsearch.value = "";
}

function blurSearch()
{
    if(document.search.fullsearch.value=='' && sval!='')
    {
        document.search.fullsearch.value="Suchbegriff";
    }
    else if (sval=='')
    {
        document.search.fullsearch.value="Suchbegriff";
    }
}

function checkSearch()
{
    if(document.search.fullsearch.value!="Suchbegriff")
    {
        document.search.submit();
    }
    else
    {
        alert("Sie haben keinen Suchbegriff eingegeben");
        document.search.fullsearch.focus();
    }
}

// IE Select-Felder abschalten.
function hideSelect()
{
    if(navigator.appName.indexOf("Explorer") != -1)
    {
        for(i=0; i<document.getElementsByTagName('select').length; i++) {
            document.getElementsByTagName('select')[i].style.setAttribute('visibility', 'hidden');
        }
    }
}

// abgeschaltete IE Select-Felder wieder aktivieren.
function showSelect()
{
    if(navigator.appName.indexOf("Explorer") != -1)
    {
        for(i=0; i<document.getElementsByTagName('select').length; i++) {
            document.getElementsByTagName('select')[i].style.setAttribute('visibility', 'visible');
        }
    }
}

function showSelectMTO()
{
    //window.setTimeout("showSelect()", 1000);
    showSelect();
}

/* Schnellstart Funktionen ***********************/

function showListe(x)
{
    // UP
    // nochmal umgebaut weil andere form dazwischengefunkt hat

    var allSelects = document.getElementsByTagName("select");

    for (var i=0; i<allSelects.length; i++)
    {
        //alert(allSelects[i].name);
        if (allSelects[i].name.substring(0, 3) == 'S1_')
        {
            allSelects[i].style.display = "none";
        }
    }

    if (x == "nix")
    {
        document.getElementById('listeStart').style.display = "block";
    }
    else
    {
        document.getElementById('listeStart').style.display = "none";
        document.getElementById(x).style.display = "block";
    }
}

function Go(y)
{
    if (y == "nix")
    {
        return;
    }

    if (y.substr(0, 4) == "http" && y.substr(0, 18) != "http://www.ifpi.de")
    {
        var fenster = window.open(y, 'pop','');
        fenster.focus();
        return;
    }
    else
    {
        window.location.href = y;
    }
}

/* Schnellstart Funktionen Ende ***********************/

function BlurLinks()
{
    lnks=document.getElementsByTagName('a');
    for(i=0;i<lnks.length;i++)
    {
        lnks[i].onfocus=new Function("if(this.blur)this.blur()");
    }
}

function startList()
{
    if (document.all&&document.getElementById)
    {
        navRoot = document.getElementById("mainnav_box");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            node.onmouseover=function() {this.className+=" level1over";}
            node.onmouseout=function() {this.className=this.className.replace(" level1over", "");}
        }
    }
}

function allOnLoad()
{
    BlurLinks();
    startList();
}

onload=allOnLoad;

// jquery ready-function
$(document).ready(function() {
    // News Balken auf der Startseite einblenden
    if ($("#div_footer_container").length > 0 || $("#div_footer_container_2").length > 0) {
        // Im IE6 News Balken unterhalb der Nachrichten anzeigen
        if ($.browser.msie && $.browser.version.substr(0,1)<=6) {
            $("#div_footer_container_2").show();
            $("#div_footer_container").hide();
        // Alle anderen Browser News Balken am unteren Bildschirmrand anzeigen
        } else {
            // $("#div_footer_container_2").hide();
            $("#div_footer_container").constantfooter({
                "opacity": "1.0"
            });
        }
    }

    // Watermarks fuer die Gold/Platin Datenbank Suche
    if ($("#strInterpret").length > 0 || $("#strTitel").length > 0) {
        $('#strInterpret').watermark('Interpret');
        $('#strTitel').watermark('Titel');
    }

    // Bookmark im Browser
    if ($("#a_socials").length > 0) {
        $("#a_socials").jFav('Press "Ctrl+D" or "CMD+D" for MAC');
    }

    // Set target _blank
    $('.blank').attr('target', '_blank');
});
