use utf8;

#------------------------------------------------------------------------
# Compiled template generated by the Template Toolkit version 2.14
#------------------------------------------------------------------------

Template::Document->new({
    METADATA => {
        'modtime' => '1138763659',
        'name' => 'controls.js',
    },
    BLOCK => sub {
        my $context = shift || die "template sub called without context\n";
        my $stash   = $context->stash;
        my $output  = '';
        my $error;
        
        eval { BLOCK: {
    $output .=  "// BEGIN controls.js\nfunction nextSlide() {\n    window.location = '";
    #line 3 "template/tt2/controls.js"
    $output .=  $stash->get('next_slide');
    $output .=  "';\n}\n\nfunction prevSlide() {\n    window.location = '";
    #line 7 "template/tt2/controls.js"
    $output .=  $stash->get('prev_slide');
    $output .=  "';\n}\n\nfunction indexSlide() {\n    window.location = 'index.html';\n}\n\nfunction startSlide() {\n    window.location = 'start.html';\n}\n\nfunction closeSlide() {\n    window.close();\n}\n\nfunction handleKey(e) {\n    var key;\n    if (e == null) {\n        // IE\n        key = event.keyCode\n    } \n    else {\n        // Mozilla\n        if (e.altKey || e.ctrlKey) {\n            return true\n        }\n        key = e.which\n    }\n    switch(key) {\n        case 8: prevSlide(); break\n        case 13: nextSlide(); break\n        case 32: nextSlide(); break\n        case 81: closeSlide(); break\n        case 105: indexSlide(); break\n        case 110: nextSlide(); break\n        case 112: prevSlide(); break\n        case 115: startSlide(); break\n        default: //xxx(e.which)\n    }\n}\n\ndocument.onkeypress = handleKey\n";
    #line 51 "template/tt2/controls.js"
    if ($stash->get('mouse_controls')) {
    $output .=  "document.onclick = nextSlide\n";
    }
    
    $output .=  "// END controls.js\n";
        } };
        if ($@) {
            $error = $context->catch($@, \$output);
            die $error unless $error->type eq 'return';
        }
    
        return $output;
    },
    DEFBLOCKS => {

    },
});
