﻿
var _cw;
var _ShowBlogPosts = true;
var _ShowForumThreads = true;
var _ShowReleases = true;
var _ShowSearchBox = true;
var _NumberOfItemsToShow = 3;

var URL_GETCONTENTWIDGET = FSTPATH + 'callbacks/contentwidget.aspx';

function fst_GetContentWidget()
{
    // set the content widget variable
    if($('fstContentWidget'))
    {
        _cw = $('fstContentWidget');
                
        if(_cw)
        {
            // go get the users rating for this item (using post so it doesn't cache the response)
	        new Ajax.Request(URL_GETCONTENTWIDGET,
	        {
	          method: 'post',
	          parameters: { sbp: _ShowBlogPosts, sft: _ShowForumThreads, sr: _ShowReleases, ssb: _ShowSearchBox, items: _NumberOfItemsToShow },
	          onSuccess: function(transport)
		        {
			        fst_ShowContentWidget(transport.responseText)
		        },
	          onFailure: function()
		        {
			        alert('Error retrieving content');
		        }
	        });
	    }
	}
}

function fst_ShowContentWidget(val)
{        
    if($('fstContentWidget') && val != '')
    {
        $('fstContentWidget').innerHTML = val;
    }
}
