﻿// JScript File

var DetailCategory = "";
var ALinkCatStringList = "";

function Initialize(linkString)
{
    ALinkCatStringList = linkString;
    aLinkDetailShow(linkString.substring(0,1));
}
function QueryUrl(obj,baseUrl)
{
    obj.href = baseUrl + document.getElementById("psIdALinkSearchInput").value;
}

function aLinkDetailShow(detailCategory) 
{
    if (detailCategory == "off")
    {
        document.getElementById("psIdAlinkDetailFrame").style.visibility = 'hidden';
        IsExpanded = 0;
        HideAllCategories();
        DetailCategory = "";
        //if (parent.window.ExpandedAlink != null)
        //    parent.window.ExpandedAlink.style.overflow="hidden";
    }
    else
    {
       //if (parent.window.ExpandedAlink != null)
       //         parent.window.ExpandedAlink.style.overflow="visible";
        IsExpanded = 1;
        document.getElementById("psIdAlinkDetailFrame").style.visibility = 'visible';
        DetailCategory = detailCategory;
        id = document.getElementById("psId"+DetailCategory);
        HideAllCategories();
        id.style.height = "200px";
        

    }
        
    return false;
}

function HideAllCategories()
{
    var id;
   for (var i= 0 ; i < ALinkCatStringList.length; i++)
    {
        cat = ALinkCatStringList.substring(i,i+1);
        id = document.getElementById("psId"+cat);
        id.style.height = "0px";
     }
     
}
function HideFooterImg()
{
   var o =  document.getElementById("psIdImgFooter");
    if (o != null)
    {
           o.style.visibility="hidden";
    }
 
}

function ShowFooterImg(imgURL,className)
{   
    var o =  document.getElementById("psIdImgFooter");
    if (o != null)
    {
        if (imgURL == "")
        {
            o.style.visibility="hidden";
        }
        else
        {   
            o.src = imgURL;
            o.className=className;
            o.style.visibility="visible";
        
        }
    }
    
}