/// <class Name = "cXmlDOM">
///<summary> This class is used to define all the properties and variables required for XMLDOM. </summary>
///</class>

function cXmlDOM()
{
	///-- oError : To store the error message
	var oError = "";
	///-- oXmlDOM : Stores the object of XMLDOM
	var oXmlDOM = null;
	///-- oSerializer :  
	var oSerializer = null;
	///-- oParser : 
	var oParser= null;
	
	///-- fnReadyStateChange : 
	var strfnReadyStateChange = null;
	
	
	/* **meghna's code 
	///-- nNodeLevel : Stores the level of the node in the hierarchy
		var nNodeLevel = "";
	///-- blnNodeExists : True if the given node exists in the file or not
		var blnNodeExists = false;
	///-- srchNodeProperty : Stores the property of the node to be searched
		var srchNodeProperty = "";
	///-- srchNodePropertyAttributeValue : Stores the attribute value
		var srchNodePropertyAttributeValue = "";
	
	
	/* **Meghna's code
	///&& XmlType : Stores the form of input XML . Either File or String
		this.XmlType = null; 
	///&& XmlFile : Used to define the path of Xml file to be uploaded
		this.XmlFile = null; 
	///&& strXml : Used to define the xml string 
		this.strXml = "";
	*/
	
	
	///&& blnResolveExternals : It will contain reference to the document's root element
	this.oDocumentElement = null;
	///-- intReadyState : It will contain State value when the the readystatechange occures.
	this.intReadyState = null;
	///&& OnReadyStateChange : The name of the method to be called when readystate changes.
	this.OnReadyStateChange = null;
	///&& strDocType : If XML document has doctype defined, this will contain the reference to the object doctype.
	this.strDocType = null;
	///&& strParseError : If any Parsing error is there, it will contain the reference to the error object.
	this.strParseError = null;
	///&& oImplementation : This property provides access to the DOM Object that handles this document.
	this.oImplementation  = null;
	///&& blnPreserveWhiteSpace : if true white space will be preserved, if false <xml:space> element will  be preserving the white spaces.
	this.blnPreserveWhiteSpace = false;
	///&& strURL : If Document is loaded properly the URL Will contain path for the loaded file
	this.strURL = null;
	///&& strXml : Contains the xml for the file loaded or the loaded string.
	this.strXml = null;
	///&& blnResolveExternals : External Namespaces and and external entity references, are to be resolved at parse time, independent of validation
	this.blnResolveExternals = true;
	///&& blnValidateOnParse : Validate XML Content at the time of parsing the xml
	this.blnValidateOnParse  = true;
	///&& blnAsync : Contains File Loading Mode by default (Sync = false | Async = true)
	this.blnAsync = true;
	///&& XmlFile : Used to define the xml string 
	this.strXMLSource= "";
	///&& blnIsFile : Stores the form of input XML . True if File,false otherwise.
	this.blnIsXMLFile= true;
	

	//*********************************************
	this.fnAbort = cXmlDOM_fnAbort;
	this.fnGetElementsByTagName = cXmlDOM_fnGetElementsByTagName;
	this.fnReadyStateChange = cXmlDOM_fnXMLDOMReadyStateChange;
	
	this.fnCreateNode = cXmlDOM_fnCreateNode;
	this.fnCloneNode = cXmlDOM_fnCloneNode;
	this.fnRemoveAllNodes = cXmlDOM_fnRemoveAllNodes;
	this.fnCreateTextNode = cXmlDOM_fnCreateTextNode;
	this.fnPeekNode = cXmlDOM_fnPeekNode;
	this.fnInsertBefore = cXmlDOM_fnInsertBefore;
	
	this.fnCreateElement = cXmlDOM_fnCreateElement;
	this.fnCreateCDATASection = cXmlDOM_fnCreateCDATASection;
	this.fnCreateComment = cXmlDOM_fnCreateComment;
	this.fnCreateDocumentFragment = cXmlDOM_fnCreateDocumentFragment;
	this.fnCreateEntityReference = cXmlDOM_fnCreateEntityReference;
	this.fnCreateProcessingInstruction = cXmlDOM_fnCreateProcessingInstruction;
	
	this.fnAppendChild = cXmlDOM_fnAppendChild;
	this.fnRemoveChild = cXmlDOM_fnRemoveChild;
	this.fnReplaceChild = cXmlDOM_fnReplaceChild;
	this.fnGetFirstChild = cXmlDOM_fnGetFirstChild;
	this.fnGetLastChild = cXmlDOM_fnGetLastChild;
	this.fnGetNextSibling = cXmlDOM_fnGetNextSibling;
	this.fnGetPreviousSibling = cXmlDOM_fnGetPreviousSibling;
	
	this.fnCreateAttribute = cXmlDOM_fnCreateAttribute;
	this.fnSetAttribute = cXmlDOM_fnSetAttribute;
	this.fnGetAttribute = cXmlDOM_fnGetAttribute;
	this.fnRemoveAttribute = cXmlDOM_fnRemoveAttribute;
	
	this.fnInsertData = cXmlDOM_fnInsertData;
	this.fnDeleteData = cXmlDOM_fnDeleteData; 
	this.fnReplaceData = cXmlDOM_fnReplaceData; 
	 
	this.fnRemoveNamedItem = cXmlDOM_fnRemoveNamedItem; 
	this.fnGetNamedItem = cXmlDOM_fnGetNamedItem; 
	this.fnSetNamedItem = cXmlDOM_fnSetNamedItem;
		
	
	
	/// ACTL
	this.fnSetXML = cXmlDOM_fnSetXML;
	this.fnGetXML = cXmlDOM_fnGetXML;
	this.fnValidateXPath = cXmlDOM_fnValidateXPath;


	//*******************************************
	
	
	this.fnInit_XmlDom = cXmlDOM_fnInit_XmlDom;
	this.fnLoadXML = cXmlDOM_fnLoadXML;
	this.fnHasChildNode = cXmlDOM_fnHasChildNode;
	this.fnNodeExists = cXmlDOM_fnNodeExists;
	this.fnpvtHasChildNodes = cXmlDOM_fnpvtHasChildNodes;
	this.fnSelectNodes = cXmlDOM_fnSelectNodes;
	this.fnpvtSelectNodes = cXmlDOM_fnpvtSelectNodes ;
	this.fnSelectSingleNode = cXmlDOM_fnSelectSingleNode;
	this.fnpvtSelectSingleNodes = cXmlDOM_fnpvtSelectSingleNodes ;
	this.fnGetAttributeOfNode = cXmlDOM_fnGetAttributeOfNode;
	this.fnNodeExistsWithAttribute = cXmlDOM_fnNodeExistsWithAttribute;
	this.fnNodeExistsWithAttributeValue = cXmlDOM_fnNodeExistsWithAttributeValue;
	this.fnSelectNodeWithAttribute = cXmlDOM_fnSelectNodeWithAttribute;
	this.fnSelectNodeWithAttributeValue = cXmlDOM_fnSelectNodeWithAttributeValue;
	this.fnGetAllNodesWithCData = cXmlDOM_fnGetAllNodesWithCData;
	this.fnGetNodeCDataContent = cXmlDOM_fnGetNodeCDataContent;
	
	// ** Meghna's Code
	//	this.fnCheckChildNodes = cXmlDOM_fnCheckChildNodes;
}

