
// Scrolling functions for the Nail Style Gallery

var iFirstStyle = Number(1);
var iStyleCount = Number(8);

function ScrollStylesLeft( ) {
	if ( iFirstStyle > 1 ) {
		iFirstStyle -= 1;
	}	
	UpdateStylesDisplay();
}


function ScrollStylesRight( ) {
	if ( iFirstStyle <= ( iStyleCount - 5 ) ) {
		iFirstStyle += 1;
	}
	UpdateStylesDisplay();
}

function UpdateStylesDisplay( ) {
	// Update the styles
	for ( i=1; i<=8; i++ ) {
		DocumentObject( 'gallery-style-'+i, true ).display = ( ( i>=iFirstStyle ) &&  ( i<(iFirstStyle+5) ) ) ? 'block' : 'none';
	}
	// Update the arrows
	document.images['left-arrow'].src = ( iFirstStyle > 1 ) ? '/Global/images/small-red-arrow-left.gif' : '/Global/images/blank.gif';
	document.images['right-arrow'].src = ( iFirstStyle <= ( iStyleCount - 5 ) ) ? '/Global/images/small-red-arrow.gif' : '/Global/images/blank.gif';
}


// Photo functions for the style landing pages
var iFashionPhoto = Number( 0 );

function FashionPhotoLeft( ) {
	iFashionPhoto = ( iFashionPhoto + g_iFashionPhotoCount - 1 ) % g_iFashionPhotoCount;
	UpdateFashionPhoto();
}

function FashionPhotoRight( ) {
	iFashionPhoto = ( iFashionPhoto + 1 ) % g_iFashionPhotoCount;
	UpdateFashionPhoto();
}

function UpdateFashionPhoto( ) {
	for ( i=1; i<=g_iFashionPhotoCount; i++ ) {
		DocumentObject( 'fashion-photo-'+i, true ).display = ( i==(iFashionPhoto+1) ) ? 'inline' : 'none';
	} 
}
