jQuery(document).ready(function ($) {
	$('.blog .basicList').empty();
	$.getJSON(
		'./inc/php/feed2json.php',
		{
			id: 'ntecj',
			limit: '3'
		},
		function (json) {
			var list = $('<ul/>').addClass('basicList');
			$.each(json.items, function () {
				$(list).append(
					$('<li/>').append(
						$('<span/>').text(dateChanger(this.pubDate)),
						$('<a/>').attr({ href: this.link, target: '_blank' }).text(this.title)
					)
				);
			});
			$('.blog > a:eq(0)').after(list);
		}
	);
	$.getJSON(
		'./inc/php/feed2json.php',
		{
			id: 'ntecnosaka',
			limit: '3'
		},
		function (json) {
			var list = $('<ul/>').addClass('basicList');
			$.each(json.items, function () {
				$(list).append(
					$('<li/>').append(
						$('<span/>').text(dateChanger(this.pubDate)),
						$('<a/>').attr({ href: this.link, target: '_blank' }).text(this.title)
					)
				);
			});
			$('.blog > a:eq(1)').after(list);
		}
	);
	$.getJSON(
		'./inc/php/feed2json.php',
		{
			id: 'ntecjyokom',
			limit: '3'
		},
		function (json) {
			var list = $('<ul/>').addClass('basicList');
			$.each(json.items, function () {
				$(list).append(
					$('<li/>').append(
						$('<span/>').text(dateChanger(this.pubDate)),
						$('<a/>').attr({ href: this.link, target: '_blank' }).text(this.title)
					)
				);
			});
			$('.blog > a:eq(2)').after(list);
		}
	);
	$.getJSON(
		'./inc/php/feed2json.php',
		{
			id: 'ntecjjiji',
			limit: '3'
		},
		function (json) {
			var list = $('<ul/>').addClass('basicList');
			$.each(json.items, function () {
				$(list).append(
					$('<li/>').append(
						$('<span/>').text(dateChanger(this.pubDate)),
						$('<a/>').attr({ href: this.link, target: '_blank' }).text(this.title)
					)
				);
			});
			$('.blog > a:eq(3)').after(list);
		}
	);
	var dateChanger = function (str) {
		var mydate = new Date(str);
		yy = mydate.getFullYear() % 100;
		mm = mydate.getMonth() + 1;
		dd = mydate.getDate();
		if (mm < 10) { mm = '0' + mm; }
		if (dd < 10) { dd = '0' + dd; }
		return yy + '.' + mm + '.' + dd;
	};
});
