/*var ivanVar = "ivanVal";
var ivanVal = 2;*/
function BestOf_Load(container, loadingContainer, limit, showviewall, filtertype, sourcetype) {
        var params = "limit=" + limit + "&showviewall=" + showviewall + "&filtertype=" + filtertype + "&sourcetype=" + sourcetype;
        
        BestOf_Loading(true, container, loadingContainer);
        var req = new Ajax.Request('/AJAX/PostPages/Syndication/BestOfPost.aspx', 
                                   { method: 'post', 
                                     parameters: params, 
                                     onSuccess: function(AJAXResponse) {   BestOf_Populate(AJAXResponse, container, loadingContainer); } 
                                   });
    }

function BestOf_Loading(show, container, divLoading) {
        if (show) {
            $_(divLoading).style.display = 'block';
            $_(container).style.display = 'none';
        }
        else {
            $_(divLoading).style.display = 'none';
            $_(container).style.display = '';
        }
    }
    
    
function BestOf_Populate(AJAXResponse, container, loadingDiv) {
    BestOf_Loading(false, container, loadingDiv);
    if (AJAXResponse.status == 200) 
        $_(container).innerHTML = AJAXResponse.responseText;
    else 
        $_(container).innerHTML = "Error loading also viewed, please refresh your browser";
}

function BestOf_HiglightTabs(tab, defaultId){		
    if(this[defaultId] == null)
        this[defaultId] = $_(defaultId);
    
    this[defaultId].style.color = '#2a5a88';
    this[defaultId].style.fontWeight = '';
    this[defaultId] = tab;
    this[defaultId].style.color = '#000000';
    this[defaultId].style.fontWeight = 'bold';	
}
