/*                                                                  
* Copyright © 1999-2009 TeaLeaf Technology, Inc.  
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY TEALEAF ``AS IS'' 
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE DISCLAIMED.  
* IN NO EVENT SHALL TEALEAF BE LIABLE FOR ANY DIRECT, INDIRECT, 
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
* THE POSSIBILITY OF SUCH DAMAGE.
*
* @fileoverview 
* This is the configuration file for capturing Client Events that 
* happen on the rendered DOM. It proviedes the capabilty to block fields
* and turn off an on events on the Window and Document object. 
*
* @version 2009.04.03.1
*                                                                   
*/
if(typeof TeaLeaf.Client == "undefined"){
    TeaLeaf.Client = {};

    if(typeof TeaLeaf.Client.Configuration == "undefined"){
	    TeaLeaf.Client.Configuration = {
	        "tlinit" : false,
		    "tlpassword"         : 1,		// 1 no capture, 2 don't send value
		    "tlsendfocus"        : false,
		    "tlsendblur"         : true,
		    "tlunloadflag"       : true,
		    "tlactiontype"       : "No Submit",
		    "tlbeforeunloadflag" : true,
		    "tlcontrolsattached" : false,
		    "tlassignTLID"       : false,   
		    "tlscanupdate"       : 0,
		    "tlIEhref"           : false,

		    //	tlScheduledScan controls whether or not to periodically scan the DOM
		    //	for changes (and tag the appropriate nodes) at the interval defined by
		    //	tlscanupdate
		    tlScheduledScan : true,

		    //  tlExcludeTags controls whether to explicitly exclude or include the
		    //  tags listed in tlNodeTags when attaching to descendent elements using
		    //  TeaLeaf.Client.tlProcessNode(). See TeaLeaf.Client.tlTagNameAllowed()
		    tlExcludeTags : true,

		    //	If events are being cancelled, the document object will not catch events
		    //	since they are not being bubbled up. In order to combat this, we can attach
		    //	to every relevant item (see tlExcludeTags and tlNodeTags), except this may
		    //	result in duplicate events being captured.
		    tlUniversalAttach : false,

		    //  Option to store the xml of queued events on a page unload in a cookie, so
		    //  that it may be sent up with the next page's events. Since this may interfere
		    //  with the existing cookies on the site, this is disabled by default.
		    tlStoreQueueInCookie : false,

		    //	This is where input fields can be globally blocked.  Four examples are shown
		    //	below.  Add or remove fields as appropriate.  The parameters are:
		    //		tlfieldname     : the id of the field
		    //		caseinsensitive : check for the field name in using case
		    //			insensitive check
		    //		eventnovalue : if true, send event but without value.  If 
		    //			false do not send event
		    tlFieldBlock:[
			    {"tlfieldname": "TLCREDITCARD",   "caseinsensitive": true, "eventvaluereplace": "",  "eventnovalue": true},
			    {"tlfieldname": "tlpassword",     "caseinsensitive": true, "eventvaluereplace": "",  "eventnovalue": true},
			    {"tlfieldname": "tlpwd",          "caseinsensitive": true, "eventvaluereplace": "",  "eventnovalue": true},
			    {"tlfieldname": "tlqty",          "caseinsensitive": true, "eventvaluereplace": "333",  "eventnovalue": false}
		    ],
	
		    tlFieldBlockMap : null,
		
		    //	This is the list of events we catch off of the window object
		    tlWindowHandlers:[
			    {"domevent": "resize",          "load": false,  "tlhandler": "TeaLeaf.Client.tlQueueResize"},
			    {"domevent": "focus",           "load": true,  "tlhandler": "TeaLeaf.Client.tlSetFocusTime"},
			    {"domevent": "help",            "load": true,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "scroll",          "load": false,  "tlhandler": "TeaLeaf.Client.tlQueueScroll"},
			    {"domevent": "beforeprint",     "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "afterprint",      "load": false,  "tlhandler": "TeaLeaf.Client.tlAddEvent"}
		    ],

		    //	This is the list of events we catch off of the document object
		    tlDocumentHandlers:[
			    {"domevent": "click",        "load": true,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "dblclick",     "load": true,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "keyup",        "load": true,     "tlhandler": "TeaLeaf.Client.tlQueueKey"},
			    {"domevent": "mousedown",    "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseup",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseover",    "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domevent": "mouseout",      "load": false,     "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    //	This event is only caught once and turned off.  This is used to 
			    //	detect robots, since a robot will never have mouse movement.
			    {"domevent": "mousemove",    "load": false,     "tlhandler": "TeaLeaf.Client.tlUserMovement"}
		    ],
		    
		    tlSingleAttach:[
			    {"domelementID": "",    "domevent": "mousedown",    "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseup",      "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseover",    "tlhandler": "TeaLeaf.Client.tlAddEvent"},
			    {"domelementID": "",    "domevent": "mouseout",     "tlhandler": "TeaLeaf.Client.tlAddEvent"}
		    ],

		    /*  tlNodeTags by default includes a list of tag names that are "unimportant"
		     *  or not rendered. The associated true/false value is used in conjunction with
		     *  tlExcludeTags - e.g. if tlExcludeTags is true and a node tag is true, it will
		     *  be excluded; if tlExcludeTags is true and a node tag is false, the tag will be
		     *  included. Similarly if tlExcludeTags is false (meaning to explicitly include the
		     *  listed node tags, those with "true" with be excluded.
		     */
		    tlNodeTags : {
		        "APPLET"    : true,
		        "ATTRIBUTE" : true,
			"B"	    : true,
		        "BASE"      : true,
			"BODY"	    : true,
		        "BR"        : true,
		        "CENTER"    : true,
		        "COL"       : true,
		        "COLGROUP"  : true,
		        "COMMENT"   : true,
			"DIV"	    : true,
		        "DEFAULT"   : true,
		        "DEL"       : true,
		        "EVENT"     : true,
		        "FONT"      : true,
			"FORM"	    : true,
			"HEAD"	    : true,
		        "HISTORY"   : true,
		        "HR"        : true,
		        "HTML"      : true,
		        "I"         : true,
		        "INS"       : true,
		        "LINK"      : true,
		        "MAP"       : true,
		        "META"      : true,
		        "NAMESPACE" : true,
		        "NAVIGGATOR" : true,
		        "NOBR"      : true,
		        "OPTION"    : true,
		        "P"         : true,
		        "PARAM"     : true,
		        "S"         : true,
		        "SCRIPT"    : true,
		        "SMALL"     : true,
		        "STRIKE"    : true,
		        "STRONG"    : true,
		        "STYLE"     : true,
		        "SUB"       : true,
		        "SUP"       : true,
		        "TH"        : true,
		        "TITLE"     : true,
		        "THEAD"     : true,
		        "TFOOT"     : true,
		        "TR"        : true,
		        "U"         : true
		    },

		    /*  tlSpecialChildNodeTags represents tags with a special
		     *  situation where the event that fires is attached to a
		     *  non-visual item that is inside the actual UI element.
                 *  Example would be a menu with a <nobr> tag inside to
                 *  keep the visual text of the menu on one line. The <nobr>
                 *  fires the event when we really want the parent menu.
		     */

		    tlSpecialChildNodeTags : {
		        "NOBR" : true,
		        "P"    : true
		    }
	    };
	    	
	    TeaLeaf.Client.Configuration.tlIdCounter = [];
    }
}

