/* **************************************
                Object : SiteServer
--------------------------------------------------
 Version :
     1.0 - 080218 - KIG
 Description :
    Permet d associer a l url d'un site, l url eRepo par defaut 
 Attributes :
    + urlSite : l url du site
    + eRepoUrl : l url du serveur eRepo associe
************************************** */
function SiteServer(site, eRepoUrl){
    this.site = site ;
    this.eRepoUrl = eRepoUrl ;
}

SiteServer.prototype.getSite = function(){
    if(this.site){
        return this.site ;
    }
    else{
        return "" ;
    }
}

SiteServer.prototype.getERepoUrl = function(){
    if(this.eRepoUrl){
        return this.eRepoUrl ;
    }
    else{
        return "" ;
    }
}

/* ############################################################## */
/* #####################   ArrayList  ########################### */
/* ############################################################## */
function ArrayList(){
    this.arraylist = new Array();
}
 
/* ############################################################
* Methode add
* param :
*     value : valeur a ajouter
*/
ArrayList.prototype.add = function(value){
    if( typeof value != "undefined" )
    {
        this.arraylist[this.arraylist.length] = value ;
    }
}
 
/* ############################################################
* Methode get
* param :
*     index : index de la valeur a retourner
* return :
*     String     
*/
ArrayList.prototype.get = function(index){
    if(this.arraylist[index]){
        return this.arraylist[index] ;    
    }
    else{
        return "" ;
    }
}

/* ############################################################
* Methode remove
* param :
*     value : valeur a supprimer     
*/
ArrayList.prototype.remove = function(value){
    var i = this.contains(value);
    if(i != -1) this.arraylist.splice(i,1);
}
 
/* ############################################################
* Methode length
* return :
*     String     
*/
ArrayList.prototype.length = function(){
    return this.arraylist.length;
}
 
/* ############################################################
* Methode contains
* param :
*     value : valeur a rechercher
* return :
*     index de la valeur a rechercher     
*/
ArrayList.prototype.contains = function(value)
{
    for( var k = 0 ; k < this.arraylist.length ; k++ )
    {
        if( this.arraylist[k] == value ) {
            return k ;
        }
    }
    return -1 ;
}

