/*var url = window.location.href;

if(url.match('#tv')){
	document.getElementById('tv').style.backgroundColor = '#ffffff';
	document.getElementById('digitaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('regionaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('radio').style.backgroundColor = '#e7e9b3';
	alert('we zitten goed');
	SwitchColumn('channelmenu','tvmenu');
}else if(url.match('#digitaal')){

	document.getElementById('digitaal').style.backgroundColor = '#ffffff';
	document.getElementById('tv').style.backgroundColor = '#e7e9b3';
	document.getElementById('regionaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('radio').style.backgroundColor = '#e7e9b3';

	SwitchColumn('channelmenu','digitaalmenu');
}else if(url.match('#radio')){
	document.getElementById('radio').style.backgroundColor = '#ffffff';
	document.getElementById('digitaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('regionaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('tv').style.backgroundColor = '#e7e9b3';

	SwitchColumn('channelmenu','radiomenu');
}else if(url.match('#regionaal')){
	document.getElementById('regionaal').style.backgroundColor = '#ffffff';
	document.getElementById('digitaal').style.backgroundColor = '#e7e9b3';
	document.getElementById('tv').style.backgroundColor = '#e7e9b3';
	document.getElementById('radio').style.backgroundColor = '#e7e9b3';

	SwitchColumn('channelmenu','regionaalmenu');
}*/


/**
 * Switches guide
 */
function switchGuide(iNum) {

   if( iNum >= 0 && iNum <4) {
        var d   = new Date();

        var day = d.getDay();

        if( day == 6) {
            day=0;
        }else {
            day = day+1;
        }

        var weekday=new Array(7);
        weekday[0]="zat";
        weekday[1]="zon";
        weekday[2]="maa";
        weekday[3]="din";
        weekday[4]="woe";
        weekday[5]="don";
        weekday[6]="vri";

        var week    = 'this';

        if( iNum==0 ){
            var week    = 'this';
        }else if( iNum == 1) {
            if( day == 6 ) {
                day         = 0;
                var week    = 'next';
            }else {
                day = day+1;
            }

        } else {
            if( day == 6 ) {
                day         = 1;
                var week    = 'next';
            }else if( day == 5 ) {
                day         = 0;
                var week    = 'next';
            }else {
                day = day+2;
            }
        }
        var dag     = weekday[day];

        var href    = 'index.php?id=voorpagina&target=Programmagids&ref=tk_'+week+'_'+dag;

        window.location.href = href;
   }
}
