// *************************************************
// MODIFY THE FOLLOWING LINES TO MATCH YOUR WEB SITE
// *************************************************

// Check whether we are running off a web server. The window.location.href will return http:// if we are.
if (window.location.href.substring(0,5).toLowerCase() != 'file:')
{
	// *** Edit these lines to suit environment
	// *** The code below assumes that the HTML Rich Text Editor has been released to the web 
	// *** server's '/inc' directory.
	var IMG_DIRECTORY = "js/HTMLRTAImages/";
	var CSS_FILE = "js/HTMLRichTextArea.css";   // This is optional or replace it with your own CSS file
	var WBSC_FILE = "js/WBSC/HTMLSpellCheck.html";
	var IMAGELIBRARY = "inc/Library.php";
}

// Check whether we are running off the local hard drive in c:\program files\tcpiq\.... area
else {
	var IMG_DIRECTORY = "\\Program Files\\tcpIQ\\HTML Rich Text Area\\inc\\HTMLRTAImages\\";
	var CSS_FILE = "\\Program Files\\tcpIQ\\HTML Rich Text Area\\inc\\HTMLRichTextArea.css";
	var WBSC_FILE = "\\Program Files\\tcpIQ\\HTML Rich Text Area\\inc\\HTMLSpellCheck.html";
	var IMAGELIBRARY = "\\Program Files\\tcpIQ\\HTML Rich Text Area\\inc\\Library.php";
}


// *******************
// BEHAVIOUR MODIFIERS
// *******************

// Set the default style for the web page.  This Attribute is placed inside the
// the <BODY style='....'>. Normally you would use it to set font sizes, 
// colors, background color and background images.
//
// For more information: http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/body.asp
//
// If you are unfamiliar with HTML and CSS then you can readily generate these statements by
// going into any fully featured HTML editor like Microsoft Front Page and design the page the way you 
// want it to look.  Then go into the HTML and look for the text  '<BODY style='xxxxx'>'.  The xxxxxx is what you need
// to copy and paste into the statement below between the inverted commas.  Serveral examples have already
// been provided
	 
	// Set the body style to nothing 
	var BODYSTYLE = "";

	// Set the backgound to red, beige, or yellow using different techniques
	// var BODYSTYLE = "background-color:#f06060";  
	// var BODYSTYLE = "background-color:beige";
	// var BODYSTYLE = "background-color:yellow";

	// Set a tiled image for the background
	// var BODYSTYLE = "background-image:url(http://www.tcpiq.com/images/tcpiqbanner.jpg)";

	// Set the default font to Courier 10 pt bold.
	// var BODYSTYLE = "font:bold 10pt Courier"; 

	// Use combination of styles
	// var BODYSTYLE = "font:bold 10pt Courier;background-color:beige"; 


// By default MSHTML editor wants to insert a <P> whenever an 'enter' is hit.
// This will appear as a double line.  Set INSERTBRTAGONENTER = true to override the
// default behaviour to make 'Enter' insert a <BR> instead which appears as a single 
// line
	var INSERTBRTAGONENTER = true;
	// var INSERTBRTAGONENTER = false;


// If INSERTBRTAGONENTER is true then what happens to shift-enter?  To make shift-enter
// do a <p> tag then set the following to be true.  This will only take effect if
// INSERTBRTAGONENTER = true;
	var INSERTPTAGONSHIFTENTER = true;
	// var INSERTPTAGONSHIFTENTER = false;


// Declares whether the 'src' source button that reveals the HTML should be displayed or not.
	var SHOWSOURCEBUTTON = false;
	// var SHOWSOURCEBUTTON = false;


// Declares whether the printer icon is displayed or not.
	var SHOWPRINTER = false;
	// var SHOWPRINTER = false;


// Declares whether to show the undo/redo button
	var SHOWUNDOREDO = true;
	// var SHOWUNDOREDO = false;


// Declares whether the bold, italic and strikethrough options should be available
	var SHOWPRESENTATIONBUTTONS = true;
	// var SHOWPRESENTATIONBUTTONS = false;


// Declares whether to show the indentations, left, right and center alignments
	var SHOWADDITIONALPRESENTATIONBUTTONS = true;
	// var SHOWADDITIONALPRESENTATIONBUTTONS = false;


