//Fetch list of articles
function ajaxLoadArticleList( typeId, orderBy , notFrontPage, limit )
{
	ajaxLoader();

	if( typeof( typeId ) == "undefined" )
		typeId = 0;
	if( typeof( orderBy ) == "undefined" )
		orderBy = "";

	new Ajax.Updater( "ajax-article-container", "/artiklar/ajax_front_articles.php", {
		parameters: {
			typeId: typeId,
			orderBy: orderBy,
			notFrontPage: notFrontPage,
			limit: limit
		}
	} );
}

function ajaxLoader()
{
	//Add container with ajax-image
	$( "ajax-article-container" ).update(
		new Element( "div", { style: "padding: 40px 0; text-align: center;" } ).insert(
			new Element( "img", { src: "/gfx/ajax-loader.gif" } )
		)
	);
}

function displayCarouselArticle( nr )
{
	var i = 0;

	$$( "div[class*=carousel-image]" ).each(
		function( obj )
		{
			if( i == nr )
				obj.show();
			else
				obj.hide();

			i++;
		}
	);
}
