
//-----------------------------------------------------------------------------------------
//Objet comportant toute la description de l'image

function InfoImageDesc ( strLegendeImage, strTitreImage, strCopyrightImage, strPhotographeImage, strDateImageLong, strURLLinkToImageThumb, strURLLinkToImagePreview, strVilleImage, strPaysImage, strMotsClesImage, strCreditImage, bAff_TitreImage, bAff_VilleImage, bAff_PaysImage, bAff_DateImage, bAff_LegendeImage, bAff_MotsClesImage, bAff_PhotographeImage, bAff_CreditImage, bAff_CopyrightImage)
{
	
	this.m_strLegendeImage = strLegendeImage;

	this.m_strTitreImage = strTitreImage;
	
	this.m_strCopyrightImage = strCopyrightImage;
	
	this.m_strPhotographeImage = strPhotographeImage;
	
	this.m_strDateImageShort = 0;
	
	this.m_strDateImageLong = strDateImageLong;
	
	this.m_strURLLinkToImageThumb = strURLLinkToImageThumb;
	
	this.m_strURLLinkToImagePreview = strURLLinkToImagePreview;
	
	this.m_strVilleImage = strVilleImage;
	
	this.m_strPaysImage = strPaysImage;
	
	this.m_strMotsClesImage = strMotsClesImage;
	
	this.m_strCreditImage = strCreditImage;
	
	this.m_bAff_TitreImage = bAff_TitreImage;
	
	this.m_bAff_VilleImage = bAff_VilleImage;
	
	this.m_bAff_PaysImage = bAff_PaysImage;
	
	this.m_bAff_DateImage = bAff_DateImage;
	
	this.m_bAff_LegendeImage = bAff_LegendeImage;
	
	this.m_bAff_MotsClesImage = bAff_MotsClesImage;
	
	this.m_bAff_PhotographeImage = bAff_PhotographeImage;
	
	this.m_bAff_CreditImage = bAff_CreditImage;
	
	this.m_bAff_CopyrightImage = bAff_CopyrightImage;

	this.GetLegendeImage = function ( )    { return ( this.m_strLegendeImage ); }

	this.GetTitreImage = function ( )  { return ( this.m_strTitreImage ); }
	
	this.GetCopyrightImage = function ( )  { return ( this.m_strCopyrightImage ); }
	
	this.GetPhotographeImage = function ( )  { return ( this.m_strPhotographeImage ); }
	
	this.GetDateImageShort = function ( )  { return ( this.m_strDateImageShort ); }
	
	this.GetDateImageLong = function ( )  { return ( this.m_strDateImageLong ); }
	
	this.GetURLLinkToImageThumb = function ( )  { return ( this.m_strURLLinkToImageThumb ); }
	
	this.GetURLLinkToImagePreview = function ( )  { return ( this.m_strURLLinkToImagePreview ); }
	
	this.GetVilleImage = function ( )  { return ( this.m_strVilleImage ); }
	this.GetPaysImage = function ( )  { return ( this.m_strPaysImage ); }
	this.GetMotsClesImage = function ( )  { return ( this.m_strMotsClesImage ); }
	this.GetCreditImage = function ( )  { return ( this.m_strCreditImage ); }
	this.GetAff_TitreImage = function ( )  { return ( this.m_bAff_TitreImage ); }
	this.GetAff_VilleImage = function ( )  { return ( this.m_bAff_VilleImage ); }
	this.GetAff_PaysImage = function ( )  { return ( this.m_bAff_PaysImage ); }
	this.GetAff_DateImage = function ( )  { return ( this.m_bAff_DateImage ); }
	this.GetAff_LegendeImage = function ( )  { return ( this.m_bAff_LegendeImage ); }
	this.GetAff_MotsClesImage = function ( )  { return ( this.m_bAff_MotsClesImage ); }
	this.GetAff_PhotographeImage = function ( )  { return ( this.m_bAff_PhotographeImage ); }
	this.GetAff_CreditImage = function ( )  { return ( this.m_bAff_CreditImage ); }
	this.GetAff_CopyrightImage = function ( )  { return ( this.m_bAff_CopyrightImage ); }

}


//-----------------------------------------------------------------------------------------
//Objet comportant tout les infos de l'image ( Lien + description)

function InfoImageFull ( nImageId, strImageCode, nNumImage, oImageInfo, width, height )
{

	this.m_nImageId = nImageId;

	this.m_strImageCode = strImageCode;
	
	this.m_nNumImage = nNumImage;
	
	this.m_oImageInfo = oImageInfo;
	
	this.m_strImageWidth = width;
	
	this.m_strImageHeight = height;

	this.GetImageId = function ( )    { return ( this.m_nImageId ); }

	this.GetImageCode = function ( )  { return ( this.m_strImageCode ); }
	
	this.GetNumImage = function ( )  { return ( this.m_nNumImage ); }
	
	this.GetImageInfo = function ( )  { return ( this.m_oImageInfo ); }
	
	this.GetImageWidth = function ( )  { return ( this.m_strImageWidth ); }
	
	this.GetImageHeight = function ( )  { return ( this.m_strImageHeight ); }

}
 

 //-----------------------------------------------------------------------------------------

function ImagesList ( ) 
{

	this.m_tabImage =  new Array();


	this.GetNbImages = function ( ) { return ( this.m_tabImage.length  + 0 ); }


	this.AddImage = function ( oNewRecord ) 
	{ 

		this.m_tabImage[this.m_tabImage.length] = oNewRecord; 

	}


	this.GetImage = function ( nNumRecord ) 
	{

		if ( ( nNumRecord >= 0 ) && ( nNumRecord < this.GetNbImages ( ) ) ) 
		{

			return ( this.m_tabImage[nNumRecord] );
			
		}

		return ( null );

	}


	this.SetImage = function ( nNumRecord, oRecord ) 
	{

		if ( ( nNumRecord >= 0 ) && ( nNumRecord < this.GetNbImages ( ) ) ) 
		{

			this.m_tabImage[nNumRecord] = oRecord;

		}

	}



	this.GetImageFromId = function ( nRecordId ) 
	{

		var nNbImages;

		var nNumRecord;


		nNbImages = this.GetNbImages ( );


		for ( nNumRecord=0; nNumRecord<nNbImages; nNumRecord++ )
		{

			var oRecord;


			oRecord = this.GetImage ( nNumRecord );


			//- alert ( " oRecord : " + oRecord.GetImageId ( ) + " / " + oRecord.GetImageName ( ) );


			if ( nRecordId == oRecord.GetImageId ( ) ) 
			{

				return ( oRecord );

			}

		}

		return ( null );

	}



	this.DeleteImage = function ( nNumImage )
	{

		var nNbElements;

		var nNumElement;


		nNbElements = this.m_tabImage.length;

		for ( nNumElement = nNumImage; nNumElement < nNbElements-1; nNumElement++)
		{
			this.m_tabImage[nNumElement] = this.m_tabImage[nNumElement+1]

		}


		this.m_tabImage.length = this.m_tabImage.length - 1;

		//- this.m_tabImage.remove ( nNumImage );
	}

}
