/******************************************************************************
 *
 *                   INDIGEN SOLUTIONS CODE PROPERTY
 *       The present javascript code is property of Indigen Solutions. This 
 *     code can only be used inside Internet/Intranet web sites located on 
 *  *web servers*, as the outcome of a licensed Indigen Solutions application 
 *  only. Any unauthorized use, reverse-engineering, alteration, transmission, 
 * transformation, facsimile, or copying of any means (electronic or not) is 
 *     strictly prohibited and will be prosecuted. Removal of the present 
 *              copyright notice is strictly prohibited
 *         Copyright (c) 2004 Indigen Solutions. All Rights Reserved.
 *
 * RCS Id      $Id: cib.js,v 1.5 2005/03/30 07:49:49 jerome Exp $
 * RCS Revision                 $Revision: 1.5 $
 * RCS Check in date            $Date: 2005/03/30 07:49:49 $
 * 
 ******************************************************************************/

/* Classes. */

function CIB() {
  // Instance management.
  if ( CIB.instances == null )
    CIB.instances = new Array();
  this.cibid = CIB.instances.length;
  CIB.instances.push(this);
  
  /* Methods. */

  this.getStrRef = function() {
    return "CIB.instances[" + this.cibid + "]";    
  };

  this.getURL = function(res) {
    var classname = getClassname(this);
    var type = "";
    eval("type=" + classname + ".TYPE;");
    if ( res )
      res = "/" + res;
    else
      res = "";
    return CIB.URL + "/" + type + res;
  };
  
  this.getSiteURL = function() {
    var classname = getClassname(this);
    var type = "";
    eval("type=" + classname + ".TYPE;");
    return CIB.SITE_URL + "/" + type;
  };

  this.getResourceMap = function(mapName) {
    var classname = getClassname(this);
    var maps = null;
    eval("maps=" + classname + ".RESOURCE_MAPS");
    return ( ( maps[mapName] ) ? maps[mapName] : {} ); 
  };

}

CIB.instances = null;
CIB.URL = "";
CIB.SITE_URL = "";