// Declares whether the super and script menu buttons should be displayed
	var SHOWSUPERSUBSCRIPT = true;
	// var SHOWSUPERSUBSCRIPT = false;


// Declares whether the absolute positioning should be displayed or not
	var SHOWABSOLUTEPOSITIONING = false;
	// var SHOWABSOLUTEPOSITIONING = false;


// Declares whether to show the emoticons and special characters
	var SHOWSPECIALCHARACTERS = false;
	// var SHOWSPECIALCHARACTERS = false;


// Declares whether the numbered and outlined lists menu buttons should be displayed
	var SHOWLIST = true;
	// var SHOWLIST = false;


// Declares whether table support is included or not
	var SHOWTABLESUPPORT = true;
	// var SHOWTABLESUPPORT = false;


// Declares whether font style modification is available. Namely, font face and size
	var SHOWFONTSTYLEMODIFICATION = true;
	// var SHOWFONTSTYLEMODIFICATION = false;


// Declares whether the heading drop down is available or not
	var SHOWHEADINGDROPDOWN = true;
	// var SHOWHEADINGDROPDOWN = false;


// Declares whether the foreground and background colors can be selected
	var SHOWCOLORSELECTION = true;
	// var SHOWCOLORSELECTION = false;


// Declares whether the hyperlink button is available.
	var SHOWHYPERLINKBUTTON = true;
	// var SHOWHYPERLINKBUTTON = false;
	

// Declares whether the add from library is available.  This requires an IIS Web Server.
	var SHOWADDFROMLIBRARY = false;
	// var SHOWADDFROMLIBRARY = false;
	

// Declares whether the add image button is available.
	var SHOWADDIMAGEBUTTON = false;
	// var SHOWADDIMAGEBUTTON = false;


// Declare whether to show the horizontal rule toolbar button
	var SHOWHORIZONTALRULE = true;
	// var SHOWHORIZONTALRULE = false;


// Declare a list of all of the fonts that are used.
	FONTLIST = new Array(
			"Arial", 
			"Century", 
			"Courier New", 
			"Tahoma", 
			"Times New Roman", 
			"Verdana"
		);

// Declare whether the font sizes should be displayed as 1 to 7 or 
// 8pt to 36pt.
	var SHOWFONTSIZESINPOINTS = true;
	// var SHOWFONTSIZESINPOINTS = false;


// Declare whether the cursor (the mouse pointer) changes to a hand while over 
// active toolbar buttons.
	var SHOWCURSORASHAND = true;
	// var SHOWCURSORASHAND = false;


// Declare whether to show the cut copy and paste buttons
	var SHOWCUTCOPYPASTE = true;
	// var SHOWCUTCOPYPASTE = false;

	
// Declare whether to show the non function toolbar handles at the begining of each
// toolbar row.  It gives WinXP/OfficeXP type feel to it.
	var SHOWBOGUSTOOLBARHANDLES = true;
	// var SHOWBOGUSTOOLBARHANDLES = false;

// Declare whether or not to show the spell checker. tcpIQ's Web Browser Spell Check needs
// to be installed for this feature to work. More information can be found at 
// http://www.tcpiq.com/tcpiq/SpellCheck/Default.asp
	// var SHOWSPELLCHECKBUTTON = true;
	var SHOWSPELLCHECKBUTTON = false;


// Declare whether or not to show the 'find' button.
	var SHOWFINDBUTTON = false;
	// var SHOWFINDBUTTON = false;


// Declare whether to show the spacers between toolbar buttons that are logically 
// grouped together
	var SHOWTOOLBARSPACERS = true;
	// var SHOWTOOLBARSPACERS = false;


// Declare whether to show the status bar at the bottom
	var SHOWSTATUSBAR = true;
	// var SHOWSTATUSBAR = false;


// Declare whether to show the date / time buttons
	var SHOWDATETIME = true;
	// var SHOWDATETIME = false;

// The HTML RTA can either be fixed width, or its width can be 
// proportional to the width of its container. In this case the HTML RTA
// will shrink and grow as browser window is resized by the user. 
// This setting specifies whether the width that is passed
// in through the arguments represents a percentage (true) or whether it is 
// the size in pixels (false).  The height is always the height in pixels.
// When passing in the argument do not include the '%'. The code will do this 
// automatically.

	var SIZESINPERCENT = true;
	// var SIZESINPERCENT = false;

