$(document).ready(function() {
    $(".lightboxlist img").each(function() {
        $(this).fadeTo("normal", 0.75);
        $(this).hover(
            function(){
                $(this).fadeTo("normal", 1.00);
            }
            , function(){
                $(this).fadeTo("normal", 0.75);
            });
        });

        if(typeof sIFR == "function"){
            sIFR.replaceElement("h1", named({sFlashSrc: "/media/stat/trajan.swf", sColor: "#333333", sWmode: "transparent"}));
        };

    });

function checkCommentingForm() {
    var ret = false;
    var f = document.forms[0];
    if(f) {
        var els = f.elements;
        if(els.length > 0) {
            var errsfound = false;
            for(var i=0; i<els.length; i++) {
                if(els[i].name == 'commenter' && trim(els[i].value) == '') {
                    errsfound = true;
                    break;
                }
                if(els[i].name == 'comment' && trim(els[i].value) == '') {
                    errsfound = true;
                    break;
                }
            }
            if(!errsfound) {
                ret = true;
            } else {
                alert('Could not leave a comment!\n\rCheck that Name and Comment are given.');
            }
        }
    }
    return ret;
}

function trim(str) {
    return str.replace(/^\s+|\s+$/g, '');
}