///<memberMethod name="fnThrowError">
///<summary> This method is used to throw an Error. </summary>
///<param name="strMethodName">	This parameter stores the method name where from the error is generated.</param>
///<param name="strMessage"> This parameter stores the Message to be displayed as an error indication. </param>
///</memberMethod>
function cXmlDOM_fnThrowError(strMessage,strMethodName)
{
	///-- Throw an exception with specified Messange and Method Name.
	throw new cACTLException(strMessage, strMethodName);
}

///<memberMethod name="fnInit_XmlDom">
///<summary> This method is used to initialize the XML DOM object.</summary>
///</memberMethod>
function cXmlDOM_fnInit_XmlDom()
{
	try
	{
		var ox;
		
		/// **Meghna's Code
		/// nNodeLevel = -1;
		
		///-- Create an ActiveXObject according to the browser type.
		if(navigator.appName=="Microsoft Internet Explorer")
		{
			ox = oJSFW.fnObjectInitializer('ActiveXObject','',['Msxml2.DOMDocument']);			
		}
		else if(navigator.product=="Gecko")
		{
			if(document.implementation && document.implementation.createDocument)
			{
				ox = document.implementation.createDocument("","",null);
			}
		}
		return ox;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnInit_XmlDom");
	}
}

///<memberMethod name="fnLoadXML">
///<summary> This method is used to load either a XML File or a string. </summary>
///</memberMethod>
function cXmlDOM_fnLoadXML()
{
	var blnLoadStatus = false;
	try
	{
		///-- Create an instance of DOM
		oXmlDOM = this.fnInit_XmlDom();
		
		if(this.strXMLSource == null)
		{
			cXmlDOM_fnThrowError("Invalid XML Source Content.",strMethodName)
		}
		
		///-- Set File / String download mode
		oXmlDOM.async = this.blnAsync;
		
		/// Set Resolving parameters property
		oXmlDOM.resolveExternals = this.blnResolveExternals;
		
		///-- Set ReadyStateChange function
		if(this.OnReadyStateChange != null )
		{
			strfnReadyStateChange = this.OnReadyStateChange;
			oXmlDOM.onreadystatechange = cXmlDOM_fnXMLDOMReadyStateChange; 
		}
	
		///-- Detect Browser and Load XML File User has provided.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			/// Set Preserve White space property
			oXmlDOM.preserveWhiteSpace = this.blnPreserveWhiteSpace;	
			
			if(this.blnIsXMLFile)
				blnLoadStatus = oXmlDOM.load(this.strXMLSource);
			else
				blnLoadStatus = oXmlDOM.loadXML(this.strXMLSource);	
			
			if (oXmlDOM.parseError.errorCode != 0) 
			{
				this.strParseError = oXmlDOM.parseError.reason;
			}
			else
			{
				///-- Get The loaded XML Content
				this.strXml=oXmlDOM.xml;
					
				/// Get URL for the loaded content
				this.strURL = oXmlDOM.url;
			}
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
	
			if(this.blnIsXMLFile) 
			{
				//netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
				blnLoadStatus = oXmlDOM.load(this.strXMLSource);
			}
			else
			{
				blnLoadStatus = true;	
				oParser= oJSFW.fnObjectInitializer('DOMParser','',[]);
				oXmlDOM = oParser.parseFromString(this.strXMLSource,"text/xml");
			}
			var root=oXmlDOM.documentElement;
			if(blnLoadStatus==false )
			{
				this.strXml=root.textContent;
			}
			else if(String(root.nodeName)=='parsererror')
			{
				this.strXml=String(root.textContent).substr(0,String(root.textContent).indexOf("<")-1);
			}
			else
			{
				oSerializer = oJSFW.fnObjectInitializer('XMLSerializer','',[]);	
				this.strXml = oSerializer.serializeToString(oXmlDOM,"text/xml");
			}
		}
		
		this.oDocumentElement = oXmlDOM.documentElement;
		this.oImplementation = oXmlDOM.implementation;
		this.strDocType = oXmlDOM.doctype;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnLoadXML");
	}
}

