// ///////////////////////////////////////////////////////////////////////
//  Author					: Vishwanath Patel
//  Date					: 8-July-2005
//  Decription				: This JS is like a framework code in JavaScript.
//							Developer need not take care of Browser while writting the
//							Client-side code. All browser specific care has beeen tried 
//							to be taken in this file.
//
//  Copyright				: (c) Avani Cimcon, 2001
//	Modification History	: Nidhi Vithlani
//	Modification History	: Kinjal Desai
//  Decription				: Adding some functions is JSFW class. Commenting whole file with new commenting standards.
//							  Adding some function in built-in class prototypes.
// ///////////////////////////////////////////////////////////////////////

// ///START////// Additional functions for Array
// Add item to array
Array.prototype.fnAddItem=function(item)
{
	var i=this.length;
	this[i]=item;
	return i;
};

//Remove item from Array
Array.prototype.fnRemoveItem=function(item)
{
	var blnItemExistFlag=false;
			try
			{
				if(item=="" || item==null)
				{
					throw new cACTLException("Item doesnot exists","fnRemoveItem");
				}	
				for(nCtr=0;nCtr<this.length;nCtr++)
				{
					///--For removing the given key from the array of keys
					if(this[nCtr]==item)
					{
						blnItemExistFlag=true;
						this.splice(nCtr,1);
						return nCtr;
					}
					else
					{
						blnItemExistFlag=false;
					}
					
				}
				if(blnItemExistFlag==false)
				{
					throw new cACTLException("Item doesnot exists","fnRemoveItem");
				}
			}
			catch(ex)
			{
				throw new cACTLException(ex.message);
			}
//	this.splice(nStartPosition,nDeleteCount);
};




// Get index of array element
Array.prototype.fnIndexOf=function(value)
{
	for (var i=0;i<this.length;i++)
	{
		if (this[i]==value) return i;
	};
	return-1;
};
// ///END////// Additional functions for Array

// ///START////// Additional functions for String
//Returns true if string starts with specified value, false otherwise
String.prototype.fnStartsWith=function(value)
{
	return (this.substr(0,value.length)==value);
};
//Returns true if string starts with specified value, false otherwise
String.prototype.fnEndsWith=function(value)
{
	var L1=this.length;
	var L2=value.length;
	if (L2>L1) return false;
	return (L2==0||this.substr(L1-L2,L2)==value);
};
//Remove portion of stringS
String.prototype.fnRemove=function(start,length)
{
	var s="";
	if (start>0)
		s=this.substring(0,start);
	if (start+length<this.length)
		s+=this.substring(start+length,this.length);
	return s;
};
//Trim string for white space
String.prototype.fnTrim=function()
{
	return this.replace(/(^\s*)|(\s*$)/g,"");
};
//Trim string from left side
String.prototype.fnLTrim=function()
{
	return this.replace(/^\s*/g,"");
};
//Trim string from right side
String.prototype.fnRTrim=function()
{
	return this.replace(/\s*$/g,"");
};
//Replace new line character with given character
String.prototype.fnReplaceNewLineChars=function(replacement)
{
	return this.replace(/\n/g,replacement);
}
//Returns true if string is valid email address, false otherwise.
String.prototype.fnIsEmail=function()
{
//    var sArrTemp = this.split( "@" );
	if(this.substr(this.lastIndexOf(".")).length > 5) return false;

	// Check for more than one consecutive periods (.).
//	if ( sArrTemp.length == 2 )
//	{
		var strREStr = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
		var oRegExp = new RegExp( strREStr , "gi"  );
		return oRegExp.test(String(this));
		/*var oREEmail = new RegExp("\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", "gi");
		//alert(oREEmail.test(this));
		if ( this.fnTrim() == "" || this.search( oREEmail ) == -1 )
			return false;
		else
			return true;*/
//	}
//	else
//	{
//		return false;
//	}

	/*
	//var oREEmail = new RegExp( "^([a-zA-Z_0-9])+@(([a-zA-Z0-9\-])+\.)+([\.][a-zA-Z0-9]{2,4})$" );

	// acc. to MSDN
	//    var oREEmail = new RegExp( "^(([\[][0-9]{1,3}[\]][\.][\[][0-9]{1,3}[\]][\.][\[][0-9]{1,3}[\]][\.][\[][0-9]{1,3}[\]])|(([a-zA-Z_0-9])+([a-zA-Z]{2,4}|[0-9]{1,3})))$" );
	//     ^([a-zA-Z_0-9])+@(\[[0-9]{1,3}\])$

	// @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
	*/
}

//Returns true if string is valid URL, false otherwise.
String.prototype.fnIsURL=function()
{
	//var oRegExp = new RegExp( "^.*[.][.]+.*$" , "gi"  );
	if(this.indexOf("..")!=-1) return;
	
	// Check for more than one consecutive periods (.).
	
	var oRegExp = new RegExp( "(https?://)?([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?" , "gi"  );
	//ASP.NET RExp:- http://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?
	
	//oRegExp = new RegExp( "https?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?" , "gi"  );
	return oRegExp.test(String(this)); 
}

//Returns true if string is valid Date, false otherwise.
String.prototype.fnIsDate = function(sSeparator)
{
	var sSeparator = String( sSeparator );
	if( typeof sSeparator == "undefined" || sSeparator.fnTrim() =="")
	{
		sSeparator = "/";
	}
	var bReturn = true;

	var nYear, nMonth, nDay;
	var sDate = String( this );
	var sArrDate = sDate.split( sSeparator );

	if( sDate.length > 10 || sDate.length < 5 ) 
	{
		bReturn = false;
	}
	else if( sArrDate.length != 3 )
	{
		bReturn = false;
	}
	else if( String( sArrDate[0] ).length > 2 || String( sArrDate[1] ).length > 2 || String( sArrDate[2] ).length > 4 )
	{
		bReturn = false;
	}
	else 
	{
		nMonth = parseInt( sArrDate[0], 10 );
		nDay   = parseInt( sArrDate[1], 10 );
		nYear  = parseInt( sArrDate[2], 10 );

		if( isNaN( nDay ) || isNaN( nMonth ) || isNaN( nYear ) 
			|| nDay <= 0  || nMonth <= 0 || nYear <= 0 
			|| nDay > 31 || nMonth > 12 )
		{
			bReturn = false;
		}
		else
		{
			switch(nMonth)
			{
				case 2:
					if ( ( nYear % 100 == 0 && nYear % 400 == 0 ) 
   			          || ( nYear % 100 != 0 && nYear % 4 == 0 ) )
					{
						// Leap year.
						if( nDay > 29 )
							bReturn = false;
					}
					else if( nDay > 28 )
						bReturn = false;
				break;

				case 4:
				case 6:
				case 9:
				case 11:
						if( nDay > 30 )
							bReturn = false;
				break;
			}
		}
	}
	
	return bReturn;
}

//Compares given dates and returns -1, 0, and 1.
String.prototype.fnCompareDates=function (dtTarget, sSeparator)
{
	var sSeparator = String( sSeparator );
	if( typeof sSeparator == "undefined" || sSeparator.trim() =="")
	{
		sSeparator = "/";
	}

	var nReturn = null;
	if( this.isDate(sSeparator) && dtTarget.isDate(sSeparator) )
	{
		var sArrDateThis = this.split( sSeparator );
		var sArrDateTarg = dtTarget.split( sSeparator );
		var nThis = String(sArrDateThis[2]) + String(sArrDateThis[0]) + String(sArrDateThis[1]);
		var nTarget = String(sArrDateTarg[2]) + String(sArrDateTarg[0]) + String(sArrDateTarg[1]);
	
		if( parseInt( nThis, 10 ) > parseInt( nTarget, 10 ) )
		{
			nReturn = 1;
		}
		else if( parseInt( nThis, 10 ) < parseInt( nTarget, 10 ) )
		{
			nReturn = -1;
		}
		else
		{
			nReturn = 0;
		}

	}
	return nReturn;
}

// ///END////// Additional functions for String


// ///START////// Some more functions for String. - Added by Nidhi Vithlani.
//Trims string with passed characeter
String.prototype.fnTrimAll=function(strChar)
{
	return this.replace(new RegExp("^(" + strChar + ")*|(" + strChar + ")*$", "g"), "");
}
// ///END////// Some more functions for String.


// Start of (following) function added in built-in objects. KINJAL DESAI
Number.prototype.fnIsInRange = function(numValue1, numValue2)
{
	return ((numValue1 <= this) && (this <= numValue2));
};

String.prototype.fnIsInteger = function()
{
	var oRegExp = new RegExp("^[-|+]?[\\d]+$", "gi");
	return oRegExp.test(String(this));
};

String.prototype.fnIsFloat = function()
{
	var oRegExp = new RegExp("^[-|+]?[\\d]+[\\.]?[\\d]+$", "gi");
	return oRegExp.test(String(this));
};

String.prototype.fnIsStrictAlpha = function()
{
	var oRegExp = new RegExp("^[a-zA-Z]*$", "gi");
	return oRegExp.test(String(this));
};

String.prototype.fnIsAlpha = function()
{
	var oRegExp = new RegExp("^[a-zA-Z\s]*$", "gi");
	return oRegExp.test(String(this));
};

String.prototype.fnIsAlphaNumeric = function()
{
	var oRegExp = new RegExp("^[a-zA-Z0-9\s]*$", "gi");
	return oRegExp.test(String(this));
};

String.prototype.fnIsEmpty = function()
{
	if(this.length==0) 
		return true;
	else
		return false;
};

String.prototype.fnIsFormatValid = function(strRegExp, strFlag_gi)
{
	var oRegExp = new RegExp(strRegExp, strFlag_gi);
	return oRegExp.test(String(this));
};

String.prototype.fnIsInCustomFormat = function(strACTLRegExp, strFlag_gi)
{
	var oRegExp;
	strACTLRegExp.replace(/0/gi,"[0-9]");
	strACTLRegExp.replace(/9/gi,"[0-9]+");
	strACTLRegExp.replace(/a/gi,"[a-z]");
	strACTLRegExp.replace(/z/gi,"[a-z]+");
	oRegExp = new RegExp(strRegExp, strFlag_gi);
	
	return oRegExp.test(String(this));
}

// End of function added in built-in objects KINJAL DESAI

