function showNotes(i)
{
	var nt = $('nt'+i);
	var nta = $('nta'+i);
	if (nt.style.display == 'none')
	{
		nta.className = 'shownotes1';
		new Effect.SlideDown(nt);
	}
	else
	{
		new Effect.SlideUp(nt);
		nta.className = 'shownotes';
	}
}

function register(e)
{
	if (!e) e = window.event;
	if (e.ctrlKey)
	{
		switch(e.keyCode)
		{
			case 37:
				id = $('id_prev');
				if (id) location.href = id.href;
				break;
			case 39:
				id = $('id_next');
				if (id) location.href = id.href;
				break;
		}
	}
}

function removeChannel(id)
{
	if (confirm('Удалить канал "'+$('ch'+id).innerHTML+'" из вашей ленты?'))
	{
		document.location = "/podcasts/delete.html?id="+id;
	}
}

function setView(n, page_id)
{
	$('idv1').className = 'v1';
	$('idv2').className = 'v2';
	$('idv3').className = 'v3';
	$('idv'+n).className = 'v'+n+' a';
	$('idTable').innerHTML = '<center>Загрузка...</center>';
	
	new Ajax.Request('http://www.podplayer.ru/podcasts/?view='+n+'&page='+page_id, 
	{ 
    method:'get',
    onSuccess: function(transport){
		$('idTable').innerHTML = transport.responseText || "ошибка получения данных";
    }
	});
}

function preview(t, v)
{
	new Ajax.Request('http://www.podplayer.ru/preview/',
	{ 
    method:'post',
    parameters:{t:$(t).value},
    onSuccess: function(transport){
		$(v).innerHTML = transport.responseText || "ошибка получения данных";
    }
	});
}

function sa(id)
{
	$('ids'+id).innerHTML = '<form method="POST" id="idfrm'+id+'"><input type="hidden" name="p" value="'+id+'"><table class="cc"><tr><td><textarea name="t" cols="80" rows="6"></textarea></td></tr><tr><td><a href="#" class="btn" style="margin-right:18px"><span>предпросмотр</span></a><a href="javascript:$(\'idfrm'+id+'\').submit()" class="btn"><span>добавить</span></a></td></tr></table></form>';
}