///<memberMethod name="fnSetXML">
///<summary> This method is used to set the strXml Property. </summary>
///</memberMethod>
function cXmlDOM_fnSetXML()
{
	try
	{
		///-- Detect Browser and Load XML File User has provided.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			///-- Get loaded XML Content
			this.strXml=oXmlDOM.xml;
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			/// Get Content from Serializer
			oSerializer = oJSFW.fnObjectInitializer('XMLSerializer','',[]);	
			this.strXml = oSerializer.serializeToString(oXmlDOM,"text/xml");
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSetXML");
	}
}

///<memberMethod name="fnGetXML">
///<summary> This method is used to get the Xml Content of document.</summary>
///
///</memberMethod>
function cXmlDOM_fnGetXML(objContainerNode)
{
	var strXml='';
	try
	{
		if(oJSFW.objBrowserInfo.IsIE)
		{
			///-- Get loaded XML Content
			if(typeof objContainerNode == "undefined" || objContainerNode == null)
				strXml=oXmlDOM.xml;
			else
				strXml=objContainerNode.xml;
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			var oSerializer = oJSFW.fnObjectInitializer('XMLSerializer','',[]);	
			
			/// Get Content from Serializer
			if(typeof objContainerNode == "undefined" || objContainerNode == null)
				strXml = oSerializer.serializeToString(oXmlDOM,"text/xml");
			else
				strXml = oSerializer.serializeToString(objContainerNode,"text/xml");
		}
		return strXml;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetXML");
	}
}

///<memberMethod name="fnValidateXPath">
///<summary> This method is used for validating XPath that user has provided. </summary>
///<param name="strPathValue"> This parameter stores the XPath. </param>
///</memberMethod>
function cXmlDOM_fnValidateXPath(strPathValue)
{
	try
	{
		if(strPathValue.fnStartsWith("//"))
			return strPathValue;
		else
			return "//"+strPathValue;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnValidateXPath");
	}
}

///<memberMethod name="fnCreateNode">
///<summary> This method is used to Create New Node. </summary>
///<param name="nNodeType"> The Variant specifying the type of the node. </param>
///<param name="strNodeParams"> Name Of the node. </param>
///<param name="strNameSpaceURI"> The Name Space URI for the node new to be created. </param>
///</memberMethod>
function cXmlDOM_fnCreateNode(nNodeType,strNameSpaceURI,strNodeParam1,strNodeParam2)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oNode=oXmlDOM.createNode(nNodeType,strNodeParam1,strNameSpaceURI);
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			switch(nNodeType)
			{
				case 1:
					oNode=this.fnCreateElement(strNodeParam1);
					break;
				case 2:
					oNode=this.fnCreateAttribute(strNodeParam1);
					break;
				case 3:
					oNode=this.fnCreateTextNode(strNodeParam1);
					break;
				case 4:
					oNode=this.fnCreateCDATASection(strNodeParam1);
					break;
				case 5:
					oNode=this.fnCreateEntityReference(strNodeParam1);
					break;
				case 7:
					oNode=this.fnCreateProcessingInstruction(strNodeParam1,strNodeParam2);
					break;
				case 8:
					oNode=this.fnCreateComment(strNodeParam1);
					break;
				case 11:
					oNode=this.fnCreateDocumentFragement();
					break;
				case 6,9,10,12:
					cXmlDOM_fnThrowError("Can't create node with specified type","cXmlDOM_fnCreateNode");
					break;
			}
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateNode");
	}
}

/// <memberMethod name="fnCreateElement">
/// <summary> Wrapper for document.createElement. </summary>
///	<param name="strElementName"> Name of the element to be added. </param>
/// </memberMethod>
function cXmlDOM_fnCreateElement(strElementName)
{
	var oElement=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oElement=oXmlDOM.createElement(strElementName);
		}
		return oElement;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateNode");
	}
}

///<memberMethod name="fnCloneNode">
///<summary> This method is used to Clone a Node. </summary>
///<param name="objNode"> The object having node reference. </param>
///<param name="blnDeep"> Defines weather whole hierarchy to be cloned or not. </param>
///<param name="strNameSpaceURI"> The Name Space URI for the node new to be created.</param>
///</memberMethod>
function cXmlDOM_fnCloneNode(objNode,blnDeep)
{
	var oArrNode = null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oArrNode=objNode.cloneNode(blnDeep);
		}
		return oArrNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCloneNode");
	}
}

///<memberMethod name="fnRemoveAllNodes">
///<summary> This method is used to Clone a Node. </summary>
///<param name="objNode"> The object having node reference. </param>
///</memberMethod>
function cXmlDOM_fnRemoveAllNodes(objNode)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE )
		{
			objNode.removeAll();
			
			this.fnSetXML();
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			/// ** removeAll not available in mozilla
			this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnRemoveAllNodes");
	}
}

