/**
 *
 */

/**
 * Specified common settings for RTF Editor.<br>
 * <font color="red"><b>Should be included in HEAD section of HTML document before RTF editor</b></font><br>
 * Define global variable <code>RTF.Config</code>
 * 
 * @version {version}
 * @see RTF
 * @constructor
 * @lastmodified
 * @extends ComponentConfig
 */
function JSRTFConfig() {
	
	var /*:boolean:*/ isLocal = (String(document.location).indexOf("file:")==0);
	
	/**
	 * Path to where all *.cab and *.ocx are located
	 * @access public
	 * @type String
	 */
	this.activeXPath = ComponentConfig.scriptPath + "activex";
	
	/**
	 * Path to where all applets are located
	 * @access public
	 * @type String
	 */
	this.appletPath = ComponentConfig.scriptPath + "applet/";
	
	/**
	 * Path to where all graphic files are located
	 * @access public
	 * @type String
	 */
	this.imagePath = ComponentConfig.imagePath;
	
	/**
	 * Path to where all scripts files are located
	 * @access public
	 * @type String
	 */
	this.scriptPath = ComponentConfig.scriptPath;
	
	/**
	 * Path to where all styleshhets files are located
	 * @access public
	 * @type String
	 */
	this.cssPath = ComponentConfig.cssPath;
	
	/**
	 * Path to where all optimized scripts files are located
	 * @access public
	 * @type String
	 */
	this.jarPath = ComponentConfig.jarPath;
	
	/**
	 * Path to where all locales scripts files are located
	 * @access public
	 * @type String
	 */
	this.localePath = ComponentConfig.localePath;
	
	/**
	 * 
	 * @access public
	 * @type String
	 */
	this.htmlPath = ComponentConfig.htmlPath;
	
	/**
	 * Default Image prefix for using different images in toolbar. (default componence-rtf-bar-)
	 * @access public
	 * @type String
	 */
	this.imagePrefix = "componence-rtf-bar-";
	
	
	/**
	 * Specified default HTML. Default <code>&lt;div&gt;&amp;nbsp;&lt;/div&gt;</code>.
	 * @access public
	 * @type String
	 */
	this.defaultHTML = "<div>&nbsp;</div>";
	
	/**
	 * Specified displayng error messages. Default <code>false</code>.
	 * @access public
	 * @type boolean
	 */
	this.debugMode = false;
	
	/**
	 * Specified locale code. [auto, en, nl, ru, uk]. Default auto.
	 * @access public
	 * @type String
	 */
	this.locale = "nl";
	
	/**
	 * Enables switching to HTML mode. Default <code>true</code>.
	 * @access public
	 * @type boolean
	 */
	this.viewSource = true;
	
	/**
	 * Enables mouse over/out/down/up effects. Default <code>true</code>.
	 * @access public
	 * @type boolean
	 */
	this.mouseEffects = true;
	
	/**
	 * Specified toolbar template. File should be exists in RTF.Config.scriptPath folder.
	 * @access public
	 * @type String
	 * @see scriptPath
	 */
	this.toolbarTemplate = "componence-template-rtf.js";
	
	/**
	 * Common UI. File should be exists in RTF.Config.cssPath folder.
	 * @access public
	 * @type String
	 * @see cssPath
	 */
	this.cssFile = "componence-rtf.css";
	
	/**
	 * For https protocol set path to existing file. Default about:blank.
	 * @access public
	 * @type String
	 */
	this.iframeUrl = "about:blank";
	
	/**
	 * Specified url for image manager window.
	 * @access public
	 * @type String
	 */
	this.imageManagerURL = isLocal ? "../html/image-manager.html" : "/scripts/html/image-manager.html";
	
	/**
	 * Specified name for image manager window. Default RTFImageManager.
	 * @access public
	 * @type String
	 */
	this.imageManagerWindowName = "RTFImageManager";
	
	/**
	 * Specified parameters for image manager window. Default "width=650, height=400".
	 * @access public
	 * @type String
	 */
	this.imageManagerOpenParams = "modal=yes, center=true, resizable=yes, scrollbars=no, width=650, height=400, status=no";
	
	/**
	 * Specified url for link manager window.
	 * @access public
	 * @type String
	 */
	this.linkManagerURL = isLocal ? "../html/link-manager.html" : "/scripts/html/link-manager.html";
	
	/**
	 * Specified name for link manager window. Default RTFLinkManager.
	 * @access public
	 * @type String
	 */
	this.linkManagerWindowName = "RTFLinkManager";
	
	/**
	 * Specified parameters for link manager window. Default "width=400, height=300".
	 * @access public
	 * @type String
	 */
	this.linkManagerOpenParams = "width=400, height=300, status=no";
	
	
	/**
	 * HTML mode. IE only
	 * @access public
	 * @type boolean
	 */
	this.useActiveXSourceEditor = false;
	
	/**
	 * HTML mode. IE only
	 * @access public
	 * @type boolean
	 * @deprecated
	 * @see useActiveXSourceEditor
	 */
	this.useActiveX = !true;
	
	/**
	 * File should be exists in RTF.Config.activeXPath folder. See RTF.Config.useActiveXSourceEditor, RTF.Config.activeXPath. Default cmsAxEditor.cab
	 * @access public
	 * @type String
	 * @see activeXPath
	 */
	this.sourceEditorFile = "cmsAxEditor.cab";
	
	/**
	 * File should be exists in RTF.Config.appletPath folder. Default rtf.jar
	 * @access public
	 * @type String
	 * @see appletPath
	 */
	this.rtfAppletFile = "rtf.jar";
	
	/**
	 * File should be exists in RTF.Config.activeXPath folder. Default rtf.cab
	 * @access public
	 * @type String
	 * @see activeXPath
	 */
	this.rtfActiveXFile = "rtf.cab";
	
	/**
	 * IE 6+ (ActiveX), Gecko (XUL)<br>
	 * Set to false and use <code>RTF.ColorPicker.colors[]</code> array<br>
	 * Set items into <code>RTF.ColorPicker.colors</code> array with out sharp symbol (#).<br>
	 * Default <code>true</code>.
	 * @access public
	 * @type String
	 */
	this.useNativeColorPicker = true;
	
	/**
	 * IE 5.5+, Gecko<br>
	 * Hightlite HTML code syntax or use simple textarea.<br>
	 * Default <code>true</code>
	 * @access public
	 * @type boolean
	 */
	this.useCodeHightLite = true;
	
	/**
	 * See RTF.Config.useCodeHightLite. Default rtf-hilite.css
	 * @access public
	 * @type String
	 * @see useCodeHightLite
	 */
	this.highliteCssFile = "componence-rtf-hilite.css";
	
	/**
	 * When "Show Details" button pressed which tag should be hilited.<br>
	 * Default <code>li,p,img,table,th,td,div</code>
	 * @access public
	 * @type String
	 */
	this.highliteTags = "li,p,img,table,th,td,div";
	
	/**
	 * See RTF.Config.highliteTags.<br>
	 * Default <code>border:dashed 1px gray</code>
	 * @access public
	 * @type String
	 * @see highliteTags
	 */
	this.highliteCss = "border:dashed 1px gray";
	
	/**
	 * It's a small dialog window from where you can add or modify link proprties.<br>
	 * Please not confuse with Link Manager.<br>
	 * Default 330
	 * @access public
	 * @type int
	 */
	this.linkWinWidth  = 330;
	
	/**
	 * See RTF.Config.linkWinWidth<br>
	 * Default 135
	 * @access public
	 * @type int
	 * @see linkWinWidth
	 */

	this.linkWinHeight = 165;
	
	this.tableWinWidth = 400;
	this.tableWinHeight = 310;
	
	this.charWinHeight = 220;
	
	/**
	 * Specified links protocol showed in link window drop down list.
	 * @access public
	 * @type Array
	 * @see linkWinWidth
	 */
	this.linksProtocols=[
		//protocol     description
		["http://",    "http://"],
		["",           "Internal Link"],
		["https://",   "https://"],
		["ftp://",     "ftp://"],
		["javascript:","JavaScript"],
		["mailto:",    "Mail"],
		["#",          "Anchor"]
	];
	
	/**
	 * Gets locale code.
	 * @access public
	 * @type String
	 * @see locale
	 */
	function getLocale(){
		return this.locale;
	}
	this.getLocale = getLocale;
}

if(window.JSComponentConfig) 
	JSRTFConfig.prototype = new JSComponentConfig();

if(!window.RTF) RTF={};

RTF.Config = new JSRTFConfig();

