document.onkeydown = ProcessEvent;
function ProcessEvent(e)
{
	var code;
	if (!e) e = window.event;
	if (e.keyCode) code = e.keyCode;
	else if (e.which) code = e.which;
	if ((code == 37) && (e.ctrlKey == true)) {
		var destination = document.getElementById('prev_page');
		if (destination) location.href = destination.href;
	}
	if ((code == 39) && (e.ctrlKey == true)) {
		var destination = document.getElementById('next_page');
		if (destination) location.href = destination.href;
	}
	if ((code == 38) && (e.ctrlKey == true)) {
		var destination = document.getElementById('page_up');
		if (destination) location.href = destination.href;
	}
}

function TopicGo(lng, mode)
{
	var topic_id = document.getElementById('topic_selector').value;
	destination = 'topic.php?lng=' + lng + '&top_id=' + topic_id + '&mode=' + mode;
	location.href = destination;
}

function TopicGo_v2(lng, skin, mode)
{
	var topic_id = document.getElementById('topic_selector').value;
	destination = 'topic.php?lng=' + lng + '&skin=' + skin + '&top_id=' + topic_id + '&mode=' + mode;
	location.href = destination;
}
