/**
  * Initialisation d'un Objet TChampSelect
  */
 var TColS = new TColorSelect();

 function TColSPopup(doc, editor, champcouleur, casecouleur) {
        this.idvaleur = '';
		this.General(doc, editor, champcouleur, casecouleur);
}
// surcharge méthode pour l'apparence
function TColSPopup2(doc, editor, champcouleur, casecouleur,idvaleur) {
		this.idvaleur = idvaleur;
		this.General(doc, editor, champcouleur, casecouleur);
}

function TColSPopGeneral(doc, editor, champcouleur, casecouleur){
        this.docsource = doc;
        this.editor = editor;
        this.champcouleur = champcouleur;
        this.casecouleur = casecouleur;
        var w = 300, h = 300,
        move = screen ?
                ',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '';
        win = window.open(contextpath+'/jscript/colorselect.jsp', null, "help=no,status=no,scrollbars=yes,resizable=no" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true);
        win.opener = window;
        win.focus();
}
function TColSInit(o_win, o_doc) {
        this.win = o_win;
        this.doc = o_doc;
}

function TColSSelect(valeur) {
    document.getElementById(this.champcouleur).value=valeur;
    document.getElementById(this.casecouleur).style.background=valeur;
    if(this.idvaleur != '') {
      validevaleur(this.idvaleur,valeur);
      refresh();
    }
    this.win.close();
}


function TColorSelect() {
   this.Popup   = TColSPopup;
   this.General = TColSPopGeneral;
   this.Select  = TColSSelect;
   this.Init    = TColSInit;
   this.Popup2  = TColSPopup2;
}

