$(function(){
	if(location.href != 'http://tenex.ru/en/'){
		$(document).bind('keydown', NavigateThrough);
	}
	
	function NavigateThrough(e)
	{
		if (e.ctrlKey)
		{
			
			var link = null;
			var href = null;
			switch (e.keyCode ? e.keyCode : e.which ? e.which : null)
			{
					//case 0x26:
					// link = $('#previous').attr('href');
					// break;
				// case 0x28:
				// 	link = $('#nextius').attr('href');
				// 	break;
				case 0x27:
					link = $('#next_article').attr('href');
					break;
				case 0x25:
					link = $('#previous_article').attr('href');
					break;
				case 0x26:
					// var locHref = location.href;
					// var alink = locHref.split('/');
					// link = locHref.split(alink[alink.length - 2])[0];
					var str = location.href;
					str = str.substr(0, str.length - 1);
					var array = str.split("/");
					array.pop();
					link = array.join("/") + "/";
					break;
				case 0x24:
					link = $('#startius').attr('href');
					break;
			}
			if (link) document.location = link;
			if (href) document.location = href;
		}			
	}
});




