﻿/*function GetPerson(personId) {
    var params = {
        PersonID: personId
    };
    $.ajax({
        type: "POST",
        url: "/KermanCoWeb/WebServices/WebMethods.aspx/GetPerson",
        data: JSON.stringify(params),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: onGetSuccess,
        error: function (msg) {
            var x = 1;
            // Do something interesting here.
        }
    });
}*/

//function onGetSuccess(response, options) {
//    var myReq = response;
//    var myOptions = options;
//    $('#dvPersonDetail').html(response.d);
//}


$(window).load(function(){
	var test = false;
	if (window.location.href.indexOf('test=1') >= 0)
		test = true;
		
		
	/*if (window.location.href.indexOf('?item=') >= 0 || window.location.href.indexOf('?article=') >= 0) {
		if (test) alert('t1');
		var t = setTimeout (initializeNewsArticle, 1000 );
		if (test) alert('t2');
	}*/
	
    $(".lnkPersonDetail").click(function (event) {
        event.preventDefault();
//        GetPerson($(this).attr("data-personid"));
    });

    $(".lnkRSSDescription").click(function (event) {
        event.preventDefault();
        $("#dvRssDetail").html($(this).parent().parent().find('.spRSSDescription').html());
        $("#dvArticles").hide();
        $("#RSSViewList").show();
		$("#dvRSSDetailWrapper").show();
    });

    $("#RSSViewList").click(function (event) {
        event.preventDefault();
        $("#dvArticles").show();
        $("#dvRssDetail").html('');
        $("#RSSViewList").hide();
		$("#dvRSSDetailWrapper").hide();
    });
	
	
    //$("#RSSViewList").hide();
	

});

function initializeNewsArticle() {
	$("#RSSViewList").show();
	$("#dvArticles").hide();
	$("#dvRSSDetailWrapper").show();
}
