﻿/// <reference name="MicrosoftAjax.js"/>
/// <reference name="/js/common.js"/>

// *************************** ARTICLE ONLY FUNCTIONS *************************** //

function getArticle(articleId, catId, UcId) {
    pageBusy.show(UcId + "_dlProductList");
    API.get_articleDetails(articleId, catId, true, true, get_articleDetails_ServerReturn, OnError_ServerReturn, { "UcId": UcId });
}
function get_articleDetails_ServerReturn(ArticleDetails, args) {
    pageBusy.hide(args.UcId + "_dlProductList");

    var divFullArticle = $get(args.UcId + "_divFullArticle");
    divFullArticle.innerHTML = (ArticleDetails != null && ArticleDetails.HTML != null) ? ArticleDetails.HTML : "";
    divFullArticle.style.display = (ArticleDetails == null) ? "none" : "";

    $get(args.UcId + "_articleLinks").style.display = (ArticleDetails == null) ? "none" : "";
    $get(args.UcId + "_dlProductList").style.display = (ArticleDetails == null) ? "" : "none";
    $get(args.UcId + "_linkToArticle").href = String.format("/articles/?a={0}", ArticleDetails.ArticleId)

    if ($get("topOfList") != null) window.location.hash = "topOfList";
}
function showList(UcId) {
    $get(UcId + "_articleLinks").style.display = "none";
    $get(UcId + "_divFullArticle").style.display = "none";
    $get(UcId + "_dlProductList").style.display = "";
}


if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