/// <class name="cJavaScriptFramework">
///	<summary>This class provides commonly used JS fucntionalities at ACTL layer, mostly isolating end-programmer with browser compatibility and providing standard access point for most of browser DOM features.</summary>
/// </class>
function cJavaScriptFramework()
{
	// ///////////////////////////////////////// 
	// Global variables for cJavaScriptFramework.
	// PROPERTIES for JavaScirptFramework class.

	///&& objBrowserInfo: to see Browser Info.
	this.objBrowserInfo = null;// = cJavaScriptFramework_objBrowserInfo;
	///&& blnDebug: Set or Get whether debug output is on or not.
	this.blnDebug = false;
	//	this.ObjectInstance = null;
	///&& intHighestZIndex : CAUTION-It do not get the highest ZIndex from all elements.. Its reference where user can set and get (it would give point-of communication for various control (and the page) script. It is used in ACTLSlider control
	this.intHighestZIndex = 10000;

	// //////////////////////////////////
	// METHODS cJavaScriptFramework class.

	//Constructor for cJavaScriptFramework.
	this.fnOnConstruct = cJavaScriptFramework_fnOnConstruct;
	// Debug.--> alert
	this.Debug = cJavaScriptFramework_fnDebug;
	// To get element by Id.
	this.fnGetElementById = cJavaScriptFramework_fnGetElementById;
	// To cancel the bubbling of the event.
	this.fnCancelBubble = cJavaScriptFramework_fnCancelBubble;
	// To cancel the default behaviour of the event.
	this.fnCancelEvent = cJavaScriptFramework_fnCancelEvent;
	// Return the event on which the event has been fired.
	// In context of IE, it returns event.srcElement.
	this.fnGetSrcElement = cJavaScriptFramework_fnGetSrcElement;
	// Returns event coordinates in the coordinate plane of the entire document.
	this.fnGetPageEventCoords = cJavaScriptFramework_fnGetPageEventCoords;
	// Returns event coordinates in the positioned element.
	this.fnGetElementEventCoords = cJavaScriptFramework_fnGetElementEventCoords;
	// Return the Element style.
	this.fnGetElementStyle = cJavaScriptFramework_fnGetElementStyle;
	//Swap Two Rows in Table
	this.fnSwapRow = cJavaScriptFramework_fnSwapRow;
	//Returns the InnerText.
	this.fnGetInnerText = cJavaScriptFramework_fnGetInnerText;
	//Returns the OuterHTML.
	this.fnGetOuterHTML = cJavaScriptFramework_fnGetOuterHTML;
	//Returns the KeyCode.
	this.fnGetKeyCode = cJavaScriptFramework_fnGetKeyCode;
	//Assigns the KeyCode.
	this.fnSetKeyCode = cJavaScriptFramework_fnSetKeyCode;
	//Returns the Element's Attribute Value.
	this.fnGetAttribute = cJavaScriptFramework_fnGetAttribute;
	//Assigns the Value to Element's Attribute.
	this.fnSetAttribute = cJavaScriptFramework_fnSetAttribute;
	//Framework function for object initialization with null and exception handeling. It raises exception on null and error.
	this.fnObjectInitializer = cJavaScriptFramework_fnObjectInitializer;
	//Framework function for ActiveX initialization with null and exception handeling. It raises exception on null and error.
	this.fnActiveXInitializer = cJavaScriptFramework_fnActiveXInitializer;
	//Wrapper of Form.submit
	this.fnSubmitForm = cJavaScriptFramework_fnSubmitForm;
	//Wrapper of alert
	this.fnAlert = cJavaScriptFramework_fnAlert;
	//Wrapper of window.open
	this.fnWindowOpen = cJavaScriptFramework_fnWindowOpen;
	//Wrapper of window.close
	this.fnWindowClose = cJavaScriptFramework_fnWindowClose;
	//Wrapper of document.createElement
	this.fnCreateElement = cJavaScriptFramework_fnCreateElement;
	//Wrapper of removeChild
	this.fnRemoveChild = cJavaScriptFramework_fnRemoveChild;
	//Function to swap contents of two containers.
	this.fnSwapContent = cJavaScriptFramework_fnSwapContent;
	//Function to swap two nodes.
	this.fnSwapNodes = cJavaScriptFramework_fnSwapNodes;
	//Get Elements by Tag Name
	this.fnGetElementsByTagName = cJavaScriptFramework_fnGetElementsByTagName;
	//Get Elements by Name
	this.fnGetElementsByName = cJavaScriptFramework_fnGetElementsByName;
	//Wrapper for DOM.appendChild
	this.fnAppendChild = cJavaScriptFramework_fnAppendChild;
	//Wrapper for DOM.insertElement
	this.fnInsertBefore = cJavaScriptFramework_fnInsertBefore;
	//Function returns true if given node is parent of other given node.
	this.fnIsChild = cJavaScriptFramework_fnIsChild;
	//Sets element's style.display to '' or 'none'.
	this.fnSetDisplayStyle = cJavaScriptFramework_fnSetDisplayStyle;
	//Checks max length of specified element and returns true if length of value is less than specified, else it would cancleEvent and return false
	this.fnCheckMaxLength = cJavaScriptFramework_fnCheckMaxLength;
	//Can be used with or without events to check whether a string is buitl from (or without) given set of characters
	this.fnAllowOnly = cJavaScriptFramework_fnAllowOnly;
	//Returns true if given string contains ONLY specified characters, else false
	this.fnIsSrcStrCharacterFromCharSet = cJavaScriptFramework_fnIsSrcStrCharacterFromCharSet;
	//Returns Left or specified element.
	this.fnGetOffsetLeft = cJavaScriptFramework_fnGetOffsetLeft;
	//Returns Right or specified element.
	this.fnGetOffsetTop = cJavaScriptFramework_fnGetOffsetTop;
	//Returns element whose value is maximum in the given array
	this.fnMaxOfArray = cJavaScriptFramework_fnMaxOfArray;
	//Returns element whose value is minimum in the given array
	this.fnMinOfArray = cJavaScriptFramework_fnMinOfArray;
	this.fnGetElementsFromHTMLString = cJavaScriptFramework_fnGetElementsFromHTMLString;
	this.fnHTMLEncode = cJavaScriptFramework_fnHTMLEncode;
	this.fnHTMLDecode = cJavaScriptFramework_fnHTMLDecode;
	this.fnGlobalVariableExists = cJavaScriptFramework_fnGlobalVariableExists;
	this.fnGetPopupBlockerTip = cJavaScriptFramework_fnGetPopupBlockerTip
	this.fnGetUnusedGlobalVariableName = cJavaScriptFramework_fnGetUnusedGlobalVariableName;
	this.fnConfirm = cJavaScriptFramework_fnConfirm;
	this.fnGetTypeName = cJavaScriptFramework_fnGetTypeName;
	this.fnEncodeWithCRLF = cJavaScriptFramework_fnEncodeWithCRLF;
	this.fnDecodeWithCRLF = cJavaScriptFramework_fnDecodeWithCRLF;
	//Returns XML string of Form Elements 
	this.fnSerializeFormAsXML = cJavaScriptFramework_fnSerializeFormAsXML;
	//Returns string of Form Elements in QueryString Form
	this.fnSerializeFormForQuerystring = cJavaScriptFramework_fnSerializeFormForQuerystring;
	//Returns XML string of Parameter Object Elements
	this.fnSerializeParamObjectAsXML = cJavaScriptFramework_fnSerializeParamObjectAsXML;
	
	//Attaches Event
	this.fnAttachEvent = cJavaScriptFramework_fnAttachEvent;
	this.fnDetachEvent = cJavaScriptFramework_fnDetachEvent;
	this.fnCanHaveChildren = cJavaScriptFramework_fnCanHaveChildren ;
	this.fnSwap = cJavaScriptFramework_fnSwap;
	this.fnHasChildren = cJavaScriptFramework_fnHasChildren;
	this.fnGetActiveElement = cJavaScriptFramework_fnGetActiveElement;
	
	this.fnOnConstruct();


	/// <memberMethod name="fnOnConstruct">
	/// <summary>Constructor for cJavaScriptFramework.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnOnConstruct()
	{
		// ///START////// BROWSER DETECTION.
		var cJavaScriptFramework_objBrowserInfo = new Object();
		var cJavaScriptFramework_strAgent=navigator.userAgent.toLowerCase();
		cJavaScriptFramework_objBrowserInfo.IsIE=cJavaScriptFramework_strAgent.indexOf("msie")!=-1;
		cJavaScriptFramework_objBrowserInfo.IsGecko=!cJavaScriptFramework_objBrowserInfo.IsIE;
		cJavaScriptFramework_objBrowserInfo.IsMozila=(navigator.product == "Gecko");
		cJavaScriptFramework_objBrowserInfo.IsNetscape=cJavaScriptFramework_strAgent.indexOf("netscape")!=-1;
		if(cJavaScriptFramework_objBrowserInfo.IsIE)
		{
			cJavaScriptFramework_objBrowserInfo.MajorVer=navigator.appVersion.match(/MSIE (.)/)[1];
			cJavaScriptFramework_objBrowserInfo.MinorVer=navigator.appVersion.match(/MSIE .\.(.)/)[1];
		}
		else
		{
			cJavaScriptFramework_objBrowserInfo.MajorVer=0;
			cJavaScriptFramework_objBrowserInfo.MinorVer=0;
		};
		cJavaScriptFramework_objBrowserInfo.IsIE55OrMore = cJavaScriptFramework_objBrowserInfo.IsIE && ( cJavaScriptFramework_objBrowserInfo.MajorVer > 5 || cJavaScriptFramework_objBrowserInfo.MinorVer>=5);
		// ///END////// BROWSER DETECTION.

		// ///START////// DOM DETECTION.
		var cJavaScriptFramework_strDOMtype = '';
		if (document.getElementById)
			cJavaScriptFramework_strDOMtype = "STD";
		else if (document.all)
			cJavaScriptFramework_strDOMtype = "IE4";
		else if (document.layers)
			cJavaScriptFramework_strDOMtype = "NS4";
		cJavaScriptFramework_objBrowserInfo.strDOMtype = cJavaScriptFramework_strDOMtype;
		// ///END////// DOM DETECTION.
		
		this.objBrowserInfo = cJavaScriptFramework_objBrowserInfo;
	}



	// ///START////// COMMON DOM FUNCTIONS.
	// make an array to store cached locations of objects called by getElementById()
	var cJavaScriptFramework_arrGetElemObjs = new Array();

	/// <memberMethod name="fnGetElementById">
	///	<param name="idname"></param>
	///	<param name="forcefetch"></param>
	///	<param name="oDocument"></param>
	/// <summary>function to emulate document.getElementById.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementById( idname, forcefetch, oDocument )
	{
		if( String( typeof forcefetch ) == "undefined" || forcefetch!=false)
		{
			forcefetch = true;
		}
		if(String(typeof oDocument)=='undefined')
			oDocument = document;

		if (forcefetch || typeof(cJavaScriptFramework_arrGetElemObjs[idname]) == "undefined")
		{
			switch (this.objBrowserInfo.strDOMtype)
			{
				case "STD":
				{
					cJavaScriptFramework_arrGetElemObjs[idname] = oDocument.getElementById(idname);
				}
				break;
				case "IE4":
				{
					cJavaScriptFramework_arrGetElemObjs[idname] = oDocument.all[idname];
				}
				break;
				case "NS4":
				{
					cJavaScriptFramework_arrGetElemObjs[idname] = oDocument.layers[idname];
				}
				break;
			}
		}
		return cJavaScriptFramework_arrGetElemObjs[idname];
	}

	/// <memberMethod name="fnCancelBubble">
	///	<param name="eventobj"></param>
	/// <summary>function to cancel event bubble.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCancelBubble( eventobj )
	{
		if( this.objBrowserInfo.IsMozila )
		{
			eventobj.stopPropagation();
			this.Debug( "Event Bubble Cancelled." );
			return eventobj;
		}
		else if( this.objBrowserInfo.IsIE ) 
		{
			if( window.event != null )
			{
				//window.event.returnValue = false;
				window.event.cancelBubble = true;
				this.Debug( "Event Bubble Cancelled." );
				return window.event;
			}
			else
			{
				return null;
			}
		}
	}

	/// <memberMethod name="fnCancelEvent">
	///	<param name="eventobj"></param>
	/// <summary>function to cancel event.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCancelEvent( eventobj )
	{
		if( this.objBrowserInfo.IsMozila )
		{
			eventobj.preventDefault();
			this.Debug( "Default Event Cancelled." );
			return eventobj;
		}
		else if( this.objBrowserInfo.IsIE ) 
		{
			if( window.event != null )
			{
				window.event.returnValue = false;
				this.Debug( "Default Event Cancelled." );
				return window.event;
			}
			else
			{
				return null;
			}
		}
	}

	/// <memberMethod name="fnGetPageEventCoords">
	///	<param name="eventobj"></param>
	/// <summary>Returns page coordinate of the event object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetPageEventCoords( eventobj )
	{
		eventobj = (eventobj) ? eventobj : ( (window.event) ? event : null );

		var coords = {left:0, top:0};

		if( eventobj.pageX )
		{
			coords.left = eventobj.pageX;
			coords.top = eventobj.pageY;
		}
		else
		{
			coords.left = eventobj.clientX + document.body.scrollLeft /*- document.body.clientLeft*/;
			coords.top  = eventobj.clientY + document.body.scrollTop /*- document.body.clientTop*/;
			// Include HTML element space if necessary.
			/*if( document.body.parentElement && document.body.parentElement.clientLeft )
			{
				var bodyParent = document.body.parentElement;
				coords.left += bodyParent.scrollLeft - bodyParent.clientLeft;
				coords.top  += bodyParent.scrollTop - bodyParent.clientTop;
			}*/
		}

		return coords;
	}

	/// <memberMethod name="fnGetElementEventCoords">
	///	<param name="eventObj"></param>
	/// <summary>Returns positioned coordinate of the event object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementEventCoords( eventObj )
	{
		eventObj = (eventObj) ? eventObj : ( (window.event) ? event : null );
		var oElem =( eventObj.target ) ? eventObj.target : ( ( eventObj.srcElement ) ? eventObj.srcElement : null );

		var oCoords = {left:0,top:0};

		if( eventObj.layerX )
		{
			/*
			var borders = 
				{
					left:parseInt( this.fnGetElementStyle( "progressBar", "borderLeftWidth", "border-left-width" ) ),
					top: parseInt( this.fnGetElementStyle( "progressBar", "borderTopWidth" , "border-top-width"  ) )
				};
			*/
			oCoords.left = eventObj.layerX // - borders.left;
			oCoords.top  = eventObj.layerY // - borders.top;
		}
		else if( eventObj.offsetX )
		{
			oCoords.left = eventObj.offsetX;
			oCoords.top  = eventObj.offsetY;
		}

		//this.fnCancelBubble( eventObj );
		return oCoords;
	}

	/// <memberMethod name="fnGetElementStyle">
	///	<param name="oElement"></param>
	///	<param name="strStyleAttribute"></param>
	/// <summary>Returns style attribute for given object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementStyle( oElement, strStyleAttribute)
	{
		if( oElement.currentStyle )
		{
			return oElement.currentStyle[ strStyleAttribute ];
		}
		else if( window.getComputedStyle )
		{
			var oCompStyle = window.getComputedStyle( oElement, "" );
			return oCompStyle.getPropertyValue( strStyleAttribute );
		}
	}

	/// <memberMethod name="fnGetSrcElement">
	///	<param name="eventObj"></param>
	/// <summary>Returns srcElement of the event object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetSrcElement( eventObj )
	{
		eventObj = (eventObj) ? eventObj : ( (window.event) ? event : null );
		
		if( eventObj )
		{
			var oElem = ( eventObj.target ) ? eventObj.target : ( ( eventObj.srcElement ) ? eventObj.srcElement : null );
			if( oElem.nodeType == 3 ) // Text Node
			{
				oElem = oElem.parentNode;
			}
			if( oElem )
			{
				return oElem;
			}
		}

		return null;
	}

	/// <memberMethod name="fnSwapRow">
	///	<param name="oRow1"></param>
	///	<param name="oRow2"></param>
	/// <summary>Function to swap two rows of a table.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSwapRow(oRow1,oRow2)
	{

		if( this.objBrowserInfo.IsIE ) 
		{
			//Swap Row Using swapNode Function Supported by IE
			oRow1.swapNode(oRow2);
		}
		else 
		{
			var nR1CellsLen = oRow1.cells.length; //Number of Cells in Row1
			var nR2CellsLen = oRow2.cells.length; //Number of Cells in Row2

			var nArrR1Cell = new Array();	// Array of Row1's Cells Removed from Row1
			var nArrR2Cell = new Array();	// Array of Row2's Cells Removed from Row2

			var nCntr ; //Counter

			var oTd;

			//Remove Cells from Row1 and Push in to Array
			for(nCntr = 0 ; nCntr < nR1CellsLen;nCntr++)
			{
				oTd = oRow1.cells[0];
				oRow1.removeChild(oTd);
				nArrR1Cell.push(oTd);
			}

			//Remove Cells from Row2 and Push in to Array
			for(nCntr = 0 ; nCntr < nR2CellsLen;nCntr++)
			{
				oTd = oRow2.cells[0];
				oRow2.removeChild(oTd);
				nArrR2Cell.push(oTd);
			}


			//Set Row2 from Row1's Remoed Cell's Array
			for(nCntr = 0 ; nCntr < nR1CellsLen;nCntr++)
			{
				oRow2.appendChild(nArrR1Cell[nCntr]);
			}

			//Set Row1 from Row2's Remoed Cell's Array
			for(nCntr = 0 ; nCntr < nR2CellsLen;nCntr++)
			{
				oRow1.appendChild(nArrR2Cell[nCntr]);
			}

		}
	}		

	/// <memberMethod name="fnDebug">
	///	<param name="sStr"></param>
	/// <summary>Function to trace execution path and significant conditions of JSFW functions.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnDebug( sStr )
	{
		if( this.blnDebug )
			alert( sStr );
	}


	// //END////// COMMON DOM FUNCTIONS.

	// ///START////// SOME MORE COMMON DOM FUNCTIONS. - Added By Nidhi Vithlani.

	/// <memberMethod name="fnGetInnerText">
	///	<param name="oSrcElement"></param>
	/// <summary>Returns innerText of passed element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetInnerText(oSrcElement)
	{
		if( this.objBrowserInfo.IsMozila )
		{
			return oSrcElement.textContent;
		}
		else //if( this.objBrowserInfo.IsIE ) 
		{
			return oSrcElement.innerText;
		}
	}

	/// <memberMethod name="fnGetOuterHTML">
	///	<param name="oSrcElement"></param>
	/// <summary>Returns outerText of passed element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetOuterHTML(oSrcElement)
	{
		if( this.objBrowserInfo.IsIE ) 
		{
			return oSrcElement.outerHTML;
		}
		else 
		{
			var oTempDiv =this.fnCreateElement('div',document);// window.document.createElement('div');
			var oTempSrcElement = oSrcElement.cloneNode(true);
			var strReturnHTML;
			//oTempDiv.appendChild(oTempSrcElement);
			this.fnAppendChild(oTempDiv,oTempSrcElement);
			strReturnHTML = oTempDiv.innerHTML;
			//oTempDiv.removeChild(oTempSrcElement);
			this.fnRemoveChild(oTempSrcElement);
			delete oTempSrcElement;
			delete oTempDiv;
			//window.document.removeChild(oTempDiv);
			return strReturnHTML;
		}
	}
	
	/// <memberMethod name="fnGetKeyCode">
	///	<param name="oEventObject"></param>
	/// <summary>Return key code from event object</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetKeyCode(oEventObject)
	{
		if(this.objBrowserInfo.IsIE)
			return oEventObject.keyCode;
		else
			return oEventObject.which;
	}
	
	/// <memberMethod name="fnSetKeyCode">
	///	<param name="oEventObject"></param>
	///	<param name="intValue"></param>
	/// <summary>Sets key code in event object</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetKeyCode(oEventObject, intValue)
	{
		if(this.objBrowserInfo.IsIE)
			oEventObject.keyCode = intValue;
		else
			oEventObject.which = intValue;
	}
	
	/// <memberMethod name="fnGetAttribute">
	///	<param name="oElement"></param>
	///	<param name="strAttribute"></param>
	/// <summary>Gets attribute of passed element</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetAttribute(oElement,strAttribute)
	{
		return oElement.getAttribute(strAttribute);
	}
	
	/// <memberMethod name="fnSetAttribute">
	///	<param name="oElement"></param>
	///	<param name="strAttribute"></param>
	///	<param name="strValue"></param>
	/// <summary>Sets attribute of passed element</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetAttribute(oElement,strAttribute, strValue)
	{
		return oElement.setAttribute(strAttribute, strValue);
	}
	
	// ///END////// SOME MORE COMMON DOM FUNCTIONS.
	
	
	// Start of (following) functions added by Kinjal Desai
	
	/// <memberMethod name="fnObjectInitializer">
	///	<param name="strClassName"></param>
	///	<param name="strOnNullExceptionMessage"></param>
	///	<param name="varArgumentArray"></param>
	/// <summary>Creates and returns Object of specified class. Will throw exception in case if object creation returns null.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnObjectInitializer(strClassName, strOnNullExceptionMessage, varArgumentArray)
	{
		///-- 1. Declaring variables
		var objUserObject;
		var intArgCounter, strActualArguemnts="";
		var strNullErrorMessage = "The object initialization failed." ///$$ Hardcoding default Null Exception message
		
		///-- 2. Initializing variables
		if(strOnNullExceptionMessage!= '' && strOnNullExceptionMessage!=null && typeof strOnNullExceptionMessage!='undefined')
			strNullErrorMessage = strOnNullExceptionMessage;

		///-- 3. Building Arguments string for eval
		if(typeof (varArgumentArray)=='undefined')
			varArgumentArray = new Array();
		for(var intArgCounter=0;intArgCounter<varArgumentArray.length;intArgCounter++)
		{
			strActualArguemnts += "," + ("varArgumentArray[" + intArgCounter + "]");
		}
		if(strActualArguemnts!='')
			strActualArguemnts = strActualArguemnts.substr(1);

		///-- 4. Creating object, returning if all OK, else throwing exception.
		objUserObject = eval("new " + strClassName + "(" + strActualArguemnts + ")");
		if(objUserObject==null)
		{
			this.Debug("Call to fnObjectInitializer(" + strClassName + ", ...) failed.");
			throw new cACTLException(strNullErrorMessage, "cJavaScriptFramework.fnObjectInitializer");
		}
		else
			this.Debug("Call to fnObjectInitializer(" + strClassName + ", ...) returning object.");
			
		return objUserObject;
	}

	/// <memberMethod name="fnActiveXInitializer">
	///	<param name="strClassNameOrShortName"></param>
	///	<param name="strOnNullExceptionMessage"></param>
	///	<param name="strLocation"></param>
	/// <summary>Create and returns an ActiveX object, throws exception in case ActiveX creation fails and returns null.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnActiveXInitializer(strClassNameOrShortName, strOnNullExceptionMessage, strLocation)
	{
		///-- 1. Declaring variables
		var objUserObject;
		var intArgCounter, strActualArguemnts="";
		var strNullErrorMessage = "The ActiveX initialization failed." ///$$ Hardcoding default Null Exception message
		//var strArrayShortDesc = new Array(), strArrayActualActiveXName = new Array();
		var strArrayShortDesc = this.fnObjectInitializer('Array','',[]);
		var strArrayActualActiveXName = this.fnObjectInitializer('Array','',[]);
		///-- 2. Intializing variables
		if(strOnNullExceptionMessage!= '' && strOnNullExceptionMessage!=null && typeof (strOnNullExceptionMessage)!='undefined')
			strNullErrorMessage = strOnNullExceptionMessage;
			
		strArrayShortDesc[0] = "MSXMLHTTP";
		strArrayActualActiveXName[0] = "Msxml2.XMLHTTP.4.0";

		strArrayShortDesc[1] = "MSXMLDOM";
		strArrayActualActiveXName[1] = "Microsoft.XMLDOM";
		///$$ User of this JS can add more short-name full-name pair as needed
		///-- User of this JS can add more short-name full-name pair as needed
		
		///-- 3. Check for short name, if found then get real name, else go with user-passed class name
		for(var intA=0;intA<strArrayShortDesc.length;intA++)
		{
			var t = strArrayShortDesc[intA].toLowerCase()
			var tt = strClassNameOrShortName.toLowerCase()
			if(strArrayShortDesc[intA].toLowerCase()==strClassNameOrShortName.toLowerCase())
			{
				strClassNameOrShortName = strArrayActualActiveXName[intA];
				break;
			}
		}
		
		///-- 4. Creating object, returning if all OK, else throwing exception.
		if(typeof (strLocation)!='undefined')
			objUserObject = eval("new ActiveXObject(strClassNameOrShortName,strLocation)");
		else
			objUserObject = eval("new ActiveXObject(strClassNameOrShortName)");

		if(objUserObject==null)
		{
			this.Debug("Call to fnActiveXInitializer(" + strClassNameOrShortName + ", ...) failed.");
			throw new cACTLException(strNullErrorMessage, "cJavaScriptFramework.fnActiveXInitializer");
		}
		else
			this.Debug("Call to fnActiveXInitializer(" + strClassNameOrShortName + ", ...) returning object.");
			
		return objUserObject;
	}
	/// <memberMethod name="fnSubmitForm">
	///	<param name="oForm"></param>
	///	<param name="strOptionalAction"></param>
	///	<param name="strOptionalMethod"></param>
	/// <summary>Wrapper for submitting form.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSubmitForm(oForm, strOptionalAction, strOptionalMethod)
	{
		if(typeof (strOptionalAction)!='undefined')
			oForm.action = strOptionalAction;
		if(typeof (strOptionalMethod)!='undefined')
			oForm.method = strOptionalMethod;
			
		oForm.submit();
	}

	/// <memberMethod name="fnAlert">
	///	<param name="strMessage"></param>
	/// <summary>Wrapper for alert.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnAlert(strMessage)
	{
		alert(strMessage);
	}

	/// <memberMethod name="fnWindowOpen">
	///	<param name="strURL"></param>
	///	<param name="strWindowName"></param>
	///	<param name="strOptionalFeatures"></param>
	/// <summary>Wrapper for window.open().</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnWindowOpen(strURL, strWindowName, strOptionalFeatures)
	{
		var oWindowObject;
		if(typeof (strOptionalFeatures)!='undefined')
			oWindowObject = window.open(strURL, strWindowName, strOptionalFeatures);
		else
			oWindowObject = window.open(strURL, strWindowName);
		if(oWindowObject==null)
			throw new cACTLException(this.fnGetPopupBlockerTip(), "cJavaScriptFramework.fnWindowOpen");
		return oWindowObject;
	}

	/// <memberMethod name="fnWindowClose">
	///	<param name="oWindow"></param>
	/// <summary>Wrapper for window.close().</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnWindowClose(oWindow)
	{
		oWindow.close();
	}
	/// <memberMethod name="fnCreateElement">
	///	<param name="oDocument"></param>
	///	<param name="strTag"></param>
	/// <summary>Wrapper for document.createElement().</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCreateElement(strTag,oOptionalParent)
	{
		if(typeof (oOptionalParent)=='undefined')
			oOptionalParent = document;
		return oOptionalParent.createElement(strTag);
	}
	/// <memberMethod name="fnRemoveChild">
	///	<param name="oChildToBeRemoved"></param>
	/// <summary>Wrapper for removeChild.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnRemoveChild(oChildToBeRemoved)
	{
		if(oChildToBeRemoved==null || oChildToBeRemoved.parentNode==null)
			return false;
		else
		{
			oChildToBeRemoved.parentNode.removeChild(oChildToBeRemoved);
			return true;
		}
	}

	/// <memberMethod name="fnSwapContent">
	///	<param name="oContainer1"></param>
	///	<param name="oContainer2"></param>
	/// <summary>Swaps content of two containers.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSwapContent(oContainer1, oContainer2)
	{
		var strContainer1InnerHTML, strContainer2InnerHTML;
		try
		{
			strContainer1InnerHTML = oContainer1.innerHTML;
			strContainer2InnerHTML = oContainer2.innerHTML;
			oContainer1.innerHTML = strContainer2InnerHTML;
			oContainer2.innerHTML = strContainer1InnerHTML;
		}
		catch(oExp)
		{
			oContainer1.innerHTML = strContainer1InnerHTML;
			oContainer2.innerHTML = strContainer2InnerHTML;
			throw new cACTLException(oExp.message, "cJavaScriptFramework.fnSwapContent");
		}
	}
	
	/// <memberMethod name="fnSwapNodes">
	///	<param name="oNode1"></param>
	///	<param name="oNode2"></param>
	/// <summary>Swaps two given nodes</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSwapNodes(oNode1, oNode2)
	{
		var oParentOfNode1, oParentOfNode2;
		var oNextOfNode1, oNextOfNode2;
		var intNoOfOtherSiblings;

		if(oJSFW.fnIsChild(oNode1, oNode2) || oJSFW.fnIsChild(oNode2, oNode1))
		{
			///&& Message may need to be reviewed.
			///%% Message may need to be reviewed.
			throw new cACTLException("Cannot swap a parent with its child.", "cJavaScriptFramework.fnSwapNodes");
		}
		oParentOfNode1 = oNode1.parentNode;
		oParentOfNode2 = oNode2.parentNode;
		
		oNextOfNode1 = oNode1.nextSibling;
		oNextOfNode2 = oNode2.nextSibling;
		
		/*if(oNextOfNode1==oNode2)
			oNextOfNode1 = oNode2.nextSibling;
		if(oNextOfNode2==oNode1)
			oNextOfNode2 = oNode1.nextSibling;*/
		
		//alert(oNextOfNode1 + " " + oNextOfNode2);
		this.fnRemoveChild(oNode1);
		this.fnRemoveChild(oNode2);
		
		intNoOfOtherSiblings = oParentOfNode1.childNodes.length;
		if(intNoOfOtherSiblings==0 || oNextOfNode1==null)
			oJSFW.fnAppendChild(oParentOfNode1, oNode2);
		else
			oJSFW.fnInsertBefore(oNode2, oNextOfNode1);

		if(intNoOfOtherSiblings==0 || oNextOfNode2==null)
		{
			if(oNextOfNode2==oNode1)
				oJSFW.fnInsertBefore(oNode1, oNode2);
			else
				oJSFW.fnAppendChild(oParentOfNode2, oNode1);
		}
		else
			oJSFW.fnInsertBefore(oNode1, oNextOfNode2);
	}
	
	/// <memberMethod name="fnGetElementsByTagName">
	///	<param name="strTagName"></param>
	///	<param name="oOptionalParent"></param>
	/// <summary>Returns element array of elements of given tagName.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementsByTagName(strTagName, oOptionalParent)
	{
		if(typeof (oOptionalParent)=='undefined')
			oOptionalParent = document;
		return oOptionalParent.getElementsByTagName(strTagName);
	}
	/// <memberMethod name="fnGetElementsByName">
	///	<param name="strElementName"></param>
	/// <summary>Returns element array of elements of given name.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementsByName(strElementName)
	{
		return document.getElementsByName(strElementName);
	}
	
	/// <memberMethod name="fnAppendChild">
	///	<param name="oParentNode"></param>
	///	<param name="oChildToBeAppended"></param>
	/// <summary>Appends a node under specified node.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnAppendChild(oParentNode, oChildToBeAppended)
	{
		var oElement;
		///-- Code added by meghna for state maintenance
		if(this.objBrowserInfo.IsIE)
		{
			var oStateMaintenance = new cIEStateMaintainer();
			oStateMaintenance.fnStoreState(oChildToBeAppended);
		}
		
		oElement = oParentNode.appendChild(oChildToBeAppended);
		
		if(this.objBrowserInfo.IsIE)
			oStateMaintenance.fnRestoreState();
		return oElement;
	}
	/// <memberMethod name="fnInsertBefore">
	///	<param name="oNodeToBeInserted"></param>
	///	<param name="oReferenceNode"></param>
	/// <summary>Insert a node before specified node</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnInsertBefore(oNodeToBeInserted, oReferenceNode)
	{
		//oReferenceNode.parentNode.insertBefore(oNodeToBeInserted, oReferenceNode);

		///--Code added by meghna for state maintenance
		if(this.objBrowserInfo.IsIE)
		{
			var oStateMaintenance = new cIEStateMaintainer();
			oStateMaintenance.fnStoreState(oNodeToBeInserted);
		}
		oReferenceNode.parentNode.insertBefore(oNodeToBeInserted, oReferenceNode);
		if(this.objBrowserInfo.IsIE)
			oStateMaintenance.fnRestoreState();
		


	}
	/// <memberMethod name="fnIsChild">
	///	<param name="oNode"></param>
	///	<param name="oParentNode"></param>
	/// <summary>Returns true if given node is child of specified node</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnIsChild(oNode, oParentNode)
	{
		var oInterParentNode;
		oInterParentNode = oNode.parentNode;
		while(oInterParentNode != null)
		{
			if(oInterParentNode == oParentNode)
				return true;
			oInterParentNode = oInterParentNode.parentNode;
		}
		return false;
	}
	/// <memberMethod name="fnSetDisplayStyle">
	///	<param name="oElement"></param>
	///	<param name="blnSetVisible"></param>
	/// <summary>Set stlye.display of given element for visible / invisible.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetDisplayStyle(oElement, blnSetVisible)
	{
		oElement.style.display = ((blnSetVisible)?'':'none');
	}

	/// <memberMethod name="fnCheckMaxLength">
	///	<param name="oElement"></param>
	///	<param name="oEventObject"></param>
	///	<param name="intLength"></param>
	/// <summary>Checks max length of specified element and returns true if length of value is less than specified, else it would cancleEvent and return false. It can be used with KeyPress, Paste events or without an event</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnCheckMaxLength(oElement, oEventObject, intLength)
	{
		var strNullExceptionMessage = "The oElement or oEventObject is null";
		var blnReturnValue=null;
		var strInsertingText, strNewInsertingText;
		var intControlTextLength, intSelectionLength, intClipBoardTextLength, intExcessChars;
		var oSelectionRange;
		if(oEventObject!=null)
		{
			switch(oEventObject.type.toLowerCase())
			{
				case 'keypress':
					strInsertingText = document.selection.createRange().text;
					blnReturnValue = ((oElement.value.length-strInsertingText.length)<intLength);
				break;
				case 'paste':
					oSelectionRange = window.document.selection.createRange();
					strInsertingText = window.clipboardData.getData('text');
					if(window.document.selection.type=='text')
						intSelectionLength = oSelectionRange.text.length;
					else
						intSelectionLength = 0;

					//alert(oElement.value);
					intControlTextLength = oElement.value.length;
					intClipBoardTextLength = strInsertingText.length;

					intExcessChars = ((intControlTextLength - intSelectionLength)+intClipBoardTextLength-intLength);
					//alert(intSelectionLength + ":" + intControlTextLength + ":" + intClipBoardTextLength + "\n" + intExcessChars);
					if(intExcessChars>0)
					{
						strNewInsertingText = strInsertingText.substr(0, strInsertingText.length - intExcessChars);
						window.clipboardData.setData('text', strNewInsertingText);
					}
					//alert(strNewInsertingText);
					blnReturnValue = true;
				break;
				case 'drop':
					blnReturnValue = false;
					/*strInsertingText = document.selection.createRange().text;
					intControlTextLength = oElement.value.length;
					alert("droping:" + strInsertingText);

					if(strInsertingText=='' || (strInsertingText.length + intControlTextLength) > intLength)
						blnReturnValue = false;
					else
						blnReturnValue = true;
					//else if(strInsertingText*/
				break;
				default:
					if(oElement!=null)
					{
						if(oElement.value.length>intLength)
							blnReturnValue = false;
						else
							blnReturnValue = true;
						break;
					}
					else
						throw new cACTLException(strNullExceptionMessage, "cJavaScriptFramework.fnCheckMaxLength");
			}
		}
		else
		{
			if(oElement!=null)
			{
				if(oElement.value.length>intLength)
					blnReturnValue = false;
				else
					blnReturnValue = true;
			}
			else
			{
				throw new cACTLException(strNullExceptionMessage, "cJavaScriptFramework.fnCheckMaxLength");
			}
		}
		if(!blnReturnValue)
		{
			this.fnCancelEvent(oEventObject);
		}
		return blnReturnValue;
	}
	
	/// <memberMethod name="fnIsSrcStrCharacterFromCharSet">
	///	<param name="oArrChars">Array of characters</param>
	///	<param name="strSourceString">Source string to be examined.</param>
	///	<param name="blnCheckUnion">Bool; true to check ALLOW ONLY, and false for ALLOW NONE</param>
	/// <summary>Returns true if given string contains only (or none of the) specified characters, else false.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnIsSrcStrCharacterFromCharSet(oArrChars, strSourceString, blnCheckUnion)
	{
		var blnIsInCharSet;
		var blnReturnValue = true;
		for(var a=0;a<strSourceString.length;a++)
		{
			blnIsInCharSet = false;
			for(var b=0;b<oArrChars.length;b++)
			{
				if(String(strSourceString.charAt(a)) == String(oArrChars[b]))
				{
					blnIsInCharSet = true;
					break;
				}
			}
			if(blnIsInCharSet!=blnCheckUnion)
				blnReturnValue = false;
		}
		return blnReturnValue;
	}

	/// <memberMethod name="fnAllowOnly">
	///	<param name="oElement">Source Element</param>
	///	<param name="oEventObject">Event object in case its used with an event</param>
	///	<param name="oArrChars">Array of characters to be allowed or disallowed</param>
	///	<param name="blnDisallowCharacters">Bool; true to check ALLOW NONE, and false for ALLOW ONLY</param>
	/// <summary>Returns true if given string contains only (or none of the) specified characters, else false. It can be used with KeyPress, and Paste events, or without event.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnAllowOnly(oElement, oEventObject, oArrChars, blnDisallowCharacters)
	{
		var blnReturnValue;
		var strNullExceptionMessage = "The oElement is null";
		var strInsertingText, strNewInsertingText;
		var intControlTextLength, intSelectionLength, intClipBoardTextLength, intExcessChars;
		var oSelectionRange, intWhich=1;
		
		///$$ - This function is Updated from JSFW VSS and modified. 

		if(oEventObject!=null)
		{
			switch(oEventObject.type.toLowerCase())
			{
				case 'keypress':
					if(!this.objBrowserInfo.IsIE)
					{
						intWhich = oEventObject.which;
						///-- For backspace keycode. Had to hard code for it.!
						if(intWhich==8)
							intWhich = 0;
					}
					if(intWhich!=0)
						blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, String.fromCharCode(this.fnGetKeyCode(oEventObject)), !blnDisallowCharacters);
					else
						blnReturnValue = true;
				break;
				case 'paste':
					strInsertingText = window.clipboardData.getData('text');
					blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, strInsertingText, !blnDisallowCharacters);
				break;
				case 'drop':
					blnReturnValue = false;
				/*	strInsertingText = window.document.selection.createRange().text;
					if(strInsertingText=='')
						blnReturnValue = false;
					else
						blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, strInsertingText, !blnDisallowCharacters); */
				break;
				default:
					if(oElement!=null)
						blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, oElement.value);
					else
						throw new cACTLException(strNullExceptionMessage, "cJavaScriptFramework.fnCheckMaxLength");
				break;
			}
		}
		else
		{
			if(oElement!=null)
				blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, oElement.value);
			else
				throw new cACTLException(strNullExceptionMessage, "cJavaScriptFramework.fnCheckMaxLength");
		}
		if(!blnReturnValue)
			this.fnCancelEvent(oEventObject);
		return blnReturnValue;
	}

	/// <memberMethod name="fnGetOffsetLeft">
	///	<param name="oEl">Element whose left is to be calculated</param>
	/// <summary>Returns left of the given element.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetOffsetLeft(oEl) 
	{
		var iLeft = oEl.offsetLeft;
		while ((oEl = oEl.offsetParent) != null)
			iLeft += oEl.offsetLeft;
		return iLeft;
	}

	/// <memberMethod name="fnGetOffsetTop">
	///	<param name="oEl">Element whose top is to be calculated.</param>
	/// <summary>Returns top of the given element.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetOffsetTop (oEl) 
	{
		var iTop = oEl.offsetTop;
		while((oEl = oEl.offsetParent) != null)
			iTop += oEl.offsetTop;
		return iTop;
	}
	
	/// <memberMethod name="fnMaxOfArray">
	///	<param name="oArrayOfValues">Array of elements</param>
	/// <summary>Returns element whose value is maximum in the array.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnMaxOfArray(oArrayOfValues)
	{
		var intIndex;
		var oLargest;
		if(oArrayOfValues.length<1)
		{
			oLargest = null;
		}
		else if(oArrayOfValues.length<2)
		{
			oLargest = oArrayOfValues[0];
		}
		else
		{
			oLargest = oArrayOfValues[0];
			for(intIndex=1;intIndex<oArrayOfValues.length;intIndex++)
			{
				if(oLargest<oArrayOfValues[intIndex])
					oLargest = oArrayOfValues[intIndex];
			}
		}
		return oLargest;
	}
	
	/// <memberMethod name="fnMinOfArray">
	///	<param name="oArrayOfValues">Array of elements</param>
	/// <summary>Returns element whose value is minimum in the array.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnMinOfArray(oArrayOfValues)
	{
		var intIndex;
		var oSmallest;
		if(oArrayOfValues.length<1)
		{
			oSmallest = null;
		}
		else if(oArrayOfValues.length<2)
		{
			oSmallest = oArrayOfValues[0];
		}
		else
		{
			oSmallest = oArrayOfValues[0];
			for(intIndex=1;intIndex<oArrayOfValues.length;intIndex++)
			{
				if(oSmallest>oArrayOfValues[intIndex])
					oSmallest = oArrayOfValues[intIndex];
			}
		}
		return oSmallest;
	}

	/// <memberMethod name="fnGetElementsFromHTMLString">
	///	<param name="strHTML"></param>
	/// <summary>Returns Elements from an HTML String</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetElementsFromHTMLString(strHTML)
	{
		var oTempDiv = this.fnCreateElement("DIV",document);
		oTempDiv.innerHTML = strHTML;
		return oTempDiv.childNodes;
	}
	
	/// <memberMethod name="fnHTMLEncode">
	///	<param name="strText"></param>
	/// <summary>Performs Encoding on a HTML string</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnHTMLEncode(strText)
	{
		return strText.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/"/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
	}
	
	/// <memberMethod name="fnHTMLDecode">
	///	<param name="strText"></param>
	/// <summary>Performs Decoding` on a HTML string</summary>
	/// </memberMethod>	
	
	function cJavaScriptFramework_fnHTMLDecode(strText)
	{
		return strText.replace(/&quot;'/g, "\"").replace(/&lt;/g, '<').replace(/&#39;/g, "'").replace(/&gt;/g, '>').replace(/&amp;/g, '&');
	}
	
	/// <memberMethod name="fnGlobalVariableExists">
	///	<param name="strVariableName"></param>
	/// <summary>Checks whether the global variable exists or not</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGlobalVariableExists(strVariableName)
	{
		try
		{
			eval(strVariableName);
		}
		catch(oExp)
		{
			return false;
		}
		return true;
	}
	
	/// <memberMethod name="fnGetUnusedGlobalVariableName">
	/// <summary>Returns a dynamically generated variable name that is unused</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetUnusedGlobalVariableName(strOptionalPrefix)
	{
		var intIncrementer = 0;
		var strPrefix = "jsfwDyncObj";
		
		strPrefix = ((typeof strOptionalPrefix=='undefined')?"":strOptionalPrefix) + strPrefix;
		
		var blnGot=false;
		
		do{
			try{
				eval(strPrefix + (++intIncrementer))
			}catch(oExp) {	blnGot = true;	}
		}while(!blnGot);
		return  strPrefix + (intIncrementer);
	}
	
	/// <memberMethod name="fnConfirm">
	///	<param name="strMessage"></param>
	/// <summary>Wrapper for Confirm</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnConfirm(strMessage)
	{
		return confirm(strMessage);
	}
	
	/// <memberMethod name="fnGetTypeName">
	///	<param name="strMessage"></param>
	/// <summary>Returns the function that creates an object. </summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetTypeName(oValue)
	{
		var strTemp;
		var oReturnValue;
		if(oValue==null)
			oReturnValue = null;
		else
		{
			if(!oValue.constructor)
				throw cACTLException("Non-interpretable type", "cJavaScriptFramework.fnGetTypeName");
			else
			{
				strTemp = String(oValue.constructor);
				strTemp = strTemp.substr(8 /*length 8 for "function "*/);
				strTemp = strTemp.substr(0, strTemp.indexOf("("));
				oReturnValue = strTemp.fnTrim();
			}
		}
		return oReturnValue;
	}
	
	/// <memberMethod name="fnEncodeWithCRLF">
	///	<param name="strValue"></param>
	/// <summary>Performs Encoding on a HTML string for Line Feed and Carriage Return</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnEncodeWithCRLF(strValue)
	{
		//this.fnHTMLEncode(strValue).replace(new RegExp(String.fromCharCode(13,10), "gi") ,"<BR>")
		return this.fnHTMLEncode(strValue).replace(new RegExp(String.fromCharCode(13,10), "gi") ,"<BR>").replace(new RegExp(String.fromCharCode(10), "gi") ,"<BR>").replace(new RegExp(String.fromCharCode(13), "gi") ,"<BR>")
	}
	
	/// <memberMethod name="fnDecodeWithCRLF">
	///	<param name="strValue"></param>
	/// <summary>Performs Decoding on a HTML string for Line Feed and Carriage Return</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnDecodeWithCRLF(strValue)
	{
		return this.fnHTMLDecode(strValue.replace(/<br>/gi, "\n"))
		//this.fnHTMLDecode(strValue.replace(/<br>/gi, "\n\r"))
	}
	
	// End of functions added by Kinjal Desai
	
	// Function prepared by Meghna
	
	///<memberMethod name="fnGetPopupBlockerTip">
	///<summary>
	/// This method is used for returning user hint for blocked popups
	///</summary>
	///</memberMethod>
	function cJavaScriptFramework_fnGetPopupBlockerTip()
	{
		///-- strAlert_Gecko : Stores the string for Blocked Popups in Mozilla
		var strAlert_Gecko ="Tools > Options > Content > Disable Block PopUp Windows";
		///-- strAlert_IE : Stores the string for Blocked Popups in Internet Explorer
		var strAlert_IE = "Tools > InternetOptions > Privacy > Disable PopBlocker";
		///-- strAlert_GoogleToolBarExists : Displayed if Google Toolbar is detected along with the path to unblock the popups
		var strAlert_GoogleToolBarExists = "Google Toolbar Detected ! Click on Blocked Popups button";
		///-- strAlert_GoogleToolBarExists : Displayed if Google Toolbar is not detected
		var strAlert_GoogleToolBarNotExists = "Google Toolbar not Detected";
		
		try
		{
			if((navigator.userAgent.indexOf("Windows NT 5.0") > -1) || (navigator.userAgent.indexOf("Windows 98") > -1))
			{
				try
				{
					if(navigator.product=="Gecko")
						return strAlert_Gecko;
					else if(navigator.appName=="Microsoft Internet Explorer")
					{
						///--Google Toolbar detection			
						if (typeof(detection)!= "undefined") 
						{ 
							if (typeof(detection.Search)!= "undefined") 
								return strAlert_GoogleToolBarExists;
							else 
								return strAlert_GoogleToolBarNotExists;
						} 
						///-- Pending: Yahoo Toolbar detection ( would be same as Google except the classid		)		
					}
				}
				catch(ex)
				{
					throw new cACTLException(ex.message, "cJavaScriptFramework.fnGetPopupBlockerTip");
				}						
			}
			else if(navigator.userAgent.indexOf("Windows NT 5.1") > -1)
			{
				try
				{
					if(navigator.product=="Gecko")
						return strAlert_Gecko;
					else if(navigator.userAgent.indexOf("msie")>-1)
						return strAlert_IE;
				}
				catch(ex)
				{
					throw new cACTLException(ex.message, "cJavaScriptFramework.fnGetPopupBlockerTip");
				}
			}
		}
		catch(ex)
		{
			throw new cACTLException(ex.message, "cJavaScriptFramework.fnGetPopupBlockerTip");
		}
	}


/// <memberMethod name="fnSerializeFormAsXML">
///	<param name="oForm"></param>
///	<param name="strCommaSeperatedElementNames"></param>
///	<param name="blnIncludeGivenElements"></param>
///	<param name="strRootTagName"></param>
/// <summary>function to serialize form in XML Format.</summary>
/// </memberMethod>
function cJavaScriptFramework_fnSerializeFormAsXML(oForm,strCommaSeperatedElementNames,blnIncludeGivenElements,strRootTagName)
{
	var oArrFormElements = new Array();
	var oArrTemp = new Array();
	var intCounter;
	var strFormAsXML='';
	var strArrElementNames = new Array();
	try
	{
		if(strCommaSeperatedElementNames!='' && strCommaSeperatedElementNames!=undefined && strCommaSeperatedElementNames!=null )
		{
			strArrElementNames = strCommaSeperatedElementNames.split(',');
			if(blnIncludeGivenElements==true)
			{
				var j = 0;
				for(intCounter=0;intCounter < strArrElementNames.length ; intCounter++)
				{
					var oArrElement = new Array();
					
					if(this.objBrowserInfo.IsIE)
					{
						oArrElement = oForm.elements(strArrElementNames[intCounter]);
						oArrFormElements[intCounter] = oArrElement;
					}
					else if(this.objBrowserInfo.IsGecko)
					{
						var oArr = oForm.elements;
						
						for(i=0;i<oArr.length;i++)
						{
							if(oArr[i].name == strArrElementNames[intCounter])
							{
								//oArrElement[i] = ;
								oArrFormElements[j++] = oArr[i];
							}
						}
					}
					
					
				}
			}
			else if(blnIncludeGivenElements==false)
			{
				oArrTemp = oForm.elements;
				var oArrSelected  = new Array();
				for(i=0;i<oArrTemp.length;i++)
				{
					oArrSelected[i] = oArrTemp[i];
				}
				var intArrCtr;
				for(intCounter=0;intCounter < strArrElementNames.length ; intCounter++)
				{
					for(i=0;i<oArrSelected.length;i++)
					{
						if(oArrSelected[i].name == strArrElementNames[intCounter])
						{
							for(j=i;j<oArrSelected.length ; j++)
							{
								oArrSelected[j] = oArrSelected[j+1];
							}
							oArrSelected.splice(j-1,1);
							i=oArrSelected.length;
							
							
						}
					}
					
				}
				oArrFormElements = oArrSelected;
			}
				
				
		}
		else
		{
			oArrFormElements = oForm.elements;
			
		}


		if(strRootTagName!='' && strRootTagName!=undefined && strRootTagName!=null )
		{
			strFormAsXML = '<' + strRootTagName + '>';
		}
		


		for(intCounter = 0 ; intCounter < oArrFormElements.length ; intCounter++)
		{
			var oArr = new Array();
			switch(oArrFormElements[intCounter].type.toUpperCase())
			{
				case "RADIO"    :	
				case "CHECKBOX" :	if(this.objBrowserInfo.IsIE)
										var oArr = oForm.elements(oArrFormElements[intCounter].name);
									else if(this.objBrowserInfo.IsGecko)
									{
										var intElementCtr = 0;
										var startpos = 0;
										//var j = 0;
										for(i=0;i<oArrFormElements.length;i++)
										{
											if(oArrFormElements[intCounter].name == oArrFormElements[i].name)
											{
												if(intElementCtr==0)
													startpos = i;						
												intElementCtr++;		
											}
											
										}
										var j = 0;
										if(intElementCtr>0)
										{
										//	intCounter = intCounter + intElementCtr;
											for(i=startpos;i<startpos+intElementCtr;i++)
											{
												oArr[j++] = oArrFormElements[i]
											}
										}
									}
									if(oArr.length>1)
									{
										intCounter = intCounter + oArr.length -1;
										var blnChecked = false;
										var ctr = 0;
										var strElementValues='';
										for(i=0;i<oArr.length;i++)
										{
											if(oArr[i].checked)
											{
												blnChecked=true;
												if(ctr==0)
												{
													strElementValues+= oArr[i].value;
													ctr++;
												}
												else
													strElementValues += "," + oArr[i].value;
											}
											
										}
									//	alert(strElementValues);
										if(blnChecked==true)
										{
											if(ctr!=1)
												strElementValues = strElementValues.subString(0,strElementValues.length-1);
											strFormAsXML  = strFormAsXML + '<' + oArrFormElements[intCounter].name + '>';
											strFormAsXML  = strFormAsXML + '<![CDATA[' + strElementValues + ']]>' ;
											strFormAsXML  = strFormAsXML + '</' + oArrFormElements[intCounter].name + '>';	
										}
									}
									else
									{
										if(oArrFormElements[intCounter].checked)
										{
											strFormAsXML  = strFormAsXML + '<' + oArrFormElements[intCounter].name + '>';
											strFormAsXML  = strFormAsXML + '<![CDATA[' + oArrFormElements[intCounter].value + ']]>' ;
											strFormAsXML  = strFormAsXML + '</' + oArrFormElements[intCounter].name + '>';
										}
									}
									break;
				default			:	strFormAsXML  = strFormAsXML + '<' + oArrFormElements[intCounter].name + '>';
									strFormAsXML  = strFormAsXML + '<![CDATA[' + oArrFormElements[intCounter].value + ']]>' ;
									strFormAsXML  = strFormAsXML + '</' + oArrFormElements[intCounter].name + '>';
									break;
			}
			
		}

		
		if(strRootTagName!='' && strRootTagName!='undefined' && strRootTagName!=null)
		{
			strFormAsXML = strFormAsXML +  '</' + strRootTagName + '>';
		}

		//alert(strFormAsXML);
		return strFormAsXML ;
	}
	catch(ex)
	{
		throw new cACTLException(ex.message,"cJavaScriptFramework.fnSerializeFormAsXML");
	}

}

/// <memberMethod name="fnSerializeFormForQuerystring">
///	<param name="oForm"></param>
///	<param name="strCommaSeperatedElementNames"></param>
///	<param name="blnIncludeGivenElements"></param>
/// <summary>Function to Serialize Form in QueryString format</summary>
/// </memberMethod>	
function cJavaScriptFramework_fnSerializeFormForQuerystring(oForm,strCommaSeperatedElementNames,blnIncludeGivenElements)
{
	var oArrFormElements = new Array();
	var oArrTemp = new Array();
	var intCounter;
	var strFormAsQS='';
	var strArrElementNames = new Array();
	try
	{
		if(strCommaSeperatedElementNames!='' && strCommaSeperatedElementNames!=undefined && strCommaSeperatedElementNames!=null )
		{
			strArrElementNames = strCommaSeperatedElementNames.split(',');
			if(blnIncludeGivenElements==true)
			{
				var j = 0;
				for(intCounter=0;intCounter < strArrElementNames.length ; intCounter++)
				{
					var oArrElement = new Array();
					
					if(this.objBrowserInfo.IsIE)
					{
						oArrElement = oForm.elements(strArrElementNames[intCounter]);
						oArrFormElements[intCounter] = oArrElement;
					}
					else if(this.objBrowserInfo.IsGecko)
					{
						var oArr = oForm.elements;
						
						for(i=0;i<oArr.length;i++)
						{
							if(oArr[i].name == strArrElementNames[intCounter])
							{
								//oArrElement[i] = ;
								oArrFormElements[j++] = oArr[i];
							}
						}
					}
					
					
				}
			}
			else if(blnIncludeGivenElements==false)
			{
				oArrTemp = oForm.elements;
				var oArrSelected  = new Array();
				for(i=0;i<oArrTemp.length;i++)
				{
					oArrSelected[i] = oArrTemp[i];
				}
				var intArrCtr;
				for(intCounter=0;intCounter < strArrElementNames.length ; intCounter++)
				{
					for(i=0;i<oArrSelected.length;i++)
					{
						if(oArrSelected[i].name == strArrElementNames[intCounter])
						{
							for(j=i;j<oArrSelected.length ; j++)
							{
								oArrSelected[j] = oArrSelected[j+1];
							}
							oArrSelected.splice(j-1,1);
							i=oArrSelected.length;
							
							
						}
					}
					
				}
				oArrFormElements = oArrSelected;
			}
				
				
		}
		else
		{
			oArrFormElements = oForm.elements;
			
		}

		for(intCounter = 0 ; intCounter < oArrFormElements.length ; intCounter++)
		{
			var oArr = new Array();
			switch(oArrFormElements[intCounter].type.toUpperCase())
			{
				case "RADIO"    :	
				case "CHECKBOX" :	if(this.objBrowserInfo.IsIE)
										var oArr = oForm.elements(oArrFormElements[intCounter].name);
									else if(this.objBrowserInfo.IsGecko)
									{
										var intElementCtr = 0;
										var startpos = 0;
										//var j = 0;
										for(i=0;i<oArrFormElements.length;i++)
										{
											if(oArrFormElements[intCounter].name == oArrFormElements[i].name)
											{
												if(intElementCtr==0)
													startpos = i;						
												intElementCtr++;		
											}
											
										}
										var j = 0;
										if(intElementCtr>0)
										{
										//	intCounter = intCounter + intElementCtr;
											for(i=startpos;i<startpos+intElementCtr;i++)
											{
												oArr[j++] = oArrFormElements[i]
											}
										}
									}
									if(oArr.length>1)
									{
										intCounter = intCounter + oArr.length -1;
										var blnChecked = false;
										var ctr = 0;
										var strElementValues='';
										for(i=0;i<oArr.length;i++)
										{
											if(oArr[i].checked)
											{
												blnChecked=true;
												if(ctr==0)
												{
													strElementValues+= oArr[i].value;
													ctr++;
												}
												else
													strElementValues += "," + oArr[i].value;
											}
											
										}
									//	alert(strElementValues);
										if(blnChecked==true)
										{
											if(ctr!=1)
												strElementValues = strElementValues.subString(0,strElementValues.length-1);
												
											strFormAsQS  = strFormAsQS +  oArrFormElements[intCounter].name + '=' + strElementValues;
											if(intCounter!=oArrFormElements.length-1)
												strFormAsQS  = strFormAsQS + '&';
											
										}
									}
									else
									{
										if(oArrFormElements[intCounter].checked)
										{
											strFormAsQS  = strFormAsQS +  oArrFormElements[intCounter].name + '=' + oArrFormElements[intCounter].value;
											if(intCounter!=oArrFormElements.length-1)
												strFormAsQS  = strFormAsQS + '&';
										}
									}
									break;
				default			:	strFormAsQS  = strFormAsQS +  oArrFormElements[intCounter].name + '=' + oArrFormElements[intCounter].value;
									if(intCounter!=oArrFormElements.length-1)
										strFormAsQS  = strFormAsQS + '&';
									break;
			}
			
		}

		return strFormAsQS ;
	}
	catch(ex)
	{
		throw new cACTLException(ex.message,"cJavaScriptFramework.fnSerializeFormForQuerystring");
	}

}	

/// <memberMethod name="fnSerializeParamObjectAsXML">
///	<param name="oParamObject"></param>
///	<param name="oArrSelectedColumn"></param>
///	<param name="blnIncludeColName"></param>
/// <summary>function to Serialize Parameter Object in XMl Format.</summary>
/// </memberMethod>	
function cJavaScriptFramework_fnSerializeParamObjectAsXML(oParamObject,oArrSelectedColumn,blnIncludeColName)
{
	var intKeyCounter = 0;
	var intKeyValueCounter = 0;
	var intSelColumnCounter = 0;
	var strParamObjectAsXML = '';
	var intKeyLength = oParamObject.fnGetLength();
	var oArrKey = new Array();
	var oArrKeyValues = new Array();
	try
	{
		oArrKey = oParamObject.fnGetAllKeys();
		for(intKeyCounter = 0 ; intKeyCounter < intKeyLength  ; intKeyCounter++)
		{
			strParamObjectAsXML = strParamObjectAsXML +'<' + oArrKey[intKeyCounter] + '>';
			oArrKeyValues = oParamObject.fnGetValuesOfKey(oArrKey[intKeyCounter]);
			for(intKeyValueCounter = 0; intKeyValueCounter < oArrKeyValues.length; intKeyValueCounter++)
			{
				if(blnIncludeColName==true)
				{
					if(oArrSelectedColumn=='')
					{
						strParamObjectAsXML = strParamObjectAsXML +'<' + oParamObject.oArrColumns[intKeyValueCounter] + '>';
						strParamObjectAsXML = strParamObjectAsXML + '<![CDATA[' + oArrKeyValues[intKeyValueCounter]+ ']]>'
						strParamObjectAsXML = strParamObjectAsXML +'</' + oParamObject.oArrColumns[intKeyValueCounter] + '>';
					}
					else
					{
						for(intSelColumnCounter = 0 ; intSelColumnCounter < oArrSelectedColumn.length ; intSelColumnCounter++)
						{
							if(oParamObject.oArrColumns[intKeyValueCounter] == oArrSelectedColumn[intSelColumnCounter])
							{
								strParamObjectAsXML = strParamObjectAsXML +'<' + oParamObject.oArrColumns[intKeyValueCounter] + '>';
								strParamObjectAsXML = strParamObjectAsXML + '<![CDATA[' + oArrKeyValues[intKeyValueCounter]+ ']]>'
								strParamObjectAsXML = strParamObjectAsXML +'</' + oParamObject.oArrColumns[intKeyValueCounter] + '>';
							}
						}
					}
				}
				else if(blnIncludeColName==false)
				{
					if(oArrSelectedColumn=='')
					{
						strParamObjectAsXML = strParamObjectAsXML + '<![CDATA[' + oArrKeyValues[intKeyValueCounter]+ ']]>';
					}
					else
					{
						for(intSelColumnCounter = 0 ; intSelColumnCounter < oArrSelectedColumn.length ; intSelColumnCounter++)
						{
							if(oParamObject.oArrColumns[intKeyValueCounter] == oArrSelectedColumn[intSelColumnCounter])
							{
								strParamObjectAsXML = strParamObjectAsXML + '<![CDATA[' + oArrKeyValues[intKeyValueCounter]+ ']]>'
							}
						}
					}
				}
			}
			strParamObjectAsXML = strParamObjectAsXML +'</' + oArrKey[intKeyCounter] + '>';
			
		}
		return strParamObjectAsXML;
	}
	catch(ex)
	{
		throw new cACTLException(ex.message,"cJavaScriptFramework.fnSerializeParamObjectAsXML");
	}
}	
	
	// End of function by Meghna
	

///$$ FUNCTIONS TO BE REVIEWED STARTS HERE

//Start of function by Mrunal

/// <memberMethod name="fnAttachEvent">
/// <summary>
/// This function used to attach the events with specific element or all the elements.
/// </summary>
///	<param name="strEvent">Event Name do not include 'on' before the event name.</param>
///	<param name="fnFunctionPointer">Function name which is called when particular event get fire.</param>
///	<param name="bCapture">It specifies whether to capture the event or not ,specially for Mozilla</param>
///	<param name="oElement">Required when event is bind to particular element.</param>
/// </memberMethod>	
function cJavaScriptFramework_fnAttachEvent(strEvent,fnFunctionPointer,bCapture,oElement)
{
	var intcounter =0 ;
	if(this.objBrowserInfo.IsMozila)
	{
		if((typeof(bCapture) == 'undefined') || (bCapture == null))
			bCapture = false;
		
		if(typeof(oElement) != 'undefined')
			oElement.addEventListener(strEvent,fnFunctionPointer,bCapture);
		else
			addEventListener(strEvent,fnFunctionPointer,bCapture);
	}	
	else if(this.objBrowserInfo.IsIE)	
	{
		if(typeof(oElement) != 'undefined')
			oElement.attachEvent("on" + strEvent,fnFunctionPointer);
		else
		{
			oElement = this.fnGetElementsByTagName('*');
			for(intcounter =0 ;intcounter<oElement.length ; intcounter++)
				oElement[intcounter].attachEvent("on" + strEvent,fnFunctionPointer);
		}
	}
}


/// <memberMethod name="fnDetachEvent">
/// <summary>
/// This function used to attach the events with specific element or all the elements.
/// </summary>
///	<param name="strEvent">Event Name do not include 'on' before the event name.</param>
///	<param name="fnFunctionPointer">Function name which is called when particular event get fire.</param>
///	<param name="bCapture">It specifies whether to capture the event or not ,specially for Mozilla</param>
///	<param name="oElement">Required when event is bind to particular element</param>
/// </memberMethod>	

function cJavaScriptFramework_fnDetachEvent(strEvent,fnFunctionPointer,bCapture,oElement)
{
	var intcounter =0 ;
	if(this.objBrowserInfo.IsMozila)
	{
		if((typeof(bCapture) == 'undefined') || (bCapture == null))
			bCapture = false;
		
		if(typeof(oElement) != 'undefined')
			oElement.removeEventListener(strEvent,fnFunctionPointer,bCapture);
		else
			removeEventListener(strEvent,fnFunctionPointer,bCapture);
	}	
	else if(this.objBrowserInfo.IsIE)	
	{
		if(typeof(oElement) != 'undefined')
			oElement.detachEvent("on" + strEvent,fnFunctionPointer);
		else
		{
			oElement = this.fnGetElementsByTagName('*');
			for(intcounter =0 ;intcounter<oElement.length ; intcounter++)
				oElement[intcounter].detachEvent("on" + strEvent,fnFunctionPointer);
		}
	}
}


/// <memberMethod name="fnCanHaveChildren">
/// <summary>
/// This function check whether given element can have child elements.
/// </summary>
///	<param name="oElement">Element Object which is to be checked.</param>
/// </memberMethod>
function cJavaScriptFramework_fnCanHaveChildren(oElement)
	{
		if(this.objBrowserInfo.IsIE)
			return oElement.canHaveChildren;
		else if(this.objBrowserInfo.IsMozila)
		{
			switch(oElement.tagName.toLowerCase())
			{
				case "AREA":
				case "BASE":
				case "BASEFONT":
				case "COL":
				case "FRAME": 
				case "HR":
				case "IMG":
				case "BR":
				case "INPUT":
				case "ISINDEX":
				case "LINK":
				case "META":
				case "PARAM":
				return false; 
			}
			return true;
		}	
	}
	
	/// <memberMethod name="fnGetActiveElement">
	/// <summary>
	/// This function behaves like Microsoft's activeElement.
	/// </summary>
	///	<param name="oEvent">Event Object</param>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetActiveElement(oEvent)
	{
		///$$ needs to be optimize.
		if(oEvent)
		{
			if(oJSFW.objBrowserInfo.IsMozila)
				return oJSFW.fnGetSrcElement(oEvent);
			else
			{
				if(oEvent.type == "mouseover")
					return oJSFW.fnGetSrcElement(oEvent);
				else
					///-- Returns only element which has focus.
					return document.activeElement;
			}
		}
		else
		{
			if(oEvent)
			{
				if(oEvent.type == "mouseover")
					return oJSFW.fnGetSrcElement(oEvent);
				else
					return document.activeElement;
			}
			else
			{
				return document.activeElement;
			}
		}
	}

//End of function by Mrunal


//Start of function by Meghna

/// <memberMethod name="fnSwap">
/// <summary>
/// This function is used to swap any two elements
/// </summary>
///	<param name="oElement1">Element Object which is to be swapped.</param>
///	<param name="oElement2">Element Object which is to be swapped.</param>
/// </memberMethod>
function cJavaScriptFramework_fnSwap(oElement1,oElement2)
{
	var oCloneElement1,oCloneElement2;
	var oParentNode1,oParentNode2;
	var nIndexElement1,nIndexElement2;
	var blnLastIndexElement1 = false;
	var blnLastIndexElement2 = false;
	var nCounter;
	try
	{
		//Storing the parent element of the function
		oParentNode1 = oElement1.parentNode;
		oParentNode2 = oElement2.parentNode;
		
		for(nCounter=0;nCounter<oParentNode1.childNodes.length;nCounter++)
		{
			if(oParentNode1.childNodes[nCounter].nodeType!=3)
			{
				if(oElement1==oParentNode1.childNodes[nCounter])
				{
					nIndexElement1 = nCounter;
					if(nIndexElement1 == oParentNode1.childNodes.length -1)
					{
						blnLastIndexElement1 = true;
					}
				}
			}
		}
		
		for(nCounter=0;nCounter<oParentNode2.childNodes.length;nCounter++)
		{
			if(oParentNode2.childNodes[nCounter].nodeType!=3)
			{
				if(oElement2 == oParentNode2.childNodes[nCounter])
				{
					nIndexElement2 = nCounter;
					if(nIndexElement2 == oParentNode2.childNodes.length -1)
					{
						blnLastIndexElement2 = true;
					}
				}
			}
		}
		
		
		//Clone node1 with current state
		if(oJSFW.objBrowserInfo.IsIE)
		{
			var oStateMaintenance = new cIEStateMaintainer();
			oCloneElement1 = oElement1.cloneNode(true);
			oStateMaintenance.fnCopyState(oElement1,oCloneElement1);
			oCloneElement2 = oElement2.cloneNode(true);
			oStateMaintenance.fnCopyState(oElement2,oCloneElement2);
		}
		else
		{
			oCloneElement1 = oElement1.cloneNode(true);
			oCloneElement2 = oElement2.cloneNode(true);
		//	alert(oCloneElement1.innerHTML);
		}
		
	
		
		//Remove element after cloning
		this.fnRemoveChild(oElement1);
		
		
			
		//Remove element after cloning
		this.fnRemoveChild(oElement2);
	
		//alert(document.getElementById('tbl1').innerHTML);
		if(nIndexElement1 > nIndexElement2)
		{
			if(blnLastIndexElement2==true || !this.fnHasChildren(oParentNode2))
				this.fnAppendChild(oParentNode2,oCloneElement1);
			else
			{
				this.fnInsertBefore(oCloneElement1,oParentNode2.childNodes[nIndexElement2]);
			}
			if(blnLastIndexElement1==true || !this.fnHasChildren(oParentNode1))
				this.fnAppendChild(oParentNode1,oCloneElement2);	
			else
			{
				this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
			}
			
		}	
		else
		{
			if(blnLastIndexElement1==true || !this.fnHasChildren(oParentNode1))
				this.fnAppendChild(oParentNode1,oCloneElement2);	
			else
				this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
				
			if(blnLastIndexElement2==true || !this.fnHasChildren(oParentNode2))
				this.fnAppendChild(oParentNode2,oCloneElement1);
			else
				this.fnInsertBefore(oCloneElement1,oParentNode2.childNodes[nIndexElement2]);
							
			
			
		}
		
	}
	catch(ex)
	{
		throw new cACTLException(ex.message,"cJavaScriptFramework.fnSwap");
	}
}

/// <memberMethod name="fnHasChildren">
/// <summary>
/// This function is used to find whether the node has any children
/// </summary>
///	<param name="oParentNode">Element Object which has to be checked</param>
/// </memberMethod>
function cJavaScriptFramework_fnHasChildren(oParentNode)
{
	var nCounter;
	var blnflag = false;
	if(oJSFW.objBrowserInfo.IsIE)
	{
		if(oParentNode.childNodes.length>0)
			return true;
		else
			return false;
	}
	else
	{
		if(oParentNode.childNodes.length>0)
		{
			for(nCounter=0;nCounter<oParentNode.childNodes.length;nCounter++)
			{
				if(oParentNode.childNodes[nCounter].nodeType!=3)
				{
					blnflag = true;
				}
			}
		}
		
		
		return blnflag;
	}
	
}

//End of function by Meghna

///$$ FUNCTIONS TO BE REVIEWED ENDS HERE

	
	
	
	
}

