	function FixMargin(left) 
	{
		jQuery(this).css("left", left);
	}

	function initHomeScroll(iTotalItems) 
	{
		var pageWidth = 700;
		var MinWidth = Math.floor(iTotalItems / 7);


		// left buttons is disabled at start
		jQuery('#leftbutton').hide();
		
		if( (iTotalItems % 7) > 0 )
			MinWidth = MinWidth + 1;

		MinWidth = ((MinWidth * pageWidth) - pageWidth)*-1;

		jQuery('#rightbutton').click(function () 
		{
		    var left = parseInt(jQuery("#scrollable_icons_content").css('left'), 10);
		    if( left > MinWidth )
	    	{
		    	jQuery("#scrollable_icons_content").animate({ left: left - pageWidth }, 400, FixMargin(left - pageWidth));
		    	
		    	jQuery('#leftbutton').show();
	    	}
		    if( (left - pageWidth) <= MinWidth ) 
		    {
		    	jQuery("#rightbutton").hide();
		    }
		});

		jQuery('#leftbutton').click(function () 
		{
		    var left = parseInt(jQuery("#scrollable_icons_content").css('left'), 10);
		    if( left < 0 )
		    {
		    	jQuery("#scrollable_icons_content").animate({ left: left + pageWidth }, 400, FixMargin(left + pageWidth));
		    }
		    
		    if( (left + pageWidth) <= 0 ) jQuery('#leftbutton').hide();
		    if( (left + pageWidth) > MinWidth ) jQuery("#rightbutton").show();
		});

	}	
