
function RedirectToUrl(url) {
    window.location.href = url;
}

/* initialize counter to 0 */
var minutes=0;

/* Increment counter, write text, set up callback in 60 seconds */
function UpdateTimer() {
	minutes=minutes+1;
	if (minutes==1)
		/* innerHTML is the stuff betwen the start and end tags... in this case a <span></span> tag */
		document.getElementById('pageage').innerHTML=minutes + ' minute'
	else
		document.getElementById('pageage').innerHTML=minutes + ' minutes'
		
	setTimeout("UpdateTimer();",60000);
}

function confirmAndRedirect(text,url) {
    if (!confirm(text)) {
        return false;
    }
    window.location.href = url;
}

function refreshPage() {
    window.location.href = window.location.href;
}

function recording(urlVar) {
	var idx = document.URL.indexOf('?');
	if(idx != -1){
		var recording = document.URL.substring(idx+1, document.URL.length).split('&'); 
		if(recording == urlVar){
			document.getElementById('Start').style.display = 'none';
			document.getElementById('Stop').style.display = '';
			document.getElementById('Empty').style.display = 'none';
			document.getElementById('Rec').style.display = '';
		}
	}
}

function setMode(urlMode) {
	var idx = document.URL.indexOf('?');
	if(idx != -1){
		var recording = document.URL.substring(idx+1, document.URL.length).split('&'); 
		if(recording == urlMode){
			document.getElementById('1_1').checked = '';
			document.getElementById('1_2').checked = 'checked';
		}
	}
}
