/**
 * <code>public class <b>Model</b><br>
 * extends Object</code><br><br>
 *
 *
 * Defines static variable: <code>Object ComponentConfig</code><br>
 * Available as <code>new componence.ComponentConfig()</code><br>
 * Packege <b><code>componence</code></b>
 */
 
if(!window.componence) var componence={};

/**
 * Construct a config for all <code>componence</code> classes.
 * 
 * @version	{version}
 * @constructor
 * @lastmodified
 */
componence.ComponentConfig = function() {


/**
	 * Path to where all scripts files are located.
	 *
	 * @access public
	 * @type String
	 */     
  	this.scriptPath = contextPath + "/portlets/ts/ge/res/js/";
	
	/**
	 * Path to where all graphical files are located.
	 *
	 * @access public
	 * @type String
	 */
	 this.imagePath = contextPath +  "/portlets/ts/ge/res/images/";
	
	/**
	 * Path to where all styleshhets files are located.
	 *
	 * @access public
	 * @type String
	 */
  	this.cssPath = contextPath + "/portlets/ts/ge/res/css/";

	
	/**
	 * Path to where all optimized scripts files are located.
	 *
	 * @access public
	 * @type String
	 */
	this.jarPath = this.scriptPath;
	
	/**
	 * Path to where all locales scripts files are located.
	 *
	 * @access public
	 * @type String
	 */
	this.localePath = this.scriptPath;
	
	/**
	 * Path to where all html files are located.
	 *
	 * @access public
	 * @type String
	 */
	this.htmlPath = this.scriptPath;

	/**
	 * Specified displayng error messages. Default <code>false</code>.
	 *
	 * @access public
	 * @type boolean
	 */
	this.debugMode = false;
  
  	/**
	 * Specified locale code. [auto, en, nl, ru, uk]. Default en.<br>
	 * Used in <code>componence.util.Locale</code>
	 *
	 * @access public
	 * @type String
	 * @see componence.util.Locale.defaultLocale
	 */
	this.defaultLanguage = "nl";
	
	/**
	 * Auto detecting locale. Default <code>true</code>.<br>
	 * Used in <code>componence.util.Locale</code>
	 *
	 * @access public
	 * @type String
	 * @see componence.util.Locale.autoDetect
	 */
	this.autoDetectLanguage = false;

	/**
	 * Getting Language Locale Code by checking browser language
	 * 
	 * @access public
	 * @return two first letters of language name
	 * @type String
	 */
	function getLocaleCode() {
		return this.defaultLanguage;
	}
	this.getLocaleCode = getLocaleCode;

	/**
	 * Includs script file into html page
	 *
	 * @access public
	 * @param fileName String file name, will be included
	 * @type boolean
	 * @see componence.lib.Global.include
	 * @see componence.lib.Global.hasExtention
	 */
	function include(file) {
		var /*:Global:*/ g = Global;
		var /*:file:*/ f = String( file );
		var path = null;
		if ( g.hasExtention( ".js", f ) || g.hasExtention( ".vb", f ) || g.hasExtention( ".vbs", f ) ) {
			path = this.scriptPath;
		} else  if ( g.hasExtention( ".jar", f ) ) {
			path = (this.jarPath) ? this.jarPath : this.scriptPath;
		} else  if ( g.hasExtention( ".css", f ) ) {
			path = this.cssPath;
		} else {
			alert( "incorrect include file: " + f );
			return false;
		}
		if ( path != null ) {
			f = path + "" + f;
			return g.include( f );
		}
	}
	this.include = include;
};

/**
 * @access private
 * @deprecated use componence.ComponentConfig
 * Last updated {buildDate}
 */
function /*:JSClass:*/ JSComponentConfig() {
	return new componence.ComponentConfig();
}

var ComponentConfig = new componence.ComponentConfig();

/*
 * used in componence.lib.Global.required<br>
 * componence.lib.Global.required -  deprecated, use 
 * componence.lib.Global.depends
 * 
 * @deprecated
 */
var ComponenceComponents = {
	/* RTF */
	JSRTF       : "componence-rtf.jar",
	JSRTFConfig : "config-componence-rtf.js",

	/* Inserts */
	JSInserts     : "componence-inserts.jar",		
	JSImageInsert : "componence-inserts.jar", 
	JSLinkInsert  : "componence-inserts.jar",

	/* Utils */
	JSArrayList     : "componence-util.jar",
	JSCookie        : "componence-util.jar",
	JSDateUtils     : "componence-util.jar",
	JSDateFormatter : "componence-util.jar",
	JSHashMap       : "componence-util.jar",
	JSLocale        : "componence-util.jar",
	JSNumber        : "componence-util.jar",
	JSObject        : "componence-util.jar",
	JSString        : "componence-util.jar",
	

	/* Libs */
	JSBrowser              : "componence-lib.jar",
	JSEventManager         : "componence-lib.jar",
	JSFileUtils            : "componence-lib.jar",
	JSFormManager          : "componence-lib.jar",
	JSHtml                 : "componence-lib.jar",
	JSImageUtils           : "componence-lib.jar",
	JSMouse                : "componence-lib.jar",
	JSTemplate             : "componence-lib.jar",
	JSValidator            : "componence-lib.jar",
	JSVisualElementManager : "componence-lib.jar",
	JSWindowManager        : "componence-lib.jar",
	
	/* Other */
	JSPopup       : "componence-popup.jar, config-componence-popup.js",
	JSPopupConfig : "componence-popup.jar, config-componence-popup.js",
	JSDialog      : "componence-dialog.jar",
	JSDataGrid    : "componence-data-grid.jar"
};
