﻿function writeNews(strTitle, strFunction) {
    
    //Return Functional Description Text for the function passed in
    //http://www.asp101.com/articles/michael/dynamicincludes/default.asp

    //var newsTitle = strFunction.substring(0, strFunction.length - 4);

    var newsTitle = strTitle;

    document.getElementById("news_title").innerHTML = newsTitle;
    PageMethods.GetFileContents(strFunction, CallSuccess, CallFailed);
}

// set the destination textbox value with the ContactName
function CallSuccess(res) {
    document.getElementById("news_text").innerHTML = res;
}

// alert message on some failure
function CallFailed(res, destCtrl) {
    alert(res.get_message());
}