///<memberMethod name="fnPeekNode">
///<summary> This method is used to peek a node. </summary>
///<param name="oNode"> The object reference of the node. </param>
///</memberMethod>
function cXmlDOM_fnPeekNode(oNode)
{
	var oPeekNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE )
		{
			oPeekNode=oNode.peekNode();
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(oNode[0].hasChildNodes)
				oPeekNode=oNode[0].nextNode;
				//alert(oPeekNode);
		}
		return oPeekNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnPeekNode");
	}
}

///<memberMethod name="fnCreateTextNode">
///<summary> This method is used to create a text Node. </summary>
///<param name="strNodeValue"> The Value of the Text Node. </param>
///</memberMethod>
function cXmlDOM_fnCreateTextNode(strNodeValue)
{
	var oNode = null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko) 
		{
			oNode=oXmlDOM.createTextNode(strNodeValue);
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateTextNode");
	}
}

///<memberMethod name="fnAppendChild">
///<summary> This method is used append new child. </summary>
///<param name="oParentNode"> The Value of the Text Node. </param>
///<param name="oChildNode"> The New Child to be appended. </param>
///</memberMethod>
function cXmlDOM_fnAppendChild(oParentNode,oChildNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNode=oParentNode.appendChild(oChildNode);	
			
			this.fnSetXML();
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnAppendChild");
	}
}

///<memberMethod name="fnRemoveChild">
///<summary> This method is used append new child. </summary>
///<param name="oParentNode"> The Value of the Text Node. </param>
///<param name="oChildNode"> The New Child to be appended. </param>
///</memberMethod>
function cXmlDOM_fnRemoveChild(oParentNode,oChildNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNode = oParentNode.removeChild(oChildNode);	
			
			this.fnSetXML();
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnRemoveChild");
	}
}

///<memberMethod name="fnReplaceChild">
///<summary> This method is used to replace a child with a new child. </summary>
///<param name="oParentNode"> The node object from which the child node will be replaced. </param>
///<param name="oNewChild"> The object of the new child node. </param>
///<param name="oOldChild"> The object of the old child node. </param>
///</memberMethod>
function cXmlDOM_fnReplaceChild(oParentNode,oNewChild,oOldChild)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNode = oParentNode.replaceChild(oNewChild,oOldChild);	
			this.fnSetXML();
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnReplaceChild");
	}
}

///<memberMethod name="fnGetFirstChild">
///<summary> This method is used to get the first child of the specified node</summary>
///<param name="objNode"> The object of the node, from which child node will be fetched </param>
///</memberMethod>
function cXmlDOM_fnGetFirstChild(objNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			if(objNode.length)
				objNode=objNode[0];
				
			 oNode = objNode.firstChild;	
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetFirstChild");
	}
}

///<memberMethod name="fnGetLastChild">
///<summary> This method is used to get the Last child of the specified node</summary>
///<param name="objNode"> The object of the node, from which child node will be fetched </param>
///</memberMethod>
function cXmlDOM_fnGetLastChild(objNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			if(objNode.length)
				objNode=objNode[0];
			oNode = objNode.lastChild;	
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetLastChild");
	}
}

///<memberMethod name="fnGetNextSibling">
///<summary> This method is used to get the Next Sibling node of the specified node</summary>
///<param name="objNode"> The object of the node, from which next sibling node will be fetched </param>
///</memberMethod>
function cXmlDOM_fnGetNextSibling(objNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			if(objNode.length)
				objNode=objNode[0];
			oNode = objNode.nextSibling;	
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetNextSibling");
	}
}

///<memberMethod name="fnGetPrevioustSibling">
///<summary> This method is used to get the Previous Sibling node of the specified node</summary>
///<param name="objNode"> The object of the node, from which Previous sibling node will be fetched </param>
///</memberMethod>
function cXmlDOM_fnGetPreviousSibling(objNode)
{
	var oNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			if(objNode.length)
				objNode=objNode[0];
			
			 oNode = objNode.previousSibling;	
		}
		return oNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetPreviousSibling");
	}
}

///<memberMethod name="fnInsertBefore">
///<summary> Inserts a child node to the left of the specified node or at the end of the list. </summary>
///<param name="oNode"> An object specifying address of the node in which new child will be inserted. </param>
///<param name="oNewChild"> An object specifying address of the new node to be inserted. </param>
///<param name="oRefChild">The address of the reference node. A new child will be added under this child. </param>
///</memberMethod>
function cXmlDOM_fnInsertBefore(oNode,oNewChild,oRefChild,blnIsRootNode)
{
	var oResNode=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			if(blnIsRootNode)
			  oResNode = oXmlDOM.insertBefore(oNewChild,oNode);
			else
			 oResNode = oNode.insertBefore(oNewChild,oRefChild);	
			 
			this.fnSetXML();
		}
		return oResNode;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnInsertBefore");
	}
}

/// <memberMethod name="fnCreateAttribute">
/// <summary> Create an attribute of passed element. </summary>
///	<param name="strAttribute"> Name of the attribute (Key). </param>
/// </memberMethod>
function cXmlDOM_fnCreateAttribute(strAttribute)
{
	var oAttr=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oAttr=oXmlDOM.createAttribute(strAttribute);
		}
		return oAttr;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateAttribute");
	}
}

