// request-Objekt erzeugen, Browser-uebergreifend
function createRequest() {
    try {
        // nicht-Microsoft-Browser
        request = new XMLHttpRequest();
    }
    catch(tryMS) {
        // Microsoft-Browser...
        try {
            // ...die Msxml2-Library nutzen
            request = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(otherMS) {
            try {
                // ...die Microsoft-Library nutzen
                request = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(failed) {
                // wenn kein request-Objekt erzeugt werden kann
                request = null;
            }
        }
    }
    return request;
}

jQuery(document).ready(function() {
    // bind events for showing image info
    $('#show_info').click(function() {
        $('#image_rating').fadeToggle('slow');
        $('#image_info').slideToggle('slow','swing');
        $('#show_info').toggleClass('active');
        if (this.title == 'Bildinformationen anzeigen') {
            this.title = 'Bildinformationen ausblenden';
        } else {
            this.title = 'Bildinformationen anzeigen';
        }
    });

    // bind event for hiding message windows
    $('#closeWindow').click(function() {
        $('#fillFields').hide();
    });

    // show/hide star rating
    $('#image_rating').mouseover(function() {
        $('#sterne').show();
    });
    $('#sterne').mouseout(function() {
        $('#sterne').hide();
    });
});

