var RepNav = new RepertoireNavigator();


function RepNavInit(o_win, o_doc) {
        this.win = o_win;
        this.doc = o_doc;
}

function RepNavPopup(numLigne,doc, val, idmodif) {
        this.numLigne = numLigne;
        this.inputname = 'valeur' + numLigne;
        if(idmodif){
          this.idmodif = idmodif;
        }
        this.docsource = doc;
        var w = 400, h = 400,
        move = screen ?
                ',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '',
        win = window.open(contextpath+'/param/navigationserveur/ouvrerepertoireaction.do?repertoire='+val, null, "help=no,status=no,scrollbars=yes,resizable=yes" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true);
        win.opener = window;
        win.focus();
}

function RepNavSelect(repertoire) {
    this.docsource.getElementById("rep"+this.numLigne).value = repertoire+"/";
    this.win.close();
    if(this.docsource.getElementById("btnModifier"+this.idmodif)){
    	this.docsource.getElementById("btnModifier"+this.idmodif).click();
    }
}

function RepertoireNavigator() {
   this.Popup = RepNavPopup;
   this.Select = RepNavSelect;
   this.Init = RepNavInit;
}

