
var RecentProjectUI={currentIndex:1,total:1,groups:1,disableNav:function(val)
{if(val===true)
{$('div.recent-projects-nav a.prev,div.recent-projects-nav a.next').unbind('click').click(function(){return false;});}
else
{$('div.recent-projects-nav a.prev').click(RecentProjectUI.onNextClick);$('div.recent-projects-nav a.next').click(RecentProjectUI.onPrevClick);}},updateNav:function()
{if(RecentProjectUI.currentIndex<=1)
{$('div.recent-projects-nav a.prev').hide();}
else
{$('div.recent-projects-nav a.prev').show();}
if(RecentProjectUI.currentIndex+2>=RecentProjectUI.total)
{$('div.recent-projects-nav a.next').hide();}
else
{$('div.recent-projects-nav a.next').show();}},onPrevClick:function()
{if(RecentProjectUI.currentIndex<RecentProjectUI.total)
{RecentProjectUI.disableNav(true);var remains=RecentProjectUI.total-RecentProjectUI.currentIndex-2;var left=parseInt($('div.recent-projects-cnt').css('left'),10);if(remains>=3)
{RecentProjectUI.currentIndex+=3;left=left-549;}
else
{RecentProjectUI.currentIndex+=remains;left=left-(183*remains)}
$('div.recent-projects-cnt').animate({left:left},900,function()
{RecentProjectUI.disableNav(false);});if(RecentProjectUI.currentIndex>RecentProjectUI.total)
{RecentProjectUI.currentIndex=RecentProjectUI.total;}
RecentProjectUI.updateNav();}
return false;},onNextClick:function()
{if(RecentProjectUI.currentIndex>1)
{RecentProjectUI.disableNav(true);var remains=RecentProjectUI.currentIndex-1;var left=parseInt($('div.recent-projects-cnt').css('left'),10);if(remains<3)
{RecentProjectUI.currentIndex-=remains;left=left+(183*remains);}
else
{RecentProjectUI.currentIndex-=3;left=left+549;}
$('div.recent-projects-cnt').animate({left:left},900,function()
{RecentProjectUI.disableNav(false);});RecentProjectUI.updateNav();}
return false;},init:function(total)
{RecentProjectUI.total=total;if(total<=3)
{$('div.recent-projects-nav a.prev,div.recent-projects-nav a.next').hide();}
else
{$('div.recent-projects-nav a.prev').hide();}
$('div.recent-projects-nav a.prev').click(RecentProjectUI.onNextClick);$('div.recent-projects-nav a.next').click(RecentProjectUI.onPrevClick);$('div.recent-projects-cnt').css('position','absolute').css('top',0).css('left',0);}};
