// fuer den IE
var thischapter = 1;

$(document).ready(function() {
    crossFader();
    thischapter = $('#startchapter').attr('rel');
    nextLink();
});


function nextLink(){
    $("A.nextlink").bind("click", function(){
        var targetchapter = parseInt(thischapter) + 1;
        $('#chapter' + thischapter).fadeOut(2000);
        $('#chapter' + targetchapter).fadeIn(2000);
        thischapter = targetchapter;
        return false;
    });
}

function crossFader(){
    $("A.selector").bind("click", function(){
        var targetchapter = $(this).attr('rel');
        $('#chapter' + thischapter).fadeOut(2000);
        $('#chapter' + targetchapter).fadeIn(2000);
        thischapter = targetchapter;
        return false;
    });
}
