
Ext.onReady(function(){
	homeBuildBar( 8,'recent')
});
  
function homeBuildBar(num, type)
{
	Ext.get('photobarContainer').dom.innerHTML = '';
    startSpinner( 'home_getlist', 'photobarContainer');
    Ext.Ajax.request({
        url: 'ajax.Backend.php',
        params: {'function': 'getPhotoBarPhotos',
        'count': num,
        'type': type
        },
        success: function(transport, options) {
            stopSpinner( 'home_getlist', 'photobarContainer');
            resp = new Response(transport, options);
            if( resp.success() )
            {
                Ext.get('photobarContainer').dom.innerHTML = resp.getText();
            }
        },
        failure:  function(){
            resp = new Response("", "function=getPhotoBarPhotos");
            stopSpinner( 'home_getlist', 'photobarContainer');
            resp.showError("Error: Our Server cannot be reached. Is server down? Please try again.");
        }
    });
}