function portfolioRotatorInit()
{
	var ajax			= new sack();
	
	ajax.requestFile	= "portfolio.php";
	ajax.method			= "GET";
	ajax.element		= "portfolio_rotate_hidden";
	ajax.onCompletion	= finishPortfolioRotator;
	
	ajax.runAJAX();
}

function portfolioRotator()
{
	var ajax			= new sack();
	
	ajax.requestFile	= "portfolio.php";
	ajax.method			= "GET";
	ajax.element		= "portfolio_rotate_hidden";
	ajax.onCompletion	= pausePortfolioRotator;
	
	ajax.runAJAX();
}

function pausePortfolioRotator()
{
	setTimeout( 'finishPortfolioRotator()', 3000 );
}

function finishPortfolioRotator()
{
	document.getElementById( 'portfolio_rotate_div' ).innerHTML	= document.getElementById( 'portfolio_rotate_hidden' ).innerHTML;
	
	//document.getElementById( 'portfolio_rotate_link' ).href		= document.getElementById( 'portfolio_rotate_href' ).href;
	//document.getElementById( 'portfolio_rotate_link' ).target	= document.getElementById( 'portfolio_rotate_href' ).target;

    document.getElementById( 'portfolio_rotate_link' ).href      = 'index.php/component/option,com_portfolio/';
    document.getElementById( 'portfolio_rotate_link' ).target    = '_top';

	setTimeout( 'portfolioRotator()', 3000 );
}

portfolioRotatorInit();