﻿function getRSS(feedUrl) {
    $("#rssContent").empty();

    $.get('proxy.php?url=' + feedUrl, function(data) {
    $('#indicator').hide();
        $(data).find('item').each(function() {

            var title = $(this).find('title').text();
      
            var url = $(this).find('link').text();
      
            var description = $(this).find('description').text();
      
            var pubDate = $(this).find('pubDate').text();

            var html;
	html = "<div class=\"contentdiv\">";
            html += "<div class=\"rama\"><div class=\"entry\"><h2 class=\"postTitle\">" + "<a href=\"" + url + "\" target=\"_blank\">"+title+"<\/a><\/div>" + "<\/h2>";
            html += "<div class=\"mini\" align=\"right\">" + pubDate + "</div>";
            html += "<div class=\"description\">" + description + "</div></div>";
	html += "</div>";

            $('#rssContent').append($(html));
        });
var jshtml;
jshtml = "<div id=\"paginate-rssContent\" class=\"apagination\">";
$("#rssContent2").empty();
$('#rssContent2').append($(jshtml));
jshtml = "<script type=\"text/javascript\">";
jshtml += "featuredcontentslider.init({";
jshtml += "id: \"rssContent\",";
jshtml += "contentsource: [\"inline\", \"\"],";
jshtml += "toc: \"#increment\",";
jshtml += "nextprev: [\"Previous\", \"Next\"], ";
jshtml += "enablefade: [true, 0.2], ";
jshtml += "autorotate: [false, 3000], ";
jshtml += "onChange: function(previndex, curindex){ ";
jshtml += "}";
jshtml += "})";
jshtml += "</script>";
$('#rssContent').append($(jshtml));
    });
}

$(document).ready(function() {
    $('#indicator').show();
    getRSS("http://premier.gov.ru/services/rss/");
})