/// <class name="cACTLException">
///	<summary>ACTL Exception class for user defined exception in JS.</summary>
/// </class>
function cACTLException(strDescription, strOptionalClassAndMethodName)
{
	this.strCodeLocation = strOptionalClassAndMethodName, 
	this.message = strDescription;
	this.description = strDescription;
	alert('Error at Location :' + this.strCodeLocation + '\n Error: ' + this.message + '.' );
}

///State Maintainence code added

/// <class name="cIEStateMaintainer">
///	<summary>Class used for State Maintenance in IE.</summary>
/// </class>
function cIEStateMaintainer()
{
	var oArrProblematicElementType = ["input-radio","input-checkbox"];
	var oArrProblematicElementAttr = ["checked","checked"];
	var strElementTypeAttr = "type";
	
	var oArrProblematicElement = Array();
	var oArrProblematicElementValue =  Array();
	
	this.fnOnConstruct = cIEStateMaintainer_fnOnConstruct;
	this.fnStoreState = cIEStateMaintainer_fnStoreState;
	this.fnRestoreState = cIEStateMaintainer_fnRestoreState;
	this.fnClear = cIEStateMaintainer_fnClear;
	this.fnCopyState = cIEStateMaintainer_fnCopyState;
	this.fnGetProblematicAttributes = cIEStateMaintainer_fnGetProblematicAttributes;

	this.fnOnConstruct();
	
	
	/*Coded by Mrunal Brahmbhatt*/

	function cIEStateMaintainer_fnOnConstruct()
	{
		
	}
	
	function cIEStateMaintainer_fnStoreState(oParentElement)
	{
		var oArrAllElements ;
		var intCounter;
		var intInnerCounter;
		var intRealCounter=0;
		var strTag;
		var strType;
		if(oParentElement)
		{
			oArrAllElements = oParentElement.getElementsByTagName('*');
			
			for(intCounter = 0 ;intCounter < oArrProblematicElementType.length; intCounter++)
			{
				strTag = oArrProblematicElementType[intCounter].slice(0,oArrProblematicElementType[intCounter].indexOf('-'));
				strType = oArrProblematicElementType[intCounter].slice(oArrProblematicElementType[intCounter].lastIndexOf('-') + 1 ,oArrProblematicElementType[intCounter].length);
				
				if(oArrAllElements.length != 0)
				{
					for(intInnerCounter = 0 ;intInnerCounter < oArrAllElements.length ; intInnerCounter++)
					{
						if(strTag == oArrAllElements[intInnerCounter].tagName.toLowerCase())
						{
							if(strType == oJSFW.fnGetAttribute(oArrAllElements[intInnerCounter],strElementTypeAttr).toLowerCase())
							{
								oArrProblematicElement[intRealCounter] = oArrAllElements[intInnerCounter];
								oArrProblematicElementValue[intRealCounter] = String(oJSFW.fnGetAttribute(oArrAllElements[intInnerCounter],oArrProblematicElementAttr[intCounter])).toLowerCase();
								intRealCounter++;
							}
						}
					}
				}
				else
				{
					if(strTag == oParentElement.tagName.toLowerCase())
					{
						if(strType == oJSFW.fnGetAttribute(oParentElement,strElementTypeAttr).toLowerCase())
						{
							oArrProblematicElement[intRealCounter] = oParentElement;
							oArrProblematicElementValue[intRealCounter] = String(oJSFW.fnGetAttribute(oParentElement,oArrProblematicElementAttr[intCounter])).toLowerCase();
							intRealCounter++;
						}
					}
				}
			}
		}
	}
	function cIEStateMaintainer_fnRestoreState()
	{
		var intCounter;
		for(intCounter =0 ; intCounter < oArrProblematicElement.length ; intCounter++)
		{
		  oJSFW.fnSetAttribute(oArrProblematicElement[intCounter],'checked',eval(oArrProblematicElementValue[intCounter]));
		  //oArrProblematicElement[intCounter] = oArrProblematicElementValue[intCounter];
		}
	}
	function cIEStateMaintainer_fnClear()
	{
		var intCounter;
		var intLength = oArrProblematicElement.length;
		for(intCounter =0 ; intCounter < intLength ; intCounter++)
		{
			delete oArrProblematicElement[intCounter];
			delete oArrProblematicElementValue[intCounter];
		}
	}
	/*End of Coded by Mrunal Brahmbhatt*/
	
	/*functions added by Kinjal Desai*/
	function cIEStateMaintainer_fnCopyState(oSrcNode, oDestNode)
	{
			
			strProbProperties = this.fnGetProblematicAttributes(oSrcNode);
			if(strProbProperties!="")
			{
				oArrayOfPorblematicProperties = strProbProperties.split(",");
				for(var a=0;a<oArrayOfPorblematicProperties.length;a++)
				{
					oJSFW.fnSetAttribute(oDestNode, oArrayOfPorblematicProperties[a], eval("oSrcNode." + oArrayOfPorblematicProperties[a]));
				}
			}
			for(a=0;a<oSrcNode.childNodes.length;a++)
			{
				///--Condition added by meghna
				if(oSrcNode.childNodes[a].nodeType!=3)
					this.fnCopyState(oSrcNode.childNodes[a], oDestNode.childNodes[a]);
			}
		
	}
	function cIEStateMaintainer_fnGetProblematicAttributes(oSrcNode)
	{
		var strTag, strType, strTagNType, strAttribute;
		var strTempAttribute;
		var strProbAttribute;
		strTempAttribute = oSrcNode.getAttribute("type");

		for(var a=0; a<oArrProblematicElementType.length;a++)
		{
			strTagNType = oArrProblematicElementType[a];
			strProbAttribute = oArrProblematicElementAttr[a];

			strTag = strTagNType.substr(0,strTagNType.indexOf("-"));
			strType = strTagNType.substr(strTagNType.indexOf("-")+1);
			
			if((strTag.toLowerCase()==oSrcNode.tagName.toLowerCase()) &&
			   ((strTag.toLowerCase()=='input')?(strType.toLowerCase()==strTempAttribute.toLowerCase()):true))
				return strProbAttribute;
			  
		}
		return "";
	}
	/*END OF functions added by Kinjal Desai*/
}




var oJSFW = new cJavaScriptFramework();
