function bodyLoad() {
	radioTimeStart();
}

function buzz(l) {
	ajaxEval('/scripts/buzz/?l='+l+'&u='+escape(document.getElementById('buzz_url').value));
}

function mailinglist(l,h) {
	ajaxEval('/scripts/mail/?l='+l+'&h='+h+'&e='+escape(document.getElementById((h?'head_':'')+'mlist_email').value));
}

function radio(a,t,k) {
	switch (a) {
		case 'display':
			ajaxEval('http://'+window.location.hostname+'/radio/?strAction=display');
			return false;
			break;
		case 'play':
			if (k==null) k = document.getElementById('frm_jukebox_k').value;
			if (t==null) t = document.getElementById('frm_jukebox_c').value;
			wndwPopup = window.open('https://store.indica.mu/radio/'+k+'/?d='+window.location.hostname+'#play-'+t,'ind_radio','width=263,height=418,top='+(screen.height-518)+',left='+(screen.width-363)+',scrollbars=yes,resizable');
			break;
		default:
			k = document.getElementById('frm_jukebox_k').value;
			t = document.getElementById('frm_jukebox_c').value;
			wndwPopup = window.open('https://store.indica.mu/radio/'+k+'/?d='+window.location.hostname+'#'+a+'-'+t,'ind_radio','width=263,height=418,top='+(screen.height-518)+',left='+(screen.width-363)+',scrollbars=yes,resizable');
			break;
	}
}

function radioTime() {
	var r = document.getElementById('frm_jukebox_r').value;
	var t = document.getElementById('frm_jukebox_t').value;
	if (r != t) {
		var time = new Date();
		time.setHours(0);
		time.setMinutes(r.substr(0,r.indexOf(":")));
		time.setSeconds(r.substr(r.indexOf(":")+1));
		time.setSeconds(time.getSeconds()+1);
		r = (time.getMinutes()<10?'0':'')+time.getMinutes()+':'+(time.getSeconds()<10?'0':'')+time.getSeconds();
		document.getElementById('frm_jukebox_r').value = r;
		document.getElementById('radio_time_r').innerHTML = r;
	}
}

function radioTimeStart() {
	window.setInterval("radioTime()", 1000);
}

function showLayer(d,b) {
	if (document.getElementById && document.getElementById(d)) { objLayer = document.getElementById(d); } else if (document.all && document.all[d]) { objLayer = document.all[d]; } else if (document.layers && document.layers[d]) { objLayer = document.layers[d]; } else { objLayer = null; }
	if (objLayer !== null) { objLayer.style.display = (b == 1) ? 'block' : 'none'; }
}

