﻿/* dropdownType
PROGRAMME	0
GENRE		1
BROADCASTER	2
PLATFORM	3
*/

function dropdownredirector(ix, type) {
    switch (parseInt(ix)) {
        case 0: /* do nothing */break;

        case -1: /* all items */
            switch (parseInt(type)) {
                case 0: document.location.href = '/catalogue.aspx?type=0&programmes=true'; break;
                default: alert('not implemented'); break;
            }
            break;

        default:
            /* individual items */
            switch (parseInt(type)) {
                case 0: document.location.href = '/program.aspx?program=' + ix; break;
                case 1: document.location.href = '/catalogue.aspx?type=2&programmes=true&genre=' + ix; break;
                case 2: document.location.href = '/catalogue.aspx?type=4&dataitem=' + ix; break;
                case 3: document.location.href = '/catalogue.aspx?type=4&dataitem=' + ix; break;
                default: alert('not implemented'); break;
            }
            break;
    }
}

/* select programme related books/dvds etc */
function shopdropdownredirector(ix) {
  document.location.href = '/shop.aspx?type=13&id=' + ix; 
}

/* select programme related news etc */
function newsdropdownredirector(ix) {
    document.location.href = '/news.aspx?type=13&id=' + ix;
}
