﻿// JScript File  JScriptDOMUtils
/************************************************************************************* 
-  JScriptDOMUtils  This file contains JavaScript classes that handle DOM manipulation
-  for IE and NON-IE browsers.  
**************************************************************************************/
/************************************************************************************* 
-  Related Jscript files -  Any process that needs browser specific DOM functions.    
-        
**************************************************************************************/
/* *********************************************************************************** 
/* Factory Class                                                                     */
/* *********************************************************************************** 
-  Class: DOMObjFactory
-  Purpose: Creates browser specific DOM support classes depending upon browser.
-  Date:  6/01/2006
-  Mods:
-    
************************************************************************************ */
function DOMObjFactory(errObj)
{
// Constructor /////////////////////////////////////////
    this.Init = Init(errObj); 
////////////////////////////////////////////////////////
// Public Variables ////////////////////////////////////
    this.DOMUtilObj;

// Public Function Declarations ////////////////////////
    this.CreateDOMUtilObject = CreateDOMUtilObject;
////////////////////////////////////////////////////////
  var _AjaxProxy;            //Pointer to Server Ajax Object
// Public Functions ////////////////////////////////////
/* *********************************************************************************** 
-  Function: Init  
-  Purpose: Constructor sets up any metadata for this observation.  If this request
-           is from a Flash site, we already have the data in the ParmNames/ParmValues
-           list.  We initialize the metadata objects differently      
-  Parameters: None
-  Date:  10/04/2006
-  Mods:
-     
************************************************************************************ */
    function Init(errObj)
        {
            //Declare error handler
           _ErrHandler = errObj;
           if(_ErrHandler.GetAjaxStatus())
           {
                _AjaxProxy = AjaxProxy;
           }     
           //Declare Ajax Proxy pointer
//           if(CheckAjaxProxy())
//           {           
//                _AjaxProxy = AjaxProxy
//           }
//           else
//           {
//                _ErrHandler.HandelSessionErr(null);
//                return;
//           }                 
        }   
/* *********************************************************************************** 
-  Public  Functions:  CreateDOMUtilObject()
-  Parameters: None. 
-  Purpose: Create a Utility object that is Browser specific.  This object is created 
-           depending upon the present browser.  Return the object.
-  Date:  5/19/2006
-  Mods:
-     
************************************************************************************ */    
    function CreateDOMUtilObject()
    {
        var _BrowserType;
        
        //Sniff the browser
        if(document.all)
            {
                _BrowserType = "IE4+"
            }
        else
            {
                _BrowserType = "Other"
            }  
        
        switch(_BrowserType)
            {
                case "IE4+":
                    DOMUtilObj = new IEDOMUtility();
                    return DOMUtilObj;
                    break    
                case "Other":
                    DOMUtilObj = new NonIEDOMUtility();
                    return DOMUtilObj;
                    break
                default:
                    DOMUtilObj = new IEDOMUtility();
                    return DOMUtilObj;
            }

    }


}

/* End Factoy Class *******************************************************************/ 
/*Utility Classes ********************************************************************/ 
/*IEIEIEIEIEIEIEIEIEIEIEIEIEIEIEIEIE**************************************************/
/* IE Classes                                                                        */ 
/* *********************************************************************************** 
-  Class: IEDOMUtility
-  Purpose: Performs DOM Utility Functions for IE browser.
-  Date:  6/01/2006
-  Mods:
-     
************************************************************************************ */
function IEDOMUtility()
{
    
      
// Public Function Declarations ////////////////////////
     this.GetSrcElementId = GetSrcElementId;
     this.CancelEvent = CancelEvent;  
// Public Property Declarations ////////////////////////
// Property Getters
    
        
                        
// Private Variable Declarations ////////////////////////
     
      
////////////////////////////////////////////////////////
// Public Functions ////////////////////////////////////
/* *********************************************************************************** 
-  Function: GetSrcElementId IE 
-  Purpose:  This function returns the ID of the initiating HTML tag for the
-            event.      
-  Parameters: thisEvnt - The initiating event. 
-               
-  Date:  01/03/2007
-  Mods:
-     
************************************************************************************ */
    function GetSrcElementId(thisEvnt)
        {    
            return thisEvnt.srcElement.id;
        
        
        }

/* *********************************************************************************** 
-  Function: CancelEvent IE  
-  Purpose:  This function Cancels the event. 
-  Parameters: thisEvnt - The initiating event. 
-               
-  Date:  01/03/2007
-  Mods:
-     
************************************************************************************ */
    function CancelEvent(thisEvnt)
        {    
            thisEvnt.returnValue = false; 
        }


}

/*End IE Utility Classes *************************************************************/ 
/*End IE Classes *********************************************************************/
/************************************************************************************/ 
/**** NS Moz Classes ****************************************************************/ 
/* *********************************************************************************** 
-  Class: NonIEDOMUtility
-  Purpose: Performs Utility Functions for NON IE browser.
-  Date:  6/01/2006
-  Mods:
-     
************************************************************************************ */
function NonIEDOMUtility()
{

    
      
// Public Function Declarations ////////////////////////
     this.GetSrcElementId = GetSrcElementId;
     this.CancelEvent = CancelEvent;  
// Public Property Declarations ////////////////////////
// Property Getters
    
        
                        
// Private Variable Declarations ////////////////////////
     
      
////////////////////////////////////////////////////////
// Public Functions ////////////////////////////////////
/* *********************************************************************************** 
-  Function: GetSrcElementId NON IE  
-  Purpose:  This function returns the ID of the initiating HTML tag for the
-            event.      
-  Parameters: thisEvnt - The initiating event. 
-               
-  Date:  01/03/2007
-  Mods:
-     
************************************************************************************ */
    function GetSrcElementId(thisEvnt)
        {    
            return thisEvnt.target.id;
        }

/* *********************************************************************************** 
-  Function: CancelEvent NON IE  
-  Purpose:  This function Cancels the event. 
-  Parameters: thisEvnt - The initiating event. 
-               
-  Date:  01/03/2007
-  Mods:
-     
************************************************************************************ */
    function CancelEvent(thisEvnt)
        {    
           //document.forms[0].onsubmit = function f(){return false;}
           thisEvnt.preventDefault();
        }


}


/*End* NS Moz Classes *************************************************************/ 
