// JScript File
   function Headlines_LoadAlsoViewed(container, loadingContainer, symbol, filter) {
        var params = 's=' + symbol+"&filter="+filter;
        
        Headlines_Loading(true, container, loadingContainer);
       
        var req = new Ajax.Request('/Ajax/Syndication/Headlines.aspx', 
                                   { method: 'post', 
                                     parameters: params, 
                                     onSuccess: function(AJAXResponse) 
                                            {   
                                                Headlines_PopulateAlsoViewed(AJAXResponse, container, loadingContainer); 
                                            } 
                                   
                                    ,
                                    onFailure: function(AJAXResponse)
                                            {
                                                Headlines_Loading(false, container, loadingContainer);
                                                document.getElementById(container).innerHTML = "Error loading also viewed, please refresh your browser";
                                            } 
                                   
                                   });
                                   

    }
    
    function Headlines_Loading(show, container, divLoading) 
    {
        _divLoading = document.getElementById(divLoading); 
        _container = document.getElementById(container); 
        
        if (show)
        {
            _divLoading.style.display = 'block';
            _container.style.display = 'none';
        }
        else 
        {
            _divLoading.style.display = 'none';
            _container.style.display = '';
        }
    }
    
    
    function Headlines_PopulateAlsoViewed(AJAXResponse, container, loadingDiv) 
    {
        Headlines_Loading(false, container, loadingDiv);
        _container = document.getElementById(container); 
        if (AJAXResponse.status == 200) 
        {
            _container.innerHTML = AJAXResponse.responseText;
        }
        else 
        {
            _container.innerHTML = "Error loading also viewed, please refresh your browser";
        }
    }

