﻿
//for left side news and blogs
$(document).ready(function () {
    var blogContent = "";
    var i = 0;
    for (i = 0; i < 2; i++) {
        blogContent += "<div class=\"Date1\" onclick='csGATracking(\"FeedsLinkClick\",\"SpecificBlogLinkClick\"); GoToBlog(\"" + blogFeedObject[i].Title + "\"," + blogFeedObject[i].ID + ")'>" + blogFeedObject[i].Title + "</div>";
        blogContent += "<div class=\"Date1Span\">" + blogFeedObject[i].Summary + "</div>";
    }
   $("#contentForBlogs").html(blogContent); 
    
    var newsContent = "";
        var i = 0;
        for (i = 0; i < 2; i++) {
            newsContent += "<div class=\"Date1\" onclick ='csGATracking(\"FeedsLinkClick\",\"SpecificNewsLinkClick\");GoToNews(\"" + newsFeed[i].Title +"\","+newsFeed[i].ID+ ")'>" + newsFeed[i].Title + "</div>";
            newsContent += "<div class=\"Date1Span\">" + newsFeed[i].Summary + "</div>";
        }
        $("#contentForNews").html(newsContent);
});

    function GoToBlog(Title, id) {
        var title = encodeURIComponent(Title.replace('#', '%23').replace(/ /g, '-').toLowerCase());
        window.location = 'Blog.aspx?id=' + id + '&b=/azure/' + title;

}

function GoToNews(Title, id) {
    var title = encodeURIComponent(Title.replace('#', '%23').replace(/ /g, '-').toLowerCase());
    window.location = 'AboutUs.aspx?p=1&id=' + id + '&news=/azure/' + title;

}

//function WriteBlogItem(id) {
//    var blogContent2 = "";
//    $.each(blogFeedObject, function (index, currentItem) {
//        if (currentItem.ID == id) {
//            blogContent2 += "<div class=\"DateAbout\">" + currentItem.Date + "</div>";
//            blogContent2 += "<div class=\"DateAboutTitle\">" + currentItem.Title + "</div>";
//            blogContent2 += "<div class=\"DateAboutSpan\">" + currentItem.FullText + "</div>";
//        }
//    });
//    $("#BlogTitle").html(blogContent2);
//}



