/**
 * timetable.js
 *
 * @category  gymnasium köniz lerbermatt
 * @package   frontend
 * @author    nothing <info@nothing.ch>
 * @copyright 2008 nothing from outer space (http://www.nothing.ch)
 * @license   http://www.nothing.ch/licence nothing gpl licence
 * @version   SVN: $Id: frontend.js 98 2008-05-07 16:07:00Z pi $
 */

/**
 * javascript functions for the timetable view.
 *
 * @category  gymnasium köniz lerbermatt
 * @package   frontend
 * @author    pi <pi@nothing.ch>
 */
ray.onDOMReady( function() {
    $( "select[name=entity]" ).on( "change", function( element, event ) {
        event.stopEvent();
        var s = element.node;

        var which = s.options[s.selectedIndex].value;
        var path = "stundenplan";
        switch( s.id ) {
            case "room":
                path = "raum";
                break;
            case "teacher":
                path = "lehrkraft";
                break;
        }
        var period = $( "input[name=period]" ).node.value;
        window.location.href = "/" + path + "/" + which + "/" + period;
    });
});
