var liveData='';
var helpText='Selecteer hieronder 1 van de volgende kamers';

function showLiveData()
{
    if(document.getElementById('left'))
    {
	liveDataString='<h1>Live uitzendingen</h1><p>'+helpText+'</p><br /><div class="box3">'+liveData;
	liveDataString+='<input type="submit" onClick="javascript:window.location.reload()" value="Terug naar archief" class="submit formelement_button_laatzien" />';
	liveDataString+='</div>';
	
	document.getElementById('left').innerHTML=liveDataString;
    }

}

function setHelpText(pHelpText)
{
    helpText=pHelpText;
}

function setLiveData(pLiveData)
{
    liveData=pLiveData;
}

function popupRaadsInfo(name, type,  popupwidth, popupheight,opts)
{
    var leftstart = (screen.width/2) - (popupwidth/2);
    var topstart = (screen.height/2) - (popupheight/2);
    var properties = "width="+popupwidth+", height="+popupheight+", left="+leftstart+", top="+topstart+", toolbar=no, titlebar=no, title=0, location=no,scrollbars=yes,status=no,resizable=no";
    var popup = "/popup.php?i="+name+"&type="+type+'&'+opts;
    window.open(popup,'popup',properties);
}


function switchMediaNoReload(newType)
{
    streamPreference=newType;
    sendRequest('/shared/switchMedia.php?mediaPref='+newType,catchSwitchMediaNoReload);
}


function catchSwitchMediaNoReload(req)
{
    var text = req.responseText;
}

function switchMedia(newType)
{
    sendRequest('/shared/switchMedia.php?mediaPref='+newType,catchSwitchMedia);
    curMediaPref=newType;
}

function catchSwitchMedia(req)
{
    var text = req.responseText;
    window.location.reload();
    curMediaPref=text;
}