// When the SIZESINPERCENT equals true, you have to specify the width of the 
// toolbar. It is not possible to dynamically resize it.  The HTML RTA
// will not shrink below this width.  A value of 400 is generally used.
	var MINBUTTONROWWIDTH = 500;


// This is the margin around editable area and the border in pixels
	var EDITORMARGIN = 2;


// Declare whether to show a border around the entire HTML RTA to a finish to the UI.
// Setting this to false means that you should problably provide your own type of border
	var SHOWHTMLRTABORDER = true;
	// var SHOWHTMLRTABORDER = false;
	
// If SHOWHTMLRTABORDER = true then declare the size of the border, color and border style
	var HTMLRTABORDERSIZE = 1;
	var HTMLRTABORDERCOLOR = "#ECE9D8"
	var HTMLRTABORDERSTYLE = "BORDER-RIGHT: #7F7C75 1px solid; BORDER-BOTTOM: #7F7C75 1px solid;BORDER-LEFT: #E0E0E0 1px solid; BORDER-TOP: #E0E0E0 1px solid"


// Declare the way ordered lists are displayed	
	var strOrderedListType = "1";  // Associate numbers with each item in an ordered list. 
	// var strOrderedListType = "a";  // Associate lowercase letters with each item in an ordered list. 
	// var strOrderedListType = "A";  // Associate uppercase letters with each item in an ordered list. 
	// var strOrderedListType = "i";  // Associate small Roman numerals with each item in an ordered list. 
	// var strOrderedListType = "I";  // Associate large Roman numerals with each item in an ordered list. 
	
	
// Declare the way unordered lists are displayed		
	var strUnOrderedListType = "disc";	// Associate a solid disc with each item in an unordered list. 
	// var strUnOrderedListType = "circle";	// Associate a hollow circle with each item in an unordered list. 
	// var strUnOrderedListType = "square";	// Associate a solid square with each item in an unordered list. 


// Declare the maximum undo size.  
	var MAXUNDOSIZE = 20;
	
	
// Enter the name of a javascript function that and it will be called
// whenever a change it made to the HTML RTA.  
	var EVENTCATCHER = "";
	// var EVENTCATCHER = "alert('Hello world')";


// Declare the details of the user defined custom button #1
	var SHOWCUSTOMBUTTON1 = false;
	var CUSTOMBUTTON1CALLBACKTOOLTIP = "Custom button 1 tool tip";	
	var CUSTOMBUTTON1CALLBACK = "CustomButton1Handler";
	var CUSTOMBUTTON1IMAGE = "F1.gif";

	// Example
	function CustomButton1Handler(iframeId)
	{
		// Get a reference to the document object being edited
		var objEditor = GetEditorRef(iframeId);
		alert('This will return the HTML');
		alert(objEditor.body.innerHTML);
	}
	
// Declare the details of the user defined custom button #2
	var SHOWCUSTOMBUTTON2 = false;
	var CUSTOMBUTTON2CALLBACKTOOLTIP = "Custom button 2 tool tip";	
	var CUSTOMBUTTON2CALLBACK = "CustomButton2Handler";
	var CUSTOMBUTTON2IMAGE = "F2.gif";

	// Example
	function CustomButton2Handler(iframeId)
	{
		// Get a reference to the document object being edited
		var objEditor = GetEditorRef(iframeId);
		
		alert('This will insert text into the document');
		PutHTML(iframeId, "<b>Just Inserted</b>")
	}

// Declare the details of the user defined custom button #3
	var SHOWCUSTOMBUTTON3 = false;
	var CUSTOMBUTTON3CALLBACKTOOLTIP = "Custom button 3 tool tip";	
	var CUSTOMBUTTON3CALLBACK = "CustomButton3Handler";
	var CUSTOMBUTTON3IMAGE = "F3.gif";

	// Example
	function CustomButton3Handler(iframeId)
	{
		// Get a reference to the document object being edited
		var objEditor = GetEditorRef(iframeId);
	
		alert('This will clear the web page');
		objEditor.body.innerHTML = "";
	}

	