/// <memberMethod name="fnCreateCDATASection">
/// <summary> Create an attribute of passed element. </summary>
///	<param name="strData"> Data to be placed in CDATA Section. </param>
/// </memberMethod>
function cXmlDOM_fnCreateCDATASection(strData)
{
	var oCDATASection=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oCDATASection = oXmlDOM.createCDATASection(strData);
		}
		return oCDATASection;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateCDATASection");
	}
}

/// <memberMethod name="fnCreateComment">
/// <summary> Create an attribute of passed element. </summary>
///	<param name="strData"> Data to be placed in Comment Node Section. </param>
/// </memberMethod>
function cXmlDOM_fnCreateComment(strData)
{
	var oComment=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oComment = oXmlDOM.createComment(strData);
		}
		return oComment;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateCDATASection");
	}
}

/// <memberMethod name="fnCreateDocumentFragment">
/// <summary> Creates a DocumentFragment. A DocumentFragment node can have the following child node types: 
///  Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference. </summary>
/// </memberMethod>
function cXmlDOM_fnCreateDocumentFragment()
{
	var oDocFrag=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oDocFrag= oXmlDOM.createDocumentFragment();
		}
		return oDocFrag;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateCDATASection");
	}
}

/// <memberMethod name="fnCreateEntityReference">
/// <summary> Creates a new Entity Reference Object. </summary>
///	<param name="strERName"> Name of the Entity Reference to be created. </param>
/// </memberMethod>
function cXmlDOM_fnCreateEntityReference(strERName)
{
	var oEntityRef=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE )
		{
			oEntityRef= oXmlDOM.createEntityReference(strERName);
			
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			/// NA**
		}
		return oEntityRef;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateEntityReference");
	}
}

/// <memberMethod name="fnCreateProcessingInstruction">
/// <summary> Creates a new Entity Reference Object. </summary>
///	<param name="strTarget"> A String specifying the target part of the processing instruction. </param>
///	<param name="strData"> A string specifying the rest of the processing instruction preceding the closing 
/// ?> characters. </param>
/// </memberMethod>
function cXmlDOM_fnCreateProcessingInstruction(strTarget,strData)
{
	var oProcInst=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE  || oJSFW.objBrowserInfo.IsGecko)
		{
			oProcInst= oXmlDOM.createProcessingInstruction(strTarget,strData);
			
		}
		return oProcInst;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnCreateProcessingInstruction");
	}
}

/// <memberMethod name="fnGetAttribute">
/// <summary> Gets attribute of passed element. </summary>
///	<param name="oElement"> Contains the element object for which an attribute is to be get. </param>
///	<param name="strAttribute"> Name of the attribute (Key). </param>
/// </memberMethod>
function cXmlDOM_fnGetAttribute(oElement,strAttribute)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oElement.getAttribute(strAttribute);
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetAttribute");
	}
}

/// <memberMethod name="fnRemoveAttribute">
/// <summary>Removes attribute of passed element. </summary>
///	<param name="oElement"> Contains the element object for which an attribute is to be removed. </param>
///	<param name="strAttributeName"> Contains the element name which is to be removed. </param>
/// </memberMethod>
function cXmlDOM_fnRemoveAttribute(oElement,strAttributeName)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oElement.removeAttribute(strAttributeName);
			 this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnRemoveAttribute");
	}
}



/// <memberMethod name="fnInsertData">
/// <summary>It Replaces the data from the specified node.</summary>
///	<param name="oNode"> Contains the node object in which the data is to be inserted. </param>
///	<param name="intOffset"> Contains offset, in characters, at which to start inserting string data. </param>
///	<param name="strData"> Specifies the characters to insert. </param>
/// </memberMethod>
function cXmlDOM_fnInsertData(oNode,intOffset,strData)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{			
			 oNode.insertData(intOffset,strData);
			 this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnInsertData");
	}
}

/// <memberMethod name="fnDeleteData">
/// <summary>It deletes the data from the specified node.</summary>
///	<param name="oNode"> Contains the node object from which the data is to be removed. </param>
///	<param name="intOffset"> Contains offset, in characters, at which to start deleting string data. </param>
///	<param name="intCount"> Specifies the number of characters to delete. </param>
/// </memberMethod>
function cXmlDOM_fnDeleteData(oNode,intOffset,intCount)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oNode.deleteData(intOffset,intCount);
			 this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnDeleteData");
	}
}

/// <memberMethod name="fnReplaceData">
/// <summary>It Replaces the data from the specified node.</summary>
///	<param name="oNode"> Contains the node object from which the data is to be replaced. </param>
///	<param name="intOffset"> Contains offset, in characters, at which to start Replacing string data. </param>
///	<param name="intCount"> Specifies the number of characters to Replace. </param>
///	<param name="strData"> Specifies the Replacing characters. </param>
/// </memberMethod>
function cXmlDOM_fnReplaceData(oNode,intOffset,intCount,strData)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			 oNode.replaceData(intOffset,intCount,strData);
			 this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnReplaceData");
	}
}

/// <memberMethod name="fnRemoveNamedItem">
/// <summary>It Removes a specified attribute and returns the attribute of type NODE.</summary>
///	<param name="oNode"> Contains the node object from which the item is to be removed. </param>
///	<param name="strItem"> Specifies the name of the item.</param>
/// </memberMethod>
function cXmlDOM_fnRemoveNamedItem(oNode,strItem)
{
	var oNodeItem=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNodeItem=oNode.attributes.removeNamedItem(strItem);
			this.fnSetXML();
		}
		return oNodeItem;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnRemoveNamedItem");
	}
}

/// <memberMethod name="fnSetNamedItem">
/// <summary>It Sets a specified attribute and returns the attribute of type NODE.</summary>
///	<param name="oNode"> Contains the node object from which the item is to be get. </param>
///	<param name="strItem"> Specifies the name of the item.</param>
/// </memberMethod>
function cXmlDOM_fnSetNamedItem(oNode,strItem)
{
	var oNodeItem=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNodeItem=oNode.attributes.setNamedItem(strItem);
			this.fnSetXML();
		}
		return oNodeItem;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSetNamedItem");
	}
}

/// <memberMethod name="fnGetNamedItem">
/// <summary>It Gets a specified attribute and returns the attribute of type NODE.</summary>
///	<param name="oNode"> Contains the node object from which the item is to be get. </param>
///	<param name="strItem"> Specifies the name of the item.</param>
/// </memberMethod>
function cXmlDOM_fnGetNamedItem(oNode,strItem)
{
	var oNodeItem=null;
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oNodeItem=oNode.attributes.getNamedItem(strItem);
			this.fnSetXML();
		}
		return oNodeItem;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetNamedItem");
	}
}

/// <memberMethod name="fnSetAttribute">
/// <summary>Sets attribute of passed element. </summary>
///	<param name="oElement">Contains the element object for which an attribute is to be set. </param>
///	<param name="strAttribute">Name of the attribute (Key).</param>
///	<param name="strValue">Value of the attribute (Value).</param>
/// </memberMethod>
function cXmlDOM_fnSetAttribute(oElement,strAttribute, strValue)
{
	try
	{
		if(oJSFW.objBrowserInfo.IsIE || oJSFW.objBrowserInfo.IsGecko)
		{
			oElement.setAttribute(strAttribute, strValue);
			this.fnSetXML();
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSetAttribute");
	}
}

/// <memberMethod name="fnGetElementsByTagName">
/// <summary>Gets Elements with the specified tag name. </summary>
///	<param name="strTagName">Contains the tag name/param>
/// </memberMethod>
function cXmlDOM_fnGetElementsByTagName(strTagName)
{
	try
	{
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			arrNodes = oXmlDOM.getElementsByTagName(strTagName);
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes("//"+strTagName);
			}
		}
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetElementsByTagName");
	}	
}

/// <memberMethod name="fnReadyStateChange">
/// <summary>This function is called when ready state changes</summary>
/// </memberMethod>
function cXmlDOM_fnXMLDOMReadyStateChange()
{
	try
	{
		this.intReadyState=oXmlDOM.readyState;
		eval(strfnReadyStateChange());
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnXMLDOMReadyStateChange");
	}
}

/// <memberMethod name="fnAbort">
/// <summary>This function aborts the current file or string load.</summary>
/// </memberMethod>
function cXmlDOM_fnAbort()
{
	oXmlDOM.abort();
}

///<memberMethod name="fnNodeExists">
///<summary> This method is used to find whether a node exists within a file. </summary>
///<param name="strNode">This parameter stores the node name to be searched.</param>
///</memberMethod>
function cXmlDOM_fnNodeExists(strNode)
{
	var arrNodes = null;	
	try
	{
		///-- Check if node exist return node object if exists.
		///-- GetElementsByTagName returns the elements having name, user has provided
		arrNodes = this.fnGetElementsByTagName(strNode);
		if(arrNodes.length>0)
			return true;
		else
			return false;
	}	
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnNodeExists");
	}
}

///<memberMethod name="fnHasChildNodes">
///<summary> This method is used to find whether a node has child nodes or not.</summary>
///<param name="oNode"> This parameter stores the node object whose child nodes are to be checked.</param>
///</memberMethod>
function cXmlDOM_fnHasChildNode(oNode)
{
	try
	{
		///-- User hasChildNodes method and return the status
		return oNode.hasChildNodes();
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnHasChildNode");
	}
	
}
///<memberMethod name="fnpvtHasChildNodes">
///<summary> This method is used to find whether a node has child nodes or not.</summary>
///<param name="oNode">This parameter stores the node name which is to be checked.</param>
///</memberMethod>
function cXmlDOM_fnpvtHasChildNodes(oNode)
{
	switch(oNode.nodeType)
	{
		case 3 :
		case 4 :
		case 7 :
		case 8 :
			return false;
			break;
		default:
			return true;
			break;
	}
}

///<memberMethod name="fnSelectNodes">
///<summary>This method is used to select the specified node.</summary>
///<param name="strNode">This parameter stores the node name to be searched.</param>
///</memberMethod>
function cXmlDOM_fnSelectNodes(strNode)
{
	var arrNodes = [];
	try
	{
		///-- Validated XPath 
		strNode=this.fnValidateXPath(strNode);
		
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
		
			arrNodes = oXmlDOM.selectNodes(strNode);
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes(strNode);
			}
		}
		
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSelectNodes");
	}	
}

