	
		// JavaScript Document
window.addEvent('domready', function() {

	var container = $('staffitems');
	var pageid = '138';
	var pagenum = $('global_pagenum');

	var _showMoreStaff = function()
	{
	  var request =  new Request.JSON({
	  method: 'post',
	  url: '/remoting/getItems.php',
		  onRequest: function() {
				  $('showmore_btn').empty();
				  $('showmore_btn').innerHTML = 'Loading..';
		  },
		  onComplete: function(details){
			  $('showmore_btn').empty();
			  $('showmore_btn').innerHTML = 'Show more';
			  formatHTML(details);
		  }
	  }).send('pageid='+pageid+'&pagenum='+pagenum.value+'&imgprefix=small_&limit=6&orderby=keywords_itm ASC');
	}
  
	var formatHTML = function(details)
	{				
		if(details != null) {
			var count = 0;
			  details.each(function(detail) 
			  {		
			  	
								
		var html  = '<div class="feat_small" id="staff'+count+'" url="'+detail.link+'" title="'+detail.title+'" style="float:left;">';
     	html += '<div class="feat_placeholder">';
        html += '<div class="feat_img"><img src="'+detail.img+'" width="89" height="82" alt="'+detail.title+'" /></div>';
        html += ' </div>';
        html += '<div class="highlight"><div class="feat_text"><h3>'+detail.permalink+'</h3>'+detail.body+'</div></div>';
        html += '<div class="clear"></div>';
    	html += '</div>';
					
			
							
				container.innerHTML = container.innerHTML+html;
				
				var display = (detail.lastpage==(parseInt(pagenum.value)+1))? "none" : "block";
				$('showmore_btn').setStyle('display',display);
				count++;
			  });
		}
		pagenum.value = parseInt(pagenum.value)+1;
		initModuleEvents();
	}
	
	$('showmore_btn').addEvents({
		'click': _showMoreStaff
		});
		
	_showMoreStaff();

});


