function showElement(element){
    $('.accordion').hide();
    $('h3').removeClass( 'h3_active' );
    $('.accordion_'+element).show();
    $('.h3_accordion_'+element).addClass('h3_active');
}
$(function(){
    
    if( $('#emailname').val() == "") $('#emailname').val('Name');
    $('#emailname').click(function () { $('#emailname').val('');});
    if( $('#email_nl').val() == "") $('#email_nl').val('E-Mail');
    $('#email_nl').click(function () { $('#email_nl').val('');});
    
    $('.accordion').hide();
    try{
        showElement("aktionen");
    } catch (e){
        try{
            showElement("rueckruf");
        } catch (e){
            
        }
    }
    
    

      /*
      $('#accordion').accordion({
            header: "h3",
            autoHeight: false
        });
    */
    $(".a_accordion").click(function () { 
        accordion_href = $(this).attr('href');
        accordion_href = accordion_href.replace('#', '');
        showElement(accordion_href);
        return false;
    }
    );
    
    
    /* Text des Suchfeldes ändern beim reinklicken und verlassen */
        $("#searchinput").focus(function () {
             if ($(this).val() == $("#searchtext").val()){
                $(this).val('');
             }
        });
         $("#searchinput").blur(function () {
             if ($(this).val() == ''){
                $(this).val($("#searchtext").val());
            }
        });
    
    /*Blendet wenn JS an ist, den Submitbutton der Sprachauswahl aus, da bei JS aktiv die Selectbox via onchange funktioniert */
        $("#sprachbutton").css('display', 'none');
       
    /* Styles für input-Felder innerhalb des Content-Containers (Formulare usw.) */
        $(".content input:not(.refsearch),.content textarea ").focus(function () {  
                $(this).css('border', '2px solid #ffcc00');
                $(this).css('padding', '3px 4px 0px 4px');
                $(this).css('color', '#000');
            }
        );
        $(".content input:not(.refsearch),.content textarea").blur(function () {
                $(this).css('border', '1px solid #666');
                $(this).css('padding', '4px 5px 1px 5px');
                $(this).css('color', '#999');
            }
        );
    
    /*Tabs erstellen im linken Block */
        try { $('#tabs > ul').tabs(); }catch(err){}
    
    /* Startborder von der Hauptnavi setzen, da dies mit css nicht einfach erreichbar ist. */
/*        if ($('#hauptnavi li:first').hasClass("active")) $('#hauptnavi li:first').css('background-image', 'url(images/mainnavi_active_dotted.jpg)');   */
$('#hauptnavi li:last span a').css('background-image', 'none'); 

    /* Script für "Replace-Selectbox" - für Sprachauswahl chique machen */
        $('#sprachselect').selectbox({debug: true}); //set debug on false to get console.log.informations
        
    try { $('div#referenzensuche').hide(); }catch(err){}
    $('#referenzensuche_start').hover(
        function() { $(this).css('cursor', 'pointer'); },
        function() { $(this).css('cursor', 'default'); }
    );
    $('#referenzensuche_start').click(function(){ $('div#referenzensuche').show(); $('#referenzensuche_start').hide();  return false; } );
    $('#sprachselect_input_7').click(function(){ location.href="http://www.scn-america.com";return false; } );
    
});