function showError() {
    $("#output").html("showError");
}


function showResponse() {

    //$("#output").html("showResponse");
}


// pre-submit callback
function showerror() {
    $("#output").html("Fehler beim Senden!");
    // $('input[type=submit]', this).attr('disabled', '');
}


$().ready(function() {




    $(".linkswitch").mouseover(function() {
        var src = $(this).attr("src").substring(0, $(this).attr("src").length - 4) + "1.jpg";
        $(this).attr("src", src);
    })
            .mouseout(function() {
        var src = $(this).attr("src").replace("1", "");
        $(this).attr("src", src);
    });


    $('#kontaktformular').submit(function() {
        $("#output").html("Sende...");
        $(this).ajaxSubmit(
        {
            target: '#output', // target element(s) to be updated with server response
            //beforeSubmit: showRequest, // pre-submit callback
            success: showResponse, // post-submit callback
            error: showError,
            // other available options:
            cache:false,
            async:true,
            url: "/inc/kontaktformular_send.php" // override for form's 'action' attribute
            //type: type // 'get' or 'post', override for form's 'method' attribute
            //dataType: xml // 'xml', 'script', or 'json' (expected server response type)
            //clearForm: true // clear all form fields after successful submit
            //resetForm: true // reset the form after successful submit

            // $.ajax options can be used here too, for example:
            //timeout: 1000
        });


        return false;
    });


});


function bild(path, name, Breite, Hoehe) {

    var Optionen = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height=' + Hoehe + ',width=' + Breite;

    var neues_Fenster = window.open('', '', Optionen);


    neues_Fenster.document.writeln('<HTML><HEAD><TITLE>' + name + '</TITLE></HEAD>');

    neues_Fenster.document.writeln('<BODY style="margin:0; padding:0;" >');

    neues_Fenster.document.writeln('<a href="javascript:window.close();"><IMG SRC="' + path + '" WIDTH="' + Breite + '" HEIGHT="' + Hoehe + '" BORDER="0" ALT="' + name + '"></a>');

    neues_Fenster.document.writeln('</BODY></HTML>');

}