///<memberMethod name="fnpvtSelectNodes">
///<summary> This method is used to find whether a node with given Attribute and value pair exists. </summary>
///<param name="strBuildPath">This parameter stores the XPath for the node.</param>
///<param name="XNode">This parameter stores the XmlDOM object.</param>
///</memberMethod>	
function cXmlDOM_fnpvtSelectNodes(strBuildPath)
{
	try
	{
		///-- Mozilla supports XPath with two objects. XPathEvaluator,XPathResults.
		///-- With an Evaluate method to search the results according to the specified filter.
		var oNSResolver = oXmlDOM.createNSResolver(oXmlDOM.documentElement);
		var aItems = oXmlDOM.evaluate(strBuildPath,oXmlDOM,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);	
		var aResult = [];
		
		for(i=0;i<aItems.snapshotLength;i++)
		{
			aResult[i] = aItems.snapshotItem(i);
		}
		return(aResult);
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnpvtSelectNodes");
	}
}

///<memberMethod name="fnSelectSingleNode">
///<summary>This method is used to select single node.</summary>
///<param name="strNode">This parameter stores the node name to be searched.</param>
///</memberMethod>
function cXmlDOM_fnSelectSingleNode(strNode)
{
	var arrNodes = null;
	try
	{
		///-- Validated XPath 
		strNode=this.fnValidateXPath(strNode);
		
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
				
			arrNodes = oXmlDOM.selectSingleNode(strNode);
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectSingleNodes(strNode);
			}
		}
		
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSelectSingleNode");
	}	
}

///<memberMethod name="fnpvtSelectSingleNodes">
///<summary>This method is used to find whether a node exists.</summary>
///<param name="strBuildPath">This parameter stores the XPath for the node.</param>
///<param name="XNode">This parameter stores the XmlDOM object.</param>
///</memberMethod>	
function cXmlDOM_fnpvtSelectSingleNodes(strBuildPath)
{
	try
	{
		var xItems = this.fnpvtSelectNodes(strBuildPath);
		if(xItems.length > 0)
		{
			return xItems[0];	
		}
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnpvtSelectSingleNodes");
	}
}

///<memberMethod name="fnGetAttributeOfNode">
///<summary>This method is used to return the Attribute set of specified node.</summary>
///<param name="strNode">This parameter stores the node name.</param>
///</memberMethod>	
function cXmlDOM_fnGetAttributeOfNode(strNode)
{
	var arrNodes = [];
	try
	{
		///-- Validated XPath 
		strNode=this.fnValidateXPath(strNode);
		
		///-- Detect Browser and get Attributes of the node, user has passed.
		///-- '@' is a DESCRIPTOR of attribute.
		///-- '*' represents ALL.
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
			arrNodes = oXmlDOM.selectNodes(strNode+"[@*]");
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes(strNode+"[@*]");
			}
		}
		if(arrNodes.length > 0)
			return arrNodes[0].attributes;
		else
			return null;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetAttributeOfNode");
	}	
}

///<method name="fnNodeExistsWithAttribute">
///<summary> This method is used to find whether a node with given attribute.</summary>
///<param name="strNode">This parameter stores the node name which is to be checked.</param>
///<param name="strAttribute">This parameter stores the Attribute of the node.</param>
///</memberMethod>
function cXmlDOM_fnNodeExistsWithAttribute(strNode,strAttribute)
{
	var arrNodes = [];
	
	try
	{
		///-- Validated XPath 
		strNode=this.fnValidateXPath(strNode);
		
		///-- Detect Browser and check Node exists with an Attribute.
		///-- '@' is a DESCRIPTOR of attribute.
		///-- '*' represents ALL.
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
			arrNodes = oXmlDOM.selectNodes(strNode+"[@"+strAttribute+"]");
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes(strNode+"[@"+strAttribute+"]");
			}
		}
		if(arrNodes.length>0)
			return true;
		else
			return false;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnNodeExistsWithAttribute");
	}	
}

///<method name="fnNodeExistsWithAttributeValue">
///<summary>This method is used to find whether a node with given attribute and value pair exists</summary>
///<param name="strNode">This parameter stores the node name which is to be checked.</param>
///<param name="strAttribute">This parameter stores the Attribute of the node.</param>
///<param name="strAttributeValue">This parameter stores the value of the given Attribute.</param>
///</memberMethod>
function cXmlDOM_fnNodeExistsWithAttributeValue(strNode,strAttribute,strAttributeValue)
{
	var arrNodes = [];
	try
	{
	
		///-- Validated XPath 
		strNode=this.fnValidateXPath(strNode);
		
		///-- Detect Browser and check Node exists with an Attribute and Value pair.
		///-- '@' is a DESCRIPTOR of attribute.
		///-- '*' represents ALL.
		///-- '//' represents start with the node name contained in strNode.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
			arrNodes = oXmlDOM.selectNodes(strNode+"[@"+strAttribute+"='" + strAttributeValue + "']");
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes(strNode+"[@"+strAttribute+"='" + strAttributeValue + "']");
			}
		}
		
		if(arrNodes.length>0)
			return true;
		else
			return false;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnNodeExistsWithAttributeValue");
	}	
}

///<memberMethod name="fnSelectNodeWithAttribute">
///<summary>This method is used to return the node with the specified Attribute.</summary>
///<param name="strAttribute">This parameter stores the Attribute.</param>
///</memberMethod>	
function cXmlDOM_fnSelectNodeWithAttribute(strAttribute)
{
	var arrNodes = [];
	try
	{
		///-- Detect Browser and select Node with an Attribute.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
		
			arrNodes = oXmlDOM.selectNodes("//*[@"+strAttribute+"]");
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes("//*[@"+strAttribute+"]");
			}
		}
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSelectNodeWithAttribute");
	}	
}

