
N_CURRENT_PAGE		= 0;

function getEl(sId) {
  return (document.all? document.all(sId): (document.getElementById? document.getElementById(sId): null));
};

function loadPhotoBlog( nPages )
{
	if ( nPages > 1 && N_CURRENT_PAGE < nPages - 1 )
	{
		getEl('next').style.display = 'block';
		getEl('next').href 	= 'javascript:switchPhoto('+ ( N_CURRENT_PAGE + 1 ) +', '+ nPages +');';
		if ( N_CURRENT_PAGE == 0 )
		{
			getEl('previous').style.display = 'block';
			getEl('previous').href 	= 'javascript:switchPhoto('+ ( nPages - 1 ) +', '+ nPages +');';
		}
		else {
			getEl('previous').style.display = 'block';
			getEl('previous').href 	= 'javascript:switchPhoto('+ ( N_CURRENT_PAGE - 1 ) +', '+ nPages +');';
		}
	}
	else {
		if ( N_CURRENT_PAGE == nPages - 1 )
		{
			getEl('previous').href 	= 'javascript:switchPhoto('+ ( N_CURRENT_PAGE - 1 ) +', '+ nPages +');';
		}
		getEl('next').style.display = 'block';
		getEl('next').href 	= 'javascript:switchPhoto('+ ( 0 ) +', '+ nPages +');';
	}
}

function switchPhoto( sPic, nPages )
{
	//getEl( 'currentPhoto' ).src = eval( 'photo'+ sPic + '.src' )
	//getEl('currentPhotoLink').href	= eval( 'photo'+ sPic + 'SRC' );
	//getEl('currentPhotoLink').title	= eval( 'photo'+ sPic + 'TITLE' );
	getEl('boxPhoto'+ N_CURRENT_PAGE ).style.display = 'none';
	getEl('boxPhoto'+ sPic ).style.display = 'block';
	N_CURRENT_PAGE			= sPic;
	loadPhotoBlog( nPages );
}