///<memberMethod name="fnSelectNodeWithAttributeValue">
///<summary>This method is used to return the node with the specified Attribute and value pair.</summary>
///<param name="strAttribute">This parameter stores the Attribute.</param>
///<param name="strAttributeValue">This parameter stores the value.</param>
///</memberMethod>	
function cXmlDOM_fnSelectNodeWithAttributeValue(strAttribute,strAttributeValue)
{
	var arrNodes = [];
	try
	{
		///-- Detect Browser and select Node with an Attribute and Value pair.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
		
			arrNodes = oXmlDOM.selectNodes("//*[@"+strAttribute+"='"+strAttributeValue+"']");
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes("//*[@"+strAttribute+"='"+strAttributeValue+"']");
			}
		}
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnSelectNodeWithAttributeValue");
	}	
}

///<memberMethod name="fnGetAllNodesWithCData">
///<summary>This method is used to return the CData nodes.</summary>
///</memberMethod>	
function cXmlDOM_fnGetAllNodesWithCData()
{
	var arrNodes = [];
	
	try
	{
		///-- Detect Browser and Get All nodes with CDATA.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
			arrNodes = oXmlDOM.selectNodes('//*[text()]');
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes('//*[text()]');
			}
		}
		return arrNodes;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetAllNodesWithCData");
	}
}

///<memberMethod name="fnGetNodeCDataContent">
///<summary>This method is used to return the CData nodes.</summary>
///</memberMethod>	
function cXmlDOM_fnGetNodeCDataContent(strNode)
{
	var arrNodes = [];
	var strData=null;
	try
	{
		strNode=this.fnValidateXPath(strNode);

		///-- Detect Browser and Get All nodes with CDATA and return the content of the node user has provided.
		if(oJSFW.objBrowserInfo.IsIE)
		{
			oXmlDOM.setProperty("SelectionLanguage", "XPath");
			arrNodes = oXmlDOM.selectNodes(strNode+'[text()]');
			if(arrNodes.length>0)
				strData = arrNodes[0].text;
		}
		else if(oJSFW.objBrowserInfo.IsGecko)
		{
			if(document.implementation.hasFeature("XPath","3.0"))
			{
				arrNodes = this.fnpvtSelectNodes(strNode+'[text()]');
				if(arrNodes.length>0)
					strData =arrNodes[0].textContent;
			}
		}
		return strData;
	}
	catch(ex)
	{
		oError = ex.message;
		cXmlDOM_fnThrowError(oError,"cXmlDOM_fnGetNodeCDataContent");
	}
}





/* Meghna's code
///<memberMethod name="fnCheckChildNodes">
///<summary>
/// This method is used to find whether a node exists within a file 
///</summary>
///<param name="oNode">
///	This parameter stores the node name to be searched
///</param>
///</memberMethod>

function cXmlDOM_fnCheckChildNodes(oNode,srchnode)
{
	var i = 0 ;
	//alert(oNode.nodeName+' '+srchnode.nodeName);
	// *** if((oNode.nodeName == srchnode))
	if((oNode.nodeName == srchnode.nodeName ))
	{
		nNodeLevel++;
		//alert(srchNodeProperty +' '+node.getAttribute(srchNodeProperty)+' ' +srchNodePropertyAttributeValue);
		if(oNode.getAttribute(srchNodeProperty) == srchNodePropertyAttributeValue)
		{
			this.blnNodeExists = true;
			return true;
		}
			
	}
	else 
	{
		//alert('oNode.hasChildNodes()->'+node.hasChildNodes());
		//alert('fnpvtHasChildNodes(oNode)->'+this.fnpvtHasChildNodes(oNode));
		// *** if(oNode.hasChildNodes() && (fnpvtHasChildNode(oNode)))
		if(oNode.hasChildNodes() && (this.fnpvtHasChildNodes(oNode)))
		{
			
			nNodeLevel++;
			//alert('node.childNodes.length->'+node.childNodes.length);
			while(i<oNode.childNodes.length)
			{
				var currNode = oNode.childNodes[i];
				//alert('currNode in if->'+currNode.nodeName);
				if (this.fnCheckChildNodes(currNode,srchnode))
				{
					
					i = oNode.childNodes.length;
					return true;
				}
				else
				{
					if(this.blnNodeExists==true)
					{
						i = oNode.childNodes.length;
						return true;
					}
					else
						i++;						
				}
			}
		}
		else 
		{
			
			nNodeLevel--;
			var parentNode = oNode.parentNode.parentNode;
			
			var immediateParentNode = oNode.parentNode;
			
			j=0;
			
			while(j<parentNode.childNodes.length)
			{
				if(immediateParentNode.nodeName == parentNode.childNodes[j].nodeName)
				{
					var currNode = parentNode.childNodes[j].nextSibling;
					//alert('currNode in else->'+currNode.nodeName);
					
					if(currNode!=null)
					{
						if (this.fnCheckChildNodes(currNode,srchnode))
						{
							if(this.blnNodeExists == true)
							{
								j = parentNode.childNodes.length;
								return true;
							}
						}
						else
							j++;
					
					}
					else
						j++;
					
												
				}
				else
				{
					j++;
				}
			}
		}
	}
	
	return false;			
}
*/
