// ///////////////////////////////////////////////////////////////////////
//  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.
//							  Adding functions in JSFW
// ///////////////////////////////////////////////////////////////////////

// ///START////// Additional functions for Array
// Add item to array
Array.prototype.fnAddItem=function(item)
{
	try
	{
		var i=this.length;
		this[i]=item;
		return i;
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "Array.fnAddItem", oException);
	}
};

//Remove item from Array
Array.prototype.fnRemoveItem=function(item)
{
	var blnItemExistFlag=false;
	try
	{
		if(item=="" || item==null)
		{
			oJSFW.fnThrowACTLError("Item does not exists");
		}	
		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)
		{
			oJSFW.fnThrowACTLError("Item doesnot exists");
		}
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "Array.fnRemoveItem", oException);
	}
//	this.splice(nStartPosition,nDeleteCount);
};




// Get index of array element
Array.prototype.fnIndexOf=function(value)
{
	try
	{
		for (var i=0;i<this.length;i++)
		{
			if (this[i]==value) return i;
		};
		return-1;
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "Array.fnIndexOf", oException);
	}
};
// ///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)
{
	try
	{
		return (this.substr(0,value.length)==value);
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnStartsWith", oException);
	}
};
//Returns true if string starts with specified value, false otherwise
String.prototype.fnEndsWith=function(value)
{
	try
	{
		var L1=this.length;
		var L2=value.length;
		if (L2>L1) return false;
		return (L2==0||this.substr(L1-L2,L2)==value);
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnEndsWith", oException);
	}
};
//Remove portion of stringS
String.prototype.fnRemove=function(start,length)
{
	try
	{
		var s="";
		if (start>0)
			s=this.substring(0,start);
		if (start+length<this.length)
			s+=this.substring(start+length,this.length);
		return s;
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnRemove", oException);
	}
};
//Trim string for white space
String.prototype.fnTrim=function()
{
	try
	{
		return this.replace(/(^\s*)|(\s*$)/g,"");
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnTrim", oException);
	}
};
//Trim string from left side
String.prototype.fnLTrim=function()
{
	try
	{
		return this.replace(/^\s*/g,"");
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnLTrim", oException);
	}
};
//Trim string from right side
String.prototype.fnRTrim=function()
{
	try
	{
		return this.replace(/\s*$/g,"");
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnRTrim", oException);
	}
};
//Replace new line character with given character
String.prototype.fnReplaceNewLineChars=function(replacement)
{
	try
	{
		return this.replace(/\n/g,replacement);
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnReplaceNewLineChars", oException);
	}
};
//Returns true if string is valid email address, false otherwise.
String.prototype.fnIsEmail=function()
{
//    var sArrTemp = this.split( "@" );
	//var strREStr = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
	//eg : ^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$
	//var strREStr ="^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$";
	//var strREStr = "[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$";
	//var strREStr = "/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,6}|\d+)$/i";
	//var strREStr = "^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,7}$";
        var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,6}|\d+)$/i;
        var returnval=emailfilter.test(this);
        if (returnval==false)
            return false;
        else
            return true; 
};

//Returns true if string is valid URL, false otherwise.
String.prototype.fnIsURL=function()
{
	//var oRegExp = new RegExp( "^.*[.][.]+.*$" , "gi"  );
	try
	{
		if(this.indexOf("..")!=-1) return;
		
		// Check for more than one consecutive periods (.).
		
		//var oRegExp = new RegExp( "(https?://)?([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?" , "gi"  );
		//var oRegExp = new RegExp("/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/" );
		//var oRegExp = new RegExp("/^(([w]+:)?//)?(([dw]|%[a-fA-fd]{2,2})+(:([dw]|%[a-fA-fd]{2,2})+)?@)?([dw][-dw]{0,253}[dw].)+[w]{2,4}(:[d]+)?(/([-+_~.dw]|%[a-fA-fd]{2,2})*)*(?(&?([-+_~.dw]|%[a-fA-fd]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;");
		var oRegExp = new RegExp("^(HTTP|HTTPS|FTP|http|https|ftp)+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");  
  
		//ASP.NET RExp:- http://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?
		
		//oRegExp = new RegExp( "https?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?" , "gi"  );
		return oRegExp.test(String(this)); 
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsURL", oException);
	}
};
//Returns true if string is valid Date, false otherwise.
/*String.prototype.fnIsDate = function(sSeparator)
{
	var sSeparator = String( sSeparator );
	try
	{
		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;
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsDate", oException);
	}

}*/


	///Start of function By Kavita Sharma

	


/// <method name="fnLeapYear">
///	<param name="intYear">The year to be checked.</param>
/// <summary>This functions checks whether the given year is Leap or not. </summary>
/// </method>
Number.prototype.fnLeapYear = function()
{     
	intYear = this;
	if (intYear % 100 == 0)
	{     
		if (intYear % 400 == 0)
		{
					return true; 
		}
	}
	else 
	{     
		if ((intYear % 4) == 0)
		{   
			return true; 
		}
	}
};



/// <memberMethod name="fnIsDate">
///	<param name="strDateFormat">The format of the date according to which the validations should be done.</param>
///	<param name="strDateSeperator">The seperators which should be counted legal while checking the date format.</param>
/// <summary>
///		This functions returns false if the date is not in proper format 
///		and if date is in correct format then it returns the correct dateString . 
/// </summary>
/// </memberMethod>

//Returns true if string is valid Date, false otherwise.

String.prototype.fnIsDate = function(strDateSeperator,strDateFormat)
{
	var strTxtToValidate = this;
	try
	{
		if( typeof strDateSeperator == "undefined" || strDateSeperator.fnTrim() =="")
		{
			strDateSeperator = "/";
		}

		if( typeof strDateFormat == "undefined" || strDateFormat.fnTrim() =="")
		{
			strDateFormat = enumDateFormat.mmddyyyy;
		}


		if (oJSFW.fnValidateDate (strTxtToValidate,strDateFormat,strDateSeperator) == false) 
		{     
			//oJSFW.fnAlert("That date is invalid.  Please try again.");
			return false;	
		}
		else
		{     
			return true;
		}
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsDate", oException);
	}
};


///Enum ,which will/can have all the possible combination of the date formats.
enumDateFormat = 
{	

/*
%B full month name
%b abbreviated month name
%d the day of the month ( 00 .. 31 )
%m month ( 01 .. 12 )
%y year without the century ( 00 .. 99 )
%Y year including the century ( ex. 1979 )
*/

	// '/' is a default seperator, if user has given seperator then that would be replaced with this.
	ddmmyy      :  '%d/%m/%y',    ///-- 02/01/06
	ddmmyyyy    :  '%d/%m/%Y',    ///-- 02/01/2006
	ddmmmyy     :  '%d/%b/%y',    ///-- 02/Jan/06
	ddmmmyyyy   :  '%d/%b/%Y',    ///-- 02/Jan/2006
	ddmmmmyy    :  '%d/%B/%y',    ///-- 02/January/06
	ddmmmmyyyy  :  '%d/%B/%Y',    ///-- 02/January/2006
	mmddyy      :  '%m/%d/%y',    ///-- 01/02/06
	mmddyyyy    :  '%m/%d/%Y',    ///-- 01/02/2006
	mmmddyy     :  '%b/%d/%y',    ///-- Jan/02/06
	mmmddyyyy   :  '%b/%d/%Y',    ///-- Jan/02/2006
	mmmmddyy    :  '%B/%d/%y',    ///-- January/02/06
	mmmmddyyyy  :  '%B/%d/%Y'     ///-- January/02/2006
};

///End of function By Kavita Sharma


//Compares given dates and returns -1, 0, and 1.
String.prototype.fnCompareDates=function (dtTarget, sSeparator)
{
	var sSeparator = String( sSeparator );

	try
	{
		if( sSeparator == "undefined" || sSeparator.fnTrim() =="")
		{
			sSeparator = "/";
		}

		var nReturn = null;
		if( this.fnIsDate(sSeparator) && dtTarget.fnIsDate(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;
			}

		}
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnCompareDates", oException);
	}

	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)
{
	try
	{
		return this.replace(new RegExp("^(" + strChar + ")*|(" + strChar + ")*$", "g"), "");
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnTrimAll", oException);
	}
};
// ///END////// Some more functions for String.


// Start of (following) function added in built-in objects. KINJAL DESAI

// Checks whether the current number lays between numValue1 and numValue2 (inclusive)
Number.prototype.fnIsInRange = function(numValue1, numValue2)
{
	try
	{
		return ((numValue1 <= this) && (this <= numValue2));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "Number.fnIsInRange", oException);
	}
};

// Returns whether the string is valid (true) integer value or not (false)
String.prototype.fnIsInteger = function()
{
	try
	{
		var oRegExp = new RegExp("^[-|+]?[\\d]+$", "gi");
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsInteger", oException);
	}
};

// Returns whether the string is valid (true) float value or not (false)
String.prototype.fnIsFloat = function()
{
	try
	{
		var oRegExp = new RegExp("^[-|+]?[\\d]+[\\.]?[\\d]+$", "gi");
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsFloat", oException);
	}
};

// Returns whether the string contains only alpha characters (true) or not (false). Exclusive of whitespace characters.
String.prototype.fnIsStrictAlpha = function()
{
	try
	{
		var oRegExp = new RegExp("^[a-zA-Z]*$", "gi");
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsStrictAlpha", oException);
	}
};

// Returns whether the string contains only alpha characters (true) or not (false). Inclusive of whitespace characters.
String.prototype.fnIsAlpha = function()
{
	try
	{
		var oRegExp = new RegExp("^[a-zA-Z\\s]*$", "gi");
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsAlpha", oException);
	}
};
// Returns whether the string contains only alphanumeric characters (true) or not (false). Inclusive of whitespace characters.
String.prototype.fnIsAlphaNumeric = function()
{
	try
	{
		var oRegExp = new RegExp("^[a-zA-Z0-9\\s]*$", "gi");
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsAlphaNumeric", oException);
	}
};
// Returns whether the string is empty or zero length (true) or not (false)
String.prototype.fnIsEmpty = function()
{
	try
	{
		if(this.fnTrim().length==0) 
			return true;
		else
			return false;
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsEmpty", oException);
	}
};
// Returns result of RegExp.test for given regular expression, and flags with current string.
String.prototype.fnIsFormatValid = function(strRegExp, strFlag_gi)
{
	try
	{
		var oRegExp = new RegExp(strRegExp, strFlag_gi);
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsFormatValid", oException);
	}
};
// This function is shorthand function simple format checking. It returns whether current string passes test of 
// passes regular expression string and flags. It interprets four characters:
// 0 as a digits
// 9 as a one or more digits
// a as a alpha character
// z as a one or more alpha character
String.prototype.fnIsInCustomFormat = function(strACTLRegExp, strFlag_gi)
{
	try
	{
		var oRegExp;
		strACTLRegExp = strACTLRegExp.replace(/0/gi,"[0-9]");
		strACTLRegExp = strACTLRegExp.replace(/9/gi,"[0-9]+");
		strACTLRegExp = strACTLRegExp.replace(/a/gi,"[a-z]");
		strACTLRegExp = strACTLRegExp.replace(/z/gi,"[a-z]+");
		oRegExp = new RegExp(strACTLRegExp, strFlag_gi);
		
		return oRegExp.test(String(this));
	}
	catch(oException)
	{
		oJSFW.fnThrowACTLException(oException.message, "String.fnIsInCustomFormat", oException);
	}
};
// This function will reverse the current string and return it without affecting the current one.
String.prototype.fnReverse = function()
{
	var strReverse="";
	var strFieldValue = this;
	try
	{
		for(nCtr=0;nCtr<strFieldValue.length;nCtr++)
		{
			strReverse += strFieldValue.charAt((strFieldValue.length)-(nCtr+1));
		}
		return strReverse;
	}
	catch(ex)
	{
		oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
	}
};
// End of function added in built-in objects KINJAL DESAI
function cEventAttributes()
{
    /*
    this.returnValue = null; this.cancelBubble = null; this.keyCode = null; this.propertyName = null; 
    this.bookmarks = null; this.recordset = null; this.dataFld = null; this.boundElements = null;
    this.repeat = null; this.srcUrn = null; */
    this.srcElement = null; 
    /*this.altKey = null;
    this.ctrlKey = null; this.shiftKey = null; this.fromElement  = null; this.toElement = null;
    this.button = null; */
    this.type = null;
    /*
    this.qualifier = null;  this.reason = null; */
    this.x = null;
    this.y = null;
    this.clientX = null;
    this.clientY = null;
    this.offsetX = null;
    this.offsetY = null;
    this.screenX = null;
    this.screenY = null;
    /*
    this.srcFilter = null; this.dataTransfer = null; this.contentOverflow = null; this.shiftLeft = null;
    this.altLeft = null; this.ctrlLeft = null; this.imeCompositionChange = null; this.imeNotifyCommand = null;
    this.imeNotifyData = null; this.imeRequest = null; this.imeRequestData = null; this.keyboardLayout = null;
    this.behaviorCookie = null; this.behaviorPart = null; this.nextPage = null; this.wheelDelta = null;
    */
}

/// <class name="cJavaScriptFramework">
///	<summary>This class provides commonly used JS functionalities 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()
{
	///-- Varibles.
	///-- oElementWhichHasFocus: Reference to element which has focus.
	var oElementWhichHasFocus = null;
	// ///////////////////////////////////////// 
	// Global variables for cJavaScriptFramework.
	// PROPERTIES for JavaScirptFramework class.

	///&& objBrowserInfo: Gives 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;
	///&& strAmpersAndReplacement : Used to set the replacement of ampersand(&) in QueryString
	this.strAmpersAndReplacement = "^AMPERSAND^";
	///&& oMessagePaneToBeUsed : Used in fnAlert . Set to the instance of cMessagePane object to be displayed.
	this.oMessagePaneToBeUsed = null;
	///&& strMessagePaneLeafShortDesc : Set to the Leaf Short Description where the alert message is to be added
	this.strMessagePaneLeafShortDesc = "";
	///&& oEvent : oEvent Object for storing event attributes when ajax request is made.
	this.oEvent = null;
	
	///--Added By Mrunal Brahmbhatt on  07-02-2007
	//&& strFnAdditionalExceptionHandling : This method will execute when any unknow error occurs .
	this.strFnAdditionalExceptionHandling = "fnAdditionalExceptionHandling";
	//&& strServerExceptionHandlingUrl : Contains Url to which error information will be sent .
	this.strServerExceptionHandlingUrl = "";
	
	//babita added by babita date:26/6/2009
	this.sLastElementOfPage= "spanpageend";
	// //////////////////////////////////
	// METHODS cJavaScriptFramework class.

	//Constructor for cJavaScriptFramework.
	this.fnOnConstruct = cJavaScriptFramework_fnOnConstruct;
	// Debug.--> alert
	this.fnDebug = 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;
	
	//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;
	
	//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;
	//Returns array of elements from an HTML String
	this.fnGetElementsFromHTMLString = cJavaScriptFramework_fnGetElementsFromHTMLString;
	//Performs Encoding on a HTML string
	this.fnHTMLEncode = cJavaScriptFramework_fnHTMLEncode;
	//Performs Decoding on a HTML string
	this.fnHTMLDecode = cJavaScriptFramework_fnHTMLDecode;
	//Checks whether the global variable exists or not
	this.fnGlobalVariableExists = cJavaScriptFramework_fnGlobalVariableExists;
	// This method is used for returning user hint for blocked popups
	this.fnGetPopupBlockerTip = cJavaScriptFramework_fnGetPopupBlockerTip;
	//Returns a dynamically generated variable name that is unused
	this.fnGetUnusedGlobalVariableName = cJavaScriptFramework_fnGetUnusedGlobalVariableName;
	//Wrapper for Confirm
	this.fnConfirm = cJavaScriptFramework_fnConfirm;
	//Returns the name of function that created the given object. In other words, Class Name of the object. If function fails to determine type of the object then it raises an cACTLException with message 'Non-interpretable type'.
	this.fnGetTypeName = cJavaScriptFramework_fnGetTypeName;
	//Returns the name of function from function code.
	this.fnGetTypeNameFromFunctionCode = cJavaScriptFramework_fnGetTypeNameFromFunctionCode;
	//Performs Encoding on a HTML string for Line Feed and Carriage Return
	this.fnEncodeWithCRLF = cJavaScriptFramework_fnEncodeWithCRLF;
	//Performs Decoding on a HTML string for Line Feed and Carriage Return
	this.fnDecodeWithCRLF = cJavaScriptFramework_fnDecodeWithCRLF;
	//Creates and Throws cACTLException using passes parameters
	this.fnThrowACTLException = cJavaScriptFramework_fnThrowACTLException;
	//Creates and Throws cACTLException using passes parameters
	this.fnThrowACTLError = cJavaScriptFramework_fnThrowACTLError;
	//Creates returns clone of the given node. It uses cIEStateMaintainer for maintaining state of certain elements whose state do change in IE while cloning.
	this.fnCloneNode = cJavaScriptFramework_fnCloneNode;
	//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;
	//Added By Mrunal Brahmbhatt on 22-03-2007
	//Returns Height Width of content.
	this.fnGetHeightWidth = cJavaScriptFramework_fnGetHeightWidth;
	//Returns Scroll Top.
	this.fnGetScrollTop = cJavaScriptFramework_fnGetScrollTop;
	//Returns Scroll Left.
	this.fnGetScrollLeft = cJavaScriptFramework_fnGetScrollLeft;
	//Returns Client Height.
	this.fnGetClientHeight = cJavaScriptFramework_fnGetClientHeight;
	//Returns Client Width.
	this.fnGetClientWidth = cJavaScriptFramework_fnGetClientWidth;
	//Returns Parent Scroll.
	this.fnGetParentScroll = cJavaScriptFramework_fnGetParentScroll;
	//Returns Client Top.
	this.fnGetClientTop = cJavaScriptFramework_fnGetClientTop;
	//Returns Client Left.
	this.fnGetClientLeft = cJavaScriptFramework_fnGetClientLeft;
    
    // Added By Hitesh
	this.fnGetScrollHeight = cJavaScriptFramework_fnGetScrollHeight;
	this.fnGetScrollWidth = cJavaScriptFramework_fnGetScrollWidth;
  	
	// Added By Hitesh 
	this.fnSetEventAttributes = cJavaScriptFramework_fnSetEventAttributes;
	this.fnCopyToClipBoard = cJavaScriptFramework_fnCopyToClipBoard;
	this.fnCopyFromClipBoard = cJavaScriptFramework_fnCopyFromClipBoard;
	
	//Attaches Event
	this.fnAttachEvent = cJavaScriptFramework_fnAttachEvent;
	this.fnDetachEvent = cJavaScriptFramework_fnDetachEvent;
	this.fnCanHaveChildren = cJavaScriptFramework_fnCanHaveChildren ;
	this.fnSwap = cJavaScriptFramework_fnSwap;
	this.fnHasChildren = cJavaScriptFramework_fnHasChildren;
	this.fnSetInnerText = cJavaScriptFramework_fnSetInnerText;
	this.fnValidateDate = cJavaScriptFramework_fnValidateDate;

	//Added by babita gupta to make the popup blocker message/tip multilingual
	///-- strAlert_Gecko : Stores the string for Blocked Popups in Mozilla
	this.strTip_Gecko ="SYSPOPUPGECKO";
	///-- strAlert_IE : Stores the string for Blocked Popups in Internet Explorer
	this.strTip_IE = "SYSPOPUPIE";
	///-- strAlert_GoogleToolBarExists : Displayed if Google Toolbar is detected along with the path to unblock the popups
	this.strTip_GoogleToolBarExists = "SYSPOPUPGOOGLE";
	///-- strAlert_GoogleToolBarExists : Displayed if Google Toolbar is not detected
	this.strTip_Unknown = "SYSPOPUPUNKOWN";

	this.fnOnConstruct();
    

	/// <memberMethod name="fnOnConstruct">
	/// <summary>Constructor for cJavaScriptFramework.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnOnConstruct()
	{
		// ///START////// BROWSER DETECTION.
		try
		{
			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 : Added By Mrunal
			///-- Purpose for Setting Active Element in Mozilla.
			if(this.objBrowserInfo.IsMozila)
				this.fnAttachEvent("focus",cJavaScriptFramework_fnSetActiveElement,true);
			///--End : Added By Mrunal
			
			///--Start : Added By Hitesh
			///-- Purpose for Setting Event Attributes before sending ajax requests.
			this.oEvent = this.fnObjectInitializer('cEventAttributes','',[]);
			///--End : Added By Hitesh
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	//Added by Mrunal Brahmbhatt on 22-03-2007 
	/// <memberMethod name="fnGetHeightWidth">
	///	<param name="strContent">Content</param>
	/// <summary>This method returns the height and width of given content.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetHeightWidth(strContent)
    {
	    try
	    {
	        var oOuterContainer = oJSFW.fnCreateElement("div");		
	        var oInnerContainer = oJSFW.fnCreateElement("div");		
	        var oCordinate = {height:0,width:0};
	        var strHelpingContainer = "<table cellpadding='0' cellspacing='0' border='0'><tr><td>" + strContent + "</td></tr></table>" ;
    	    
	        oOuterContainer.style.width = "1px";
		    oOuterContainer.style.height = "1px";
		    oJSFW.fnSetDisplayStyle(oOuterContainer,true);
		    oOuterContainer.style.visibility = "hidden";
		    oJSFW.fnAppendChild(document.body,oOuterContainer);
		    oJSFW.fnAppendChild(oOuterContainer,oInnerContainer);
    		
		    oInnerContainer.innerHTML ="";
		    oInnerContainer.style.width = "1px";
		    oInnerContainer.style.height = "1px";
    		
		    oInnerContainer.innerHTML = strHelpingContainer;
		    oCordinate.width = oInnerContainer.firstChild.offsetWidth;
		    oCordinate.height = oInnerContainer.firstChild.offsetHeight;
    		oInnerContainer.innerHTML ="";
		    oInnerContainer.parentNode.removeChild(oInnerContainer);
		    oOuterContainer.parentNode.removeChild(oOuterContainer);
		    return oCordinate;
	    }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }
	}
	/// <memberMethod name="fnGetScrollTop">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Scroll Top.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetScrollTop(oElement)
	{
	    var intTop = 0;
	     try
	    {
	        if(typeof(oElement) == 'undefined')
	        {
	            if (window.pageYOffset)
                      intTop = window.pageYOffset;
                else if (document.documentElement && document.documentElement.scrollTop)
                    intTop= document.documentElement.scrollTop;
                else if (document.body)
                    intTop= document.body.scrollTop;
            } 
            else
                intTop = oElement.scrollTop;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }
        return intTop; 
	}
    /// <memberMethod name="fnGetScrolLeft">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Scroll Left.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetScrollLeft(oElement)
	{
	    var intLeft = 0;
	    try
	    {
	        if(typeof(oElement) == 'undefined')
	        {
	            if (window.pageXOffset)
                      intLeft = window.pageXOffset;
                else if (document.documentElement && document.documentElement.scrollLeft)
                    intLeft= document.documentElement.scrollLeft;
                else if (document.body)
                    intLeft= document.body.scrollLeft;
            }
            else
                intLeft = oElement.scrollLeft;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }
        return intLeft; 
	}
    /// <memberMethod name="fnGetClientWidth">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Client Width.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetClientWidth(oElement)
	{
	    var intWidth = 0;
	    try
	    {
	        if(typeof(oElement) == 'undefined')
	        {
                if (window.innerWidth)
                    intWidth = window.innerWidth;
                else if (document.documentElement && document.documentElement.clientWidth)
                    intWidth = document.documentElement.clientWidth;
                else if (document.body)
                    intWidth = document.body.clientWidth;
            }   
            else
                intWidth = oElement.clientWidth;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }
        return  intWidth;
	}
    /// <memberMethod name="fnGetClientHeight">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Client Height.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetClientHeight(oElement)
	{
		var intHeight = 0;
		try
		{
		 if(typeof(oElement) == 'undefined')
		 {
            if (window.innerHeight)
                intHeight = window.innerHeight;
            else if (document.documentElement && document.documentElement.clientHeight)
                intHeight = document.documentElement.clientHeight;
            else if (document.body)
                intHeight = document.body.clientHeight;
         }
         else
            intHeight = oElement.clientHeight;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }   
        return  intHeight;
    }
	
    /// <memberMethod name="fnGetClientTop">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Client Top.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetClientTop(oElement)
	{
		var intTop = 0;
		try
		{
		 if(typeof(oElement) == 'undefined')
		 {
            if (document.documentElement && document.documentElement.clientTop)
                intTop = document.documentElement.clientTop;
            else// if (document.body)
                intTop = document.body.clientTop;
         }
         else
            intTop = oElement.clientTop;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }   
        return  intTop;
    }
   
    /// <memberMethod name="fnGetClientLeft">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Client Left.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetClientLeft(oElement)
	{
		var intLeft = 0;
		try
		{
		 if(typeof(oElement) == 'undefined')
		 {
            if (document.documentElement && document.documentElement.clientLeft)
                intLeft = document.documentElement.clientLeft;
            else// if (document.body)
                intLeft = document.body.clientLeft;
         }
         else
            intLeft= oElement.clientLeft;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }   
        return  intLeft;
    }
   
     
    /// <memberMethod name="fnGetParentScroll">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Parent Scroll Amout.</summary>
	/// </memberMethod>
    function cJavaScriptFramework_fnGetParentScroll(oElement)
    {
        var oDimension = {top:0,left:0};
        var valueT = 0, valueL = 0;
        do
        {
            if(String(oElement.tagName).toLowerCase() != "body" )
            { 
                valueT += oElement.scrollTop  || 0;
                valueL += oElement.scrollLeft || 0;
                oElement = oElement.parentNode;
            } 
            else
                break;
        } while (oElement);
        oDimension.left = valueL;
        oDimension.top  = valueT;
        return oDimension; 
     }  
     
   
	
	
    ///End by Mrunal Brahmbhatt on 22-03-2007 
    
   //// Following two functions Added By hitesh 
    /// <memberMethod name="fnGetScrollHeight">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Scroll Height.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetScrollHeight(oElement)
	{
		var intScrollHeight = 0;
		try
		{
		 if(typeof(oElement) == 'undefined')
		 {
            if (window.scrollHeight)
                intScrollHeight = window.scrollHeight;
            else if (document.body)
                intScrollHeight = document.body.scrollHeight;
            else if (self.innerHeight) // all except Explorer
                    intScrollHeight = self.scrollHeight;
            else if (document.documentElement && document.documentElement.scrollHeight)
                intScrollHeight = document.documentElement.scrollHeight;
         }
         else
            intScrollHeight = oElement.scrollHeight;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }   
        return  intScrollHeight;
    }  
   
    /// <memberMethod name="fnGetScrollWidth">
	///	<param name="oElement">Element</param>
	/// <summary>This method returns the Scroll Width.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetScrollWidth(oElement)
	{
		var intScrollWidth = 0;
		try
		{
		 if(typeof(oElement) == 'undefined')
		 {
            if (window.scrollWidth)
                intScrollWidth = window.scrollWidth;
            else if (document.body)
                intScrollWidth = document.body.scrollWidth;
            else if (self.innerHeight) // all except Explorer
                    intScrollWidth = self.innerWidth;
            else if (document.documentElement && document.documentElement.scrollWidth)
                intScrollWidth = document.documentElement.scrollWidth; 
         }
         else
            intScrollWidth = oElement.scrollWidth;
        }
	    catch(oException)
	    {
		     oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
	    }   
        return  intScrollWidth;
    }    
     
    /// Added by Hitesh Patadia
    /// <memberMethod name="fnSetEventAttributes">
	///	<param name="oEvent">Event object from which attributes are to be set.</param>
	/// <summary>This method sets the event attributes.</summary>
	/// </memberMethod>
    function cJavaScriptFramework_fnSetEventAttributes(oEvent,oReferenceObject)
    {
        try
		{ 
		    if((typeof(oReferenceObject) == 'undefined') || (oReferenceObject==null))
		    {
                eval('oReferenceObject=this');
            }
            else if((typeof(oReferenceObject.oEvent) == 'undefined') || (oReferenceObject.oEvent==null))
            {
                oReferenceObject.oEvent = oJSFW.fnObjectInitializer('cEventAttributes','',[]);
            }
            
                /*
                oReferenceObject.oEvent.returnValue= oEvent.returnValue; oReferenceObject.oEvent.cancelBubble = oEvent.cancelBubble;
                oReferenceObject.oEvent.keyCode = oEvent.keyCode; oReferenceObject.oEvent.propertyName = oEvent.propertyName;
                oReferenceObject.oEvent.bookmarks = oEvent.bookmarks; oReferenceObject.oEvent.recordset = oEvent.recordset;
                oReferenceObject.oEvent.dataFld = oEvent.dataFld; oReferenceObject.oEvent.boundElements = oEvent.boundElements;
                oReferenceObject.oEvent.repeat = oEvent.repeat; oReferenceObject.oEvent.srcUrn = oEvent.srcUrn;  */
                oReferenceObject.oEvent.srcElement = this.fnGetSrcElement(oEvent); /*oReferenceObject.oEvent.altKey = oEvent.altKey;
                oReferenceObject.oEvent.ctrlKey = oEvent.ctrlKey; oReferenceObject.oEvent.shiftKey = oEvent.shiftKey;
                oReferenceObject.oEvent.fromElement = oEvent.fromElement; oReferenceObject.oEvent.toElement = oEvent.toElement;
                oReferenceObject.oEvent.button = oEvent.button; 
                */
                oReferenceObject.oEvent.type = oEvent.type;
                /*oReferenceObject.oEvent.qualifier = oEvent.qualifier; oReferenceObject.oEvent.reason = oEvent.reason;*/
                oReferenceObject.oEvent.x = oEvent.x;
                oReferenceObject.oEvent.y = oEvent.y;
                oReferenceObject.oEvent.clientX = oEvent.clientX;
                oReferenceObject.oEvent.clientY = oEvent.clientY;
                oReferenceObject.oEvent.offsetX = oEvent.offsetX;
                oReferenceObject.oEvent.offsetY = oEvent.offsetY;
                oReferenceObject.oEvent.screenX = oEvent.screenX;
                oReferenceObject.oEvent.screenY = oEvent.screenY;
                /*
                oReferenceObject.oEvent.srcFilter = oEvent.srcFilter; oReferenceObject.oEvent.dataTransfer = oEvent.dataTransfer;
                oReferenceObject.oEvent.contentOverflow = oEvent.contentOverflow; oReferenceObject.oEvent.shiftLeft = oEvent.shiftLeft;
                oReferenceObject.oEvent.altLeft = oEvent.altLeft; oReferenceObject.oEvent.ctrlLeft = oEvent.ctrlLeft;
                oReferenceObject.oEvent.imeCompositionChange = oEvent.imeCompositionChange; oReferenceObject.oEvent.imeNotifyCommand = oEvent.imeNotifyCommand;
                oReferenceObject.oEvent.imeNotifyData = oEvent.imeNotifyData; oReferenceObject.oEvent.imeRequest = oEvent.imeRequest;
                oReferenceObject.oEvent.imeRequestData = oEvent.imeRequestData; oReferenceObject.oEvent.keyboardLayout = oEvent.keyboardLayout;
                oReferenceObject.oEvent.behaviorCookie = oEvent.behaviorCookie; oReferenceObject.oEvent.behaviorPart = oEvent.behaviorPart;
                oReferenceObject.oEvent.nextPage = oEvent.nextPage; oReferenceObject.oEvent.wheelDelta = oEvent.wheelDelta;
                */
         }
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		} 
    }

	// ///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">ID of required element</param>
	///	<param name="forcefetch">Optional. Specify whether to fetch object from DOM (true) or return from cached array if available (false)</param>
	///	<param name="oDocument">Optional. Document object under which element is expected.</param>
	///	<param name="strFormName">Optional. When there are more than one form and they may have element which has same Id then pass form name for uniqueness</param>
	/// <summary>Function to emulate document.getElementById(). Returns element with specified ID if found else null.</summary>
	/// <remarks>Modified by Mrunal Brahmbhatt on 10-02-2007</remarks>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementById( idname, forcefetch, oDocument,strFormName)
	{
		try
		{
			if( String( typeof forcefetch ) == "undefined" || forcefetch!=false)
			{
				forcefetch = true;
			}
			//-- Modified By Mrunal Brahmbhatt on 10-02-2007
			if(String(typeof oDocument)=='undefined' || oDocument == null)
				oDocument = document;
        
            if(typeof(strFormName) == 'undefined')
           { 
			    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;
				    }
			    }
			}
			else
			{
			    //-- Added by Mrunal Brahmbhatt.
			    //-- When there are more than one form and they may have element which has same Id then pass form name for uniqueness
			   cJavaScriptFramework_arrGetElemObjs[idname] = document.forms[strFormName][idname]; 
			}
			return cJavaScriptFramework_arrGetElemObjs[idname];
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnCancelBubble">
	///	<param name="eventobj">Reference of event object.</param>
	/// <summary>function to cancel event bubble.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCancelBubble( eventobj )
	{
		try
		{
			if( this.objBrowserInfo.IsMozila )
			{
				eventobj.stopPropagation();
				this.fnDebug( "Event Bubble Cancelled." );
				return eventobj;
			}
			else if( this.objBrowserInfo.IsIE ) 
			{
				if( window.event != null )
				{
					//window.event.returnValue = false;
					window.event.cancelBubble = true;
					this.fnDebug( "Event Bubble Cancelled." );
					return window.event;
				}
				else
				{
					return null;
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnCancelEvent">
	///	<param name="eventobj">Reference of event object.</param>
	/// <summary>function to cancel event.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCancelEvent( eventobj )
	{
		try
		{
			if( this.objBrowserInfo.IsMozila )
			{
				eventobj.preventDefault();
				this.fnDebug( "Default Event Cancelled." );
				return eventobj;
			}
			else if( this.objBrowserInfo.IsIE ) 
			{
				if( window.event != null )
				{
					window.event.returnValue = false;
					this.fnDebug( "Default Event Cancelled." );
					return window.event;
				}
				else
				{
					return null;
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnGetPageEventCoords">
	///	<param name="eventobj">Reference of event object.</param>
	/// <summary>Returns page coordinate of the event object with respect to body(screen)</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetPageEventCoords( eventobj )
	{
		try
		{
			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
			{
				///-- current Coordinates + scroll amount of body(ie. coordinates of screen with respect to body)
				
				//coords.left = eventobj.clientX + document.body.scrollLeft /*- document.body.clientLeft*/;
				//coords.top  = eventobj.clientY + document.body.scrollTop /*- document.body.clientTop*/;
				
				coords.left = eventobj.clientX + this.fnGetScrollLeft(); /*- document.body.clientLeft*/;
				coords.top  = eventobj.clientY + this.fnGetScrollTop();/*- 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;
				}*/
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		///-- Returns the coordinates
		return coords;
	}

	/// <memberMethod name="fnGetElementEventCoords">
	///	<param name="eventObj">Reference of event object.</param>
	/// <summary>Returns positioned coordinate of the event object with respect to element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementEventCoords( eventObj )
	{
		try
		{
			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 )
			{
				///-- for NS.
				/*
				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 )
			{
				///-- Returns the coordinates with respect to element which fires the event(i.e. Offset of mouse with respect to element)
				oCoords.left = eventObj.offsetX;
				oCoords.top  = eventObj.offsetY;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}

		//this.fnCancelBubble( eventObj );
		///-- Returns the coordinates
		return oCoords;
	}

	/// <memberMethod name="fnGetElementStyle">
	///	<param name="oElement">Subject element</param>
	///	<param name="strStyleAttribute">Style Attribute name</param>
	/// <summary>Returns style attribute for given object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementStyle( oElement, strStyleAttribute)
	{
	    var value = '';
		try
		{
			if( oElement.currentStyle )
			{
				value = oElement.currentStyle[ strStyleAttribute ];
			}
			else if( window.getComputedStyle )
			{
				var oCompStyle = window.getComputedStyle( oElement, "" );
				if(oCompStyle != null &&  oCompStyle != 'undefined')
				value = oCompStyle.getPropertyValue( strStyleAttribute );
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return value;
	}

	/// <memberMethod name="fnGetSrcElement">
	///	<param name="eventObj">Reference of event object.</param>
	/// <summary>Returns srcElement of the event object.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetSrcElement( eventObj )
	{
		try
		{
			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;
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}

		return null;
	}

	
	/// <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 )
	{
		try
		{
			if( this.blnDebug )
				alert( sStr );
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}


	// //END////// COMMON DOM FUNCTIONS.

	// ///START////// SOME MORE COMMON DOM FUNCTIONS. - Added By Nidhi Vithlani.

	/// <memberMethod name="fnGetInnerText">
	///	<param name="oSrcElement">Subject element</param>
	/// <summary>Returns innerText of passed element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetInnerText(oSrcElement)
	{
		try
		{
			if( this.objBrowserInfo.IsMozila )
			{
				return oSrcElement.textContent;
			}
			else //if( this.objBrowserInfo.IsIE ) 
			{
				return oSrcElement.innerText;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnGetOuterHTML">
	///	<param name="oSrcElement">Subject element</param>
	/// <summary>Returns outerText of passed element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetOuterHTML(oSrcElement)
	{
		try
		{
			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;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnGetKeyCode">
	///	<param name="oEventObject">Reference of event object.</param>
	/// <summary>Return key code from event object</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetKeyCode(oEventObject)
	{
		try
		{
			if(this.objBrowserInfo.IsIE)
				return oEventObject.keyCode;
			else
				return oEventObject.which;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnSetKeyCode">
	///	<param name="oEventObject">Reference of event object</param>
	///	<param name="intValue">Desired value of keycode</param>
	/// <summary>Sets key code in event object</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetKeyCode(oEventObject, intValue)
	{
		try
		{
			if(this.objBrowserInfo.IsIE)
				oEventObject.keyCode = intValue;
			else
				oEventObject.which = intValue;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnGetAttribute">
	///	<param name="oElement">Subject element</param>
	///	<param name="strAttribute">Attribute name</param>
	/// <summary>Gets attribute of passed element</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetAttribute(oElement,strAttribute)
	{
		try
		{
			return oElement.getAttribute(strAttribute);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnSetAttribute">
	///	<param name="oElement">Subject element</param>
	///	<param name="strAttribute">Atribute name</param>
	///	<param name="strValue">Value of attribute</param>
	/// <summary>Sets attribute of passed element</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetAttribute(oElement,strAttribute, strValue)
	{
		try
		{
			return oElement.setAttribute(strAttribute, strValue);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	// ///END////// SOME MORE COMMON DOM FUNCTIONS.
	
	
	// Start of (following) functions added by Kinjal Desai
	
	/// <memberMethod name="fnObjectInitializer">
	///	<param name="strClassName">Desired object's class name</param>
	///	<param name="strOnNullExceptionMessage">Optional. String message which would be message of cACTLException thrown if object Instantiation fails</param>
	///	<param name="oArrVariableArguments">Optional. Array of arguments needed by the class constructor</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, oArrVariableArguments)
	{
		try
		{
			///-- 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 (oArrVariableArguments)=='undefined')
				oArrVariableArguments = new Array();
			for(var intArgCounter=0;intArgCounter<oArrVariableArguments.length;intArgCounter++)
			{
				strActualArguemnts += "," + ("oArrVariableArguments[" + 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.fnDebug("Call to fnObjectInitializer(" + strClassName + ", ...) failed.");
				this.fnThrowACTLError(strNullErrorMessage);
			}
			else
				this.fnDebug("Call to fnObjectInitializer(" + strClassName + ", ...) returning object.");
				
			return objUserObject;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnActiveXInitializer">
	///	<param name="strClassNameOrShortName">ActiveX class name or User defined short description of ActiveX class to be instantiated</param>
	///	<param name="strOnNullExceptionMessage">Optional. String message which would be message of cACTLException thrown if ActiveX object creation fail</param>
	///	<param name="strLocation">Optional. String location</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)
	{
		try
		{
			///-- 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.fnDebug("Call to fnActiveXInitializer(" + strClassNameOrShortName + ", ...) failed.");
				this.fnThrowACTLError(strNullErrorMessage);
			}
			else
				this.fnDebug("Call to fnActiveXInitializer(" + strClassNameOrShortName + ", ...) returning object.");
				
			return objUserObject;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnSubmitForm">
	///	<param name="oForm">Form object to be submitted.</param>
	///	<param name="strOptionalAction">Optional. Action attribute if user wants to change it before submitting.</param>
	///	<param name="strOptionalMethod">Optional. Method attribute if user wants to change it before submitting.</param>
	/// <summary>Wrapper for submitting form.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSubmitForm(oForm, strOptionalAction, strOptionalMethod)
	{
		try
		{
			if(typeof (strOptionalAction)!='undefined' && strOptionalAction!=null)
				oForm.action = strOptionalAction;
			if(typeof (strOptionalMethod)!='undefined' && strOptionalMethod!=null)
				oForm.method = strOptionalMethod;
				
			oForm.submit();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnAlert">
	///	<param name="strMessageOrMessageShortDesc">
	///     String message to be displayed or the shortdescription of message to be added in message pane
	///</param>
	/// <summary>Wrapper for alert.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnAlert(strMessageOrMessageShortDesc)
	{		
	
		try
		{
		    if(this.oMessageCollectorInstance==null)
				alert(strMessageOrMessageShortDesc);
			else
			{
			    this.oMessageCollectorInstance.fnDisplayMessages([strMessageOrMessageShortDesc]);
			    
                    //				if(this.strMessagePaneLeafShortDesc == "")
                    //				{
                    //					this.fnThrowACTLError('Please enter the Leaf Short Description');
                    //				}
                    //				else
                    //				{
                    //					this.oMessagePaneToBeUsed.oMsgLeaf.strLeafSDesc = this.strMessagePaneLeafShortDesc;
                    //					var strMsgSDesc = "strMsgSDesc" + Math.random();
                    //					this.oMessagePaneToBeUsed.fnAddMessage(strMsgSDesc,strMessage,'','','','','','','','','','');
                    //					this.oMessagePaneToBeUsed = null;
                    //					this.strMessagePaneLeafShortDesc = "";
                    //				}                    
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnWindowOpen">
	///	<param name="strURL">URL of page to be displayed in new window.</param>
	///	<param name="strWindowName">Name of new window.</param>
	///	<param name="strOptionalFeatures">Optional. Desired features of new window</param>
	/// <summary>Wrapper for window.open(). Plus added functionality of popup blocker tip. If function detects presence of popup blocker, then its will raise cACTLException where message would be tip to disable the detected popup blocker.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnWindowOpen(strURL, strWindowName, strOptionalFeatures)
	{
		var oWindowObject;
		try
		{
			if(typeof (strOptionalFeatures)!='undefined')
				oWindowObject = window.open(strURL, strWindowName, strOptionalFeatures);
			else
				oWindowObject = window.open(strURL, strWindowName);
			if(oWindowObject==null)
			{
				this.fnAlert(this.fnGetPopupBlockerTip());
				return null;
			}
			return oWindowObject;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnWindowClose">
	///	<param name="oWindow">Object of window to be closed.</param>
	/// <summary>Wrapper for window.close().</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnWindowClose(oWindow)
	{
		try
		{
			oWindow.close();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnCreateElement">
	///	<param name="strTag">Tag whose element is be to created.</param>
	///	<param name="oOptionalDocument">Optional. Document object under which the element is to be created.</param>
	/// <summary>Wrapper for document.createElement().</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnCreateElement(strTag,oOptionalDocument)
	{
		try
		{
			if(typeof (oOptionalDocument)=='undefined')
				oOptionalDocument = document;
			return oOptionalDocument.createElement(strTag);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnRemoveChild">
	///	<param name="oChildToBeRemoved">Reference to object to be removed</param>
	/// <summary>Wrapper for removeChild.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnRemoveChild(oChildToBeRemoved)
	{
		try
		{
			if(oChildToBeRemoved==null || oChildToBeRemoved.parentNode==null)
				return false;
			else
			{
				if(this.objBrowserInfo.IsIE)
				{
					var oStateMaintenance = new cIEStateMaintainer();
					oStateMaintenance.fnStoreState(oChildToBeRemoved);
				}
				oChildToBeRemoved.parentNode.removeChild(oChildToBeRemoved);
				
				if(this.objBrowserInfo.IsIE)
				oStateMaintenance.fnRestoreState();
				
				return true;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnSwapContent">
	///	<param name="oContainer1">Reference to a container object</param>
	///	<param name="oContainer2">Reference to another container object</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(oException)
		{
			oContainer1.innerHTML = strContainer1InnerHTML;
			oContainer2.innerHTML = strContainer2InnerHTML;
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
			//throw new cACTLException(oExp.message, "cJavaScriptFramework.fnSwapContent");
		}
	}
	
	
	
	/// <memberMethod name="fnGetElementsByTagName">
	///	<param name="strTagName">Tag name of desired elements</param>
	///	<param name="oOptionalParent">Optional. Parent node whose children are to be fetched</param>
	/// <summary>Returns element array of elements of given tagName.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementsByTagName(strTagName, oOptionalParent)
	{
		try
		{
			if(typeof (oOptionalParent)=='undefined')
				oOptionalParent = document;
			return oOptionalParent.getElementsByTagName(strTagName);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnGetElementsByName">
	///	<param name="strElementName">Name of element to be fetched.</param>
	/// <summary>Returns element array of elements of given name.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnGetElementsByName(strElementName)
	{
		try
		{
			return document.getElementsByName(strElementName);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnAppendChild">
	///	<param name="oParentNode">Reference to parent node</param>
	///	<param name="oChildToBeAppended">Reference to node to be added</param>
	/// <summary>Appends a node under specified node.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnAppendChild(oParentNode, oChildToBeAppended)
	{
		var oElement;
		///-- Code added by meghna for state maintenance
		try
		{
			if(this.objBrowserInfo.IsIE)
			{
				var oStateMaintenance = new cIEStateMaintainer();
				oStateMaintenance.fnStoreState(oChildToBeAppended);
			}
			
			oElement = oParentNode.appendChild(oChildToBeAppended);
			
			if(this.objBrowserInfo.IsIE)
				oStateMaintenance.fnRestoreState();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return oElement;
	}
	/// <memberMethod name="fnInsertBefore">
	///	<param name="oNodeToBeInserted">Node to be inserted.</param>
	///	<param name="oReferenceNode">Reference node before which oNodeToBeInserted is to be inserted</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
		try
		{
			if(this.objBrowserInfo.IsIE)
			{
				var oStateMaintenance = new cIEStateMaintainer();
				oStateMaintenance.fnStoreState(oNodeToBeInserted);
			}
			oReferenceNode.parentNode.insertBefore(oNodeToBeInserted, oReferenceNode);
			if(this.objBrowserInfo.IsIE)
				oStateMaintenance.fnRestoreState();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnIsChild">
	///	<param name="oNode">Reference to subject node</param>
	///	<param name="oParentNode">Reference to node which is to be checked to be parenthood</param>
	/// <summary>Returns true if given node is child of specified node</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnIsChild(oNode, oParentNode)
	{
		var oInterParentNode;
		try
		{
			oInterParentNode = oNode.parentNode;
			while(oInterParentNode != null)
			{
				if(oInterParentNode == oParentNode)
					return true;
				oInterParentNode = oInterParentNode.parentNode;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return false;
	}
	/// <memberMethod name="fnSetDisplayStyle">
	///	<param name="oElement">Reference to element object</param>
	///	<param name="blnSetVisible">Boolean to specify whether to turn visiblity on (true) or off (false)</param>
	/// <summary>Set stlye.display of given element for visible / invisible.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetDisplayStyle(oElement, blnSetVisible)
	{
		try
		{
			oElement.style.display = ((blnSetVisible)?'':'none');
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnCheckMaxLength">
	///	<param name="oElement">Reference to element object</param>
	///	<param name="oEventObject">Reference to event object</param>
	///	<param name="intLength">Maximum allowed length</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 is null";
		var blnReturnValue=null;
		var strInsertingText, strNewInsertingText;
		var intControlTextLength, intSelectionLength, intClipBoardTextLength, intExcessChars;
		var oSelectionRange;

		try
		{
			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;

						intControlTextLength = oElement.value.length;
						intClipBoardTextLength = strInsertingText.length;

						intExcessChars = ((intControlTextLength - intSelectionLength)+intClipBoardTextLength-intLength);
						if(intExcessChars>0)
						{
							strNewInsertingText = strInsertingText.substr(0, strInsertingText.length - intExcessChars);
							window.clipboardData.setData('text', strNewInsertingText);
						}
						blnReturnValue = true;
					break;
					case 'drop':
						blnReturnValue = false;
						/*strInsertingText = document.selection.createRange().text;
						intControlTextLength = oElement.value.length;

						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
							this.fnThrowACTLError(strNullExceptionMessage);
				}
			}
			else
			{
				if(oElement!=null)
				{
					if(oElement.value.length>intLength)
						blnReturnValue = false;
					else
						blnReturnValue = true;
				}
				else
				{
					this.fnThrowACTLError(strNullExceptionMessage);
				}
			}
			if(!blnReturnValue)
			{
				this.fnCancelEvent(oEventObject);
			}
			return blnReturnValue;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <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;

		try
		{
			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;
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		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;

		try
		{
			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
							this.fnThrowACTLError(strNullExceptionMessage);
					break;
				}
			}
			else
			{
				if(oElement!=null)
					blnReturnValue = this.fnIsSrcStrCharacterFromCharSet(oArrChars, oElement.value);
				else
					this.fnThrowACTLError(strNullExceptionMessage);
			}
			if(!blnReturnValue)
				this.fnCancelEvent(oEventObject);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		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) 
	{
		try
		{
			var iLeft = oEl.offsetLeft;
			while ((oEl = oEl.offsetParent) != null)
				iLeft += oEl.offsetLeft;
			return iLeft;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <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) 
	{
		try
		{
			var iTop = oEl.offsetTop;
			while((oEl = oEl.offsetParent) != null)
				iTop += oEl.offsetTop;
			return iTop;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <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;
		try
		{
			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];
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		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;
		try
		{
			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];
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return oSmallest;
	}

	/// <memberMethod name="fnGetElementsFromHTMLString">
	///	<param name="strHTML">Source HTML as string</param>
	///	<param name="oDocument">Optional. Document object in which the elements are to be created.</param>
	/// <summary>Returns array of elements from an HTML String</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetElementsFromHTMLString(strHTML, oDocument)
	{
		try
		{
			var oTempDiv = this.fnCreateElement("DIV",oDocument);
			oTempDiv.innerHTML = strHTML;
			return oTempDiv.childNodes;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnHTMLEncode">
	///	<param name="strText">String value to be encoded</param>
	/// <summary>Performs Encoding on a HTML string</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnHTMLEncode(strText)
	{
		try
		{
			return strText.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/"/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnHTMLDecode">
	///	<param name="strText">String value to be decoded</param>
	/// <summary>Performs Decoding on a HTML string</summary>
	/// </memberMethod>	
	
	function cJavaScriptFramework_fnHTMLDecode(strText)
	{
		try
		{
			return strText.replace(/&quot;'/g, "\"").replace(/&lt;/g, '<').replace(/&#39;/g, "'").replace(/&gt;/g, '>').replace(/&amp;/g, '&');
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnGlobalVariableExists">
	///	<param name="strVariableName">Variable name in string.</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";
		try
		{
			strPrefix = ((typeof strOptionalPrefix=='undefined')?"":strOptionalPrefix) + strPrefix;
			
			var blnGot=false;
			
			do{
				try{
					eval(strPrefix + (++intIncrementer));
				}catch(oExp) {	blnGot = true;	}
			}while(!blnGot);
			return  strPrefix + (intIncrementer);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnConfirm">
	///	<param name="strMessage">String message for confirmation</param>
	/// <summary>Wrapper for Confirm</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnConfirm(strMessage)
	{
		try
		{
			return confirm(strMessage);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnGetTypeName">
	///	<param name="oValue">Object whose type is needed.</param>
	/// <summary>Returns the name of function that created the given object. In other words, Class Name of the object. If function fails to determine type of the object then it raises an cACTLException with message 'Non-interpretable type'.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetTypeName(oValue)
	{
		var strTemp;
		var strReturnValue;
		try
		{
			if(oValue==null)
				strReturnValue = null;
			else
			{
				if(!oValue.constructor)
					this.fnThrowACTLError("Non-interpretable type");
				else
				{
					strTemp = String(oValue.constructor);
					strReturnValue = this.fnGetTypeNameFromFunctionCode(strTemp);
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return strReturnValue;
	}
	/// <memberMethod name="fnGetTypeNameFromFunctionCode">
	///	<param name="strFunctionCode">Code of the function</param>
	/// <summary>Returns the name of function from function code.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnGetTypeNameFromFunctionCode(strFunctionCode)
	{
		var strTemp = strFunctionCode;
		var strReturnValue;
		try
		{
			strTemp = strTemp.fnTrim();
			strTemp = strTemp.substr(8 /*length 8 for "function "*/);
			strTemp = strTemp.substr(0, strTemp.indexOf("("));
			strReturnValue = strTemp.fnTrim();
			return strReturnValue;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnEncodeWithCRLF">
	///	<param name="strValue">String value to be encoded</param>
	/// <summary>Performs Encoding on a HTML string for Line Feed and Carriage Return</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnEncodeWithCRLF(strValue)
	{
		try
		{
		//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>");
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
	/// <memberMethod name="fnDecodeWithCRLF">
	///	<param name="strValue">String value to be decoded</param>
	/// <summary>Performs Decoding on a HTML string for Line Feed and Carriage Return</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnDecodeWithCRLF(strValue)
	{
		try
		{
			return this.fnHTMLDecode(strValue.replace(/<br>/gi, "\n"));
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		//this.fnHTMLDecode(strValue.replace(/<br>/gi, "\n\r"))
	}
	
	/// <memberMethod name="fnThrowACTLException">
	///	<param name="strErrorDescription">Text explaining the exceptional situation or causes of the exception</param>
	///	<param name="strLocation">Code location, generally Class name (if applicable) and method name from where the Exception is been thrown</param>
	///	<param name="oBaseException">Reference to the caught exception</param>
	/// <summary>Creates and Throws cACTLException using passes parameters</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnThrowACTLException(strErrorDescription, strLocation, oBaseException,blnRethrow)
	{
		var oException;
			if(strLocation==null)
			{
				strLocation = this.fnGetTypeNameFromFunctionCode(String(arguments.caller));
		    }
			oException = new cACTLException(strErrorDescription, strLocation, oBaseException);
			
		    if(typeof(blnRethrow) == 'undefined' || blnRethrow == true)
		   { 
		        throw oException; 
		    }
		     else
		     {
		        //-- Added by Mrunal Brahmbhatt on 07-02-2007
			    eval(this.strFnAdditionalExceptionHandling + "(oException.fnGetDetailedStackTrace(), strLocation, oBaseException)");
			  }
	}
	/// <memberMethod name="fnThrowACTLError">
	///	<param name="strErrorDescription">Text explaining the exceptional situation or causes of the exception</param>
	/// <summary>Creates and Throws cACTLException using passes parameters</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnThrowACTLError(strErrorDescription)
	{
		var oError;
		try
		{
			oError = new cACTLError(strErrorDescription);
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		throw oError;
	}
	
	/// <memberMethod name="fnCloneNode">
	///	<param name="oElement">Element to be cloned.</param>
	///	<param name="blnCloneChildren">Boolean to specify whether to copy all its child nodes too (true) or only the current node (false)</param>
	/// <summary>Creates returns clone of the given node. It uses cIEStateMaintainer for maintaining state of certain elements whose state do change in IE while cloning.</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnCloneNode(oElement, blnCloneChildren)
	{
		try
		{
			var oClonedNode = null;
			var oStateMainteanance = null; 
			oClonedNode = oElement.cloneNode(blnCloneChildren);
			if(this.objBrowserInfo.IsIE)
			{
				oStateMainteanance = this.fnObjectInitializer("cIEStateMaintainer","");	
				oStateMainteanance.fnCopyState(oElement, oClonedNode);
			}
			return oClonedNode;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}

	}
	// 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 = "Unknown Popup Blocker Detected";
		

		if(String(this.strTip_Gecko).fnTrim() !="" && String(this.strTip_Gecko) !="undefined"){
			strAlert_Gecko = this.strTip_Gecko;
		}
	

		if(String(this.strTip_IE).fnTrim() !="" && String(this.strTip_IE) !="undefined")
		
		{
			
			strAlert_IE = this.strTip_IE;
		}


		if(String(this.strTip_GoogleToolBarExists).fnTrim() !="" && String(this.strTip_GoogleToolBarExists) !="undefined"){
			strAlert_GoogleToolBarExists = this.strTip_GoogleToolBarExists;
		}


		if(String(this.strTip_Unknown).fnTrim() !="" && String(this.strTip_Unknown) !="undefined"){
			strAlert_GoogleToolBarNotExists = this.strTip_Unknown;
		}

		try
		{

			var oElement = this.fnCreateElement('object');
			oElement.id='detection';
			oElement.classid = 'clsid:00EF2092-6AC5-47c0-BD25-CF2D5D657FEB';
			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(oElement)!= "undefined") 
						{ 
							if (typeof(oElement.Search)!= "undefined") 
								return strAlert_GoogleToolBarExists;
							else 
								return strAlert_GoogleToolBarNotExists;
						} 
						///-- Pending: Yahoo Toolbar detection ( would be same as Google except the classid		)		
					}
				}
				catch(ex)
				{
					oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
				}						
			}
			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 || navigator.userAgent.indexOf("MSIE")>-1)
						return strAlert_IE;
				}
				catch(ex)
				{
					oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
				}
			}
		}
		catch(ex)
		{
			oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
		}
	}


	/// <memberMethod name="fnSerializeFormAsXML">
	///	<param name="oForm">Instance of Form object</param>
	///	<param name="strCommaSeperatedElementNames">String of Element Names </param>
	///	<param name="blnIncludeGivenElements">Set to true if the above items are to be included</param>
	///	<param name="strRootTagName">Specify the root name if to be included</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 + '>';
			}
			


			var oArrFormElementColl = new Array();
			var oArrFormElementPointer = new Array();
			var strElementName, strElementValue;
		
			for(var a = 0 ; a < oArrFormElements.length ; a++)
			{
				strElementName = oArrFormElements[a].name;
				if(strElementName!="") ///$$ verify its not null
				{
					if(oArrFormElementColl[strElementName]!=undefined)
					{
						if(oArrFormElements[a].checked)
							oArrFormElementColl[strElementName] += "," + oArrFormElements[a].value;
					}
					else
					{
						if(oArrFormElements[a].type.toLowerCase()=="radio" || oArrFormElements[a].type.toLowerCase()=="checkbox")
						{
							if(oArrFormElements[a].checked)
								oArrFormElementColl[strElementName] = oArrFormElements[a].value;
						}
						else
						{
							if(oArrFormElements[a].type.toLowerCase()=="select-multiple")
							{
								var strMultiSelectedFields = "";
								for(var iSel = 0 ; iSel < oArrFormElements[a].childNodes.length ; iSel++)
								{
									if(oArrFormElements[a].childNodes(iSel).nodeType==1)
									{
										if(oArrFormElements[a].childNodes(iSel).selected)
										{
											strMultiSelectedFields += oArrFormElements[a].childNodes(iSel).value + ",";
											
										}
									}
								}
								strMultiSelectedFields = strMultiSelectedFields.substr(0,strMultiSelectedFields.length-1);
								oArrFormElementColl[strElementName] = strMultiSelectedFields ;
							}
							else
								oArrFormElementColl[strElementName] = oArrFormElements[a].value;
						}
							//oArrFormElementColl[strElementName] = oArrFormElements[a].value;
					}
					
					if(oArrFormElementPointer.fnIndexOf(strElementName)==-1)
						oArrFormElementPointer.push(strElementName);
				}
			}
		
			for(var a=0;a<oArrFormElementPointer.length;a++)
			{
				strElementName = oArrFormElementPointer[a];
				strElementValue = oArrFormElementColl[strElementName];
				if(strElementValue!=undefined)
					strFormAsXML +=  "<" + strElementName + ">" + strElementValue + "</" + strElementName + ">";
			}
			

	

			
			if(strRootTagName!='' && strRootTagName!='undefined' && strRootTagName!=null)
			{
				strFormAsXML = strFormAsXML +  '</' + strRootTagName + '>';
			}
			
			return strFormAsXML ;
		}
		catch(ex)
		{
			oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
		}

	}

	/// <memberMethod name="fnSerializeFormForQuerystring">
	///	<param name="oForm">Instance of Form object</param>
	///	<param name="strCommaSeperatedElementNames">String of Element Names </param>
	///	<param name="blnIncludeGivenElements">Set to true if the above items are to be included</param>
	///	<param name="strAmpersAndReplacement">Optional. Set string (or character) to be replaced for '&' in value of elements</param>
	///	<param name="strKeyValuePairSeparator">Optional. String (or character) to be used as key-value separator.</param>
	/// <summary>Function to Serialize Form in QueryString format</summary>
	/// </memberMethod>	
	function cJavaScriptFramework_fnSerializeFormForQuerystring(oForm,strCommaSeperatedElementNames,blnIncludeGivenElements, strAmpersAndReplacement, strKeyValuePairSeparator)
	{
		var oArrFormElements = new Array();
		var oArrTemp = new Array();
		var intCounter;
		var strFormAsQS='';
		var strArrElementNames = new Array();
		
		strAmpersAndReplacement = (strAmpersAndReplacement==undefined)?this.strAmpersAndReplacement:strAmpersAndReplacement;
		strKeyValuePairSeparator = (strKeyValuePairSeparator==undefined)?'&':strKeyValuePairSeparator;
		
		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;
			}
			
			
			var oArrFormElementColl = new Array();
			var oArrFormElementPointer = new Array();
			var strElementName, strElementValue;
			
			for(var a = 0 ; a < oArrFormElements.length ; a++)
			{
				strElementName = oArrFormElements[a].name;
				if(strElementName!="") ///$$ verify its not null
				{
					if(oArrFormElementColl[strElementName]!=undefined)
					{
						if(oArrFormElements[a].checked)
							oArrFormElementColl[strElementName] += "," + oArrFormElements[a].value;
						else if(oArrFormElements[a].type.toLowerCase() == "text")
						{
						    //For textbox as the value can contain , seperation is done with 5 char
						    oArrFormElementColl[strElementName] += String.fromCharCode(5) + oArrFormElements[a].value;
						    //oArrFormElementColl[strElementName] += "," + oArrFormElements[a].value;
						}
					}
					else
					{
						if(oArrFormElements[a].type.toLowerCase()=="radio" || oArrFormElements[a].type.toLowerCase()=="checkbox")
						{
							if(oArrFormElements[a].checked)
								oArrFormElementColl[strElementName] = oArrFormElements[a].value;
						}
						else
						{
							if(oArrFormElements[a].type.toLowerCase()=="select-multiple")
							{
								var strMultiSelectedFields = "";
								
								if(oArrFormElements[a].getAttribute('isMoversListControl')!=null && oArrFormElements[a].getAttribute('isMoversListControl').toLowerCase() == "true")
								{
								    for(var iSel = 0 ; iSel < oArrFormElements[a].childNodes.length ; iSel++)
								    {
									    if(oArrFormElements[a].childNodes[iSel].nodeType==1)
									    {
										   strMultiSelectedFields += oArrFormElements[a].childNodes[iSel].value + ",";    																				   
									    }									
								    }
								}
								else
								{
								    for(var iSel = 0 ; iSel < oArrFormElements[a].childNodes.length ; iSel++)
								    {
									    if(oArrFormElements[a].childNodes[iSel].nodeType==1)
									    {
										    if(oArrFormElements[a].childNodes[iSel].selected)
										    {
											    strMultiSelectedFields += oArrFormElements[a].childNodes[iSel].value + ",";
    											
										    }										
									    }									
								    }
								}
								strMultiSelectedFields = strMultiSelectedFields.substr(0,strMultiSelectedFields.length-1);
								oArrFormElementColl[strElementName] = strMultiSelectedFields ;
							}
							
							else
								oArrFormElementColl[strElementName] = oArrFormElements[a].value;
						}
							//oArrFormElementColl[strElementName] = oArrFormElements[a].value;
					}
					
					if(oArrFormElementPointer.fnIndexOf(strElementName)==-1)
						oArrFormElementPointer.push(strElementName);
				}
			}
			//alert(oArrFormElements.length + "," + )
			strFormAsQS="";
			for(var a=0;a<oArrFormElementPointer.length;a++)
			{
				strElementName = oArrFormElementPointer[a];
				strElementValue = oArrFormElementColl[strElementName];
				
				if(strElementValue!=undefined)
				{
					strElementValue = strElementValue.replace(/&/gi,strAmpersAndReplacement);
					strFormAsQS +=  strElementName + "=" + strElementValue + strKeyValuePairSeparator;
				}
			}
			
			if(strFormAsQS!="")
			{
				strFormAsQS = strFormAsQS.substr(0,strFormAsQS.length-(strKeyValuePairSeparator.length));
				strFormAsQS = 'strAmpersAndReplacement=' + strAmpersAndReplacement +'&'+ strFormAsQS;
			}
			else
				strFormAsQS = 'strAmpersAndReplacement=' + strAmpersAndReplacement;
			return strFormAsQS;
			
			
		}
		catch(ex)
		{
			oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
		}

	}	

	/// <memberMethod name="fnSerializeParamObjectAsXML">
	///	<param name="oParamObject">Instance of Parameter Object</param>
	///	<param name="oArrSelectedColumn">Array of Columns</param>
	///	<param name="blnIncludeColName">Set to true if column name is to be included</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] + '>';
									
									break;
								}
							}
						}
					}
					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)
		{
			oJSFW.fnThrowACTLException(ex.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), ex);
		}
	}	
	
	// 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)
	{
		try
		{
			var intcounter =0 ;
			if(this.objBrowserInfo.IsMozila)
			{
				if((typeof(bCapture) == 'undefined') || (bCapture == null))
					bCapture = false;
				
				if(typeof(oElement) != 'undefined')
					///-- Bind to event with specific single element.
					oElement.addEventListener(strEvent,fnFunctionPointer,bCapture);
				else
					///-- Bind to event not specific to any single element.(i.e bind to all element)
					///-- when ever event fires this fnFunctionPointer will call.
					addEventListener(strEvent,fnFunctionPointer,bCapture);
			}	
			else if(this.objBrowserInfo.IsIE)	
			{
				if(typeof(oElement) != 'undefined')
					///-- Bind to event with specific single element.
					oElement.attachEvent("on" + strEvent,fnFunctionPointer);
				else
				{
					oElement = this.fnGetElementsByTagName('*');
					///-- Bind to event not specific to any single element.(i.e bind to all element)
					///-- when ever event fires this fnFunctionPointer will call.
					for(intcounter =0 ;intcounter<oElement.length ; intcounter++)
						oElement[intcounter].attachEvent("on" + strEvent,fnFunctionPointer);
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}

	}


	/// <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)
	{
		try
		{
			var intcounter =0 ;
			if(this.objBrowserInfo.IsMozila)
			{
				if((typeof(bCapture) == 'undefined') || (bCapture == null))
					bCapture = false;
				
				if(typeof(oElement) != 'undefined')
					///-- Unbind to event with specific single element.
					oElement.removeEventListener(strEvent,fnFunctionPointer,bCapture);
				else
					///-- Unbind to event not specific to any single element.(i.e unbind to all element)
					removeEventListener(strEvent,fnFunctionPointer,bCapture);
			}	
			else if(this.objBrowserInfo.IsIE)	
			{
				if(typeof(oElement) != 'undefined')
					///-- Unbind to event with specific single element.
					oElement.detachEvent("on" + strEvent,fnFunctionPointer);
				else
				{
					///-- Unbind to event not specific to any single element.(i.e unbind to all element)
					oElement = this.fnGetElementsByTagName('*');
					for(intcounter =0 ;intcounter<oElement.length ; intcounter++)
						oElement[intcounter].detachEvent("on" + strEvent,fnFunctionPointer);
				}
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}

	}


	/// <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)
	{
		try
		{
			if(this.objBrowserInfo.IsIE)
				return oElement.canHaveChildren;
			else if(this.objBrowserInfo.IsMozila)
			{
				switch(oElement.tagName.toLowerCase())
				{
					///-- All listed tags do not contain child in them. 
					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;
			}	
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	
		/// <memberMethod name="cJavaScriptFramework_fnSetActiveElement">
		/// <summary>
		/// This function set Active Element based on event(onfocus).In mozilla defination of Active elements is elements which are visible and has focus capability and elements which has tabindex property specified.So user has to take care of verify focused element which is return by this function.
		/// </summary>
		///	<param name="oEvent">Event Object</param>
		/// </memberMethod>
		function cJavaScriptFramework_fnSetActiveElement(oEvent)
		{
			try
			{
				if(typeof oEvent.target.tagName != 'undefined')
					oElementWhichHasFocus = oEvent.target;
				else
				{
					var oTempElement = document.getElementsByTagName('body')[0];
					if(oTempElement != null)
						oElementWhichHasFocus = oTempElement;
					else
						oElementWhichHasFocus = null;
				}
			}
			catch(oException)
			{
				oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
			}
		}
		
	//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
		{
			
			if(oElement1==oElement2 || oElement1.tagName != oElement2.tagName || oJSFW.fnIsChild(oElement1,oElement2) || oJSFW.fnIsChild(oElement2,oElement1))
			{
				oJSFW.fnThrowACTLException('Swap not possible for these elements',oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)));
			}
			else
			{
				//Storing the parent element of the function
				oParentNode1 = oElement1.parentNode;
				oParentNode2 = oElement2.parentNode;
				oCloneElement1 = oElement1;
				oCloneElement2 = oElement2;
				for(nCounter=0;nCounter<oParentNode1.childNodes.length;nCounter++)
				{
					if(oParentNode1.childNodes[nCounter].nodeType==1)
					{
						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==1)
					{
						if(oElement2 == oParentNode2.childNodes[nCounter])
						{
							nIndexElement2 = nCounter;
							if(nIndexElement2 == oParentNode2.childNodes.length -1)
							{
								blnLastIndexElement2 = true;
							}
						}
					}
				}
				
				var totChildlength1 = oParentNode1.childNodes.length-1;
				var totChildlength2 = oParentNode2.childNodes.length-1;
				//Remove element after cloning
				 this.fnRemoveChild(oElement1);
				
				//Remove element after cloning
				 this.fnRemoveChild(oElement2);
			
				if(nIndexElement1 > nIndexElement2)
				{
				
					if(blnLastIndexElement2==true || !this.fnHasChildren(oParentNode2))
						this.fnAppendChild(oParentNode2,oCloneElement1);
					else
					{
						if(oParentNode1 == oParentNode2)
						{
							if(nIndexElement2 ==totChildlength2-1	)
								this.fnAppendChild(oParentNode2,oCloneElement1);
							else
								this.fnInsertBefore(oCloneElement1,oParentNode2.childNodes[nIndexElement2]);
						}
						else
							this.fnInsertBefore(oCloneElement1,oParentNode2.childNodes[nIndexElement2]);
					}
					
					if(blnLastIndexElement1==true || !this.fnHasChildren(oParentNode1))
						this.fnAppendChild(oParentNode1,oCloneElement2);	
					else
					{
						if(oParentNode1 == oParentNode2)
						{
							if(nIndexElement1==totChildlength2 )
								this.fnAppendChild(oParentNode2,oCloneElement1);
							else
								this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
						}
						else
							this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
					}
					
				}	
				else
				{
					if(blnLastIndexElement1==true || !this.fnHasChildren(oParentNode1))
						this.fnAppendChild(oParentNode1,oCloneElement2);	
					else
					{
						if(oParentNode1 == oParentNode2)
						{
							if(	nIndexElement1 == totChildlength1-1)
								this.fnAppendChild(oParentNode1,oCloneElement2);
							else
								this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
						}
						else
							this.fnInsertBefore(oCloneElement2,oParentNode1.childNodes[nIndexElement1]);
					}
						
					if(blnLastIndexElement2==true || !this.fnHasChildren(oParentNode2))
						this.fnAppendChild(oParentNode2,oCloneElement1);
					else
					{
						if(oParentNode1 == oParentNode2)
						{
							if(nIndexElement2 == totChildlength2 )
								this.fnAppendChild(oParentNode2,oCloneElement1);
							else
								this.fnInsertBefore(oCloneElement1,oParentNode2.childNodes[nIndexElement2]);
						}
						else
							this.fnInsertBefore(oCloneElement1,oParentNode1.childNodes[nIndexElement2]);
					}
									
					
					
				}
			
			}
			
			
		}
		catch(ex)
		{
			oJSFW.fnThrowACTLException(ex.message,oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)),ex);
		}
	}

	/// <memberMethod name="fnHasChildren">
	/// <summary>
	/// This function is used to find whether the node has any children of nodetype==1
	/// </summary>
	///	<param name="oParentNode">Element Object which has to be checked</param>
	/// </memberMethod>
	function cJavaScriptFramework_fnHasChildren(oParentNode)
	{
		var nCounter;
		var blnflag = false;
		if(this.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==1)
					{
						blnflag = true;
					}
				}
			}
			
			
			return blnflag;
		}
		
	}



	/// <memberMethod name="fnSetInnerText">
	///	<param name="oSrcElement">Subject element</param>
	///	<param name="strText">Text to be set</param>
	/// <summary>Set the innerText of passed element.</summary>
	/// </memberMethod>
	function cJavaScriptFramework_fnSetInnerText(oSrcElement,strText)
	{
		if( this.objBrowserInfo.IsIE )
		{
			oSrcElement.innerText = strText;
			
		}
		else //if( this.objBrowserInfo.IsIE ) 
		{
			oSrcElement.textContent = strText;
		}
	}


	//End of function by Meghna
	
	//Start of function by Kavita
	/// <memberMethod name="fnValidateDate">
	///	<param name="strDate">Date in Text Format which is to be validated.</param>
	///	<param name="strDateFormat">The format of the date according to which the validations should be done.</param>
	///	<param name="strSeperator">The seperators which should be counted legal while checking the date format.</param>
	/// <summary>This functions is always invoked from 'String.prototype.fnIsDate'.This function maily validates the string of date passed. </summary>
	/// </method>

	function cJavaScriptFramework_fnValidateDate (strDate,strDateFormat,strSeperator) 
	{     
		//code added by Kavita Starts
		var oRegExp = new RegExp("^[0-9]*$","gi");
		if(oRegExp.test(strSeperator))
		{
			return false;
		}

			var strDatestyle = "US"; //United States date style
		//var strDatestyle = "EU";  //European date style
		var strDate;
		var strDay;
		var strMonth;
		var strYear;

		var intday;
		var intMonth;
		var intYear;
		//		var blnFound = false;
		var intElementNr;
		var intErrStatus = 0;


		var strCorrectDate="";
		var i;

		var oArrDate;
		var oArrDateFormat = strDateFormat.split(strSeperator);
		var oArrMonth = oJSFW.fnObjectInitializer('Array','',[12]);
		//var oArrSeparators = oJSFW.fnObjectInitializer('Array','',["/","-"," ",".","=","*","!","^"]);

		for(i = 0 ; i < oArrDateFormat.length ; i++)
		{
				var strStringMonth;
				if (oArrDateFormat[i] == "%B" || oArrDateFormat[i] == "%b")
				{
					strStringMonth = oArrDateFormat[i];
				}//if month is in string format
		}

		if (strStringMonth == "%b")
		{
			oArrMonth[0] = "Jan";
			oArrMonth[1] = "Feb";
			oArrMonth[2] = "Mar";
			oArrMonth[3] = "Apr";
			oArrMonth[4] = "May";
			oArrMonth[5] = "Jun";
			oArrMonth[6] = "Jul";
			oArrMonth[7] = "Aug";
			oArrMonth[8] = "Sep";
			oArrMonth[9] = "Oct";
			oArrMonth[10] = "Nov";
			oArrMonth[11] = "Dec";
		}
		else if (strStringMonth == "%B")
		{
			oArrMonth[0] = "January";
			oArrMonth[1] = "February";
			oArrMonth[2] = "March";
			oArrMonth[3] = "April";
			oArrMonth[4] = "May";
			oArrMonth[5] = "June";
			oArrMonth[6] = "July";
			oArrMonth[7] = "August";
			oArrMonth[8] = "September";
			oArrMonth[9] = "October";
			oArrMonth[10] = "November";
			oArrMonth[11] = "December";
			
		}
		else
		{
			oArrMonth[0] = "01";
			oArrMonth[1] = "02";
			oArrMonth[2] = "03";
			oArrMonth[3] = "04";
			oArrMonth[4] = "05";
			oArrMonth[5] = "06";
			oArrMonth[6] = "07";
			oArrMonth[7] = "08";
			oArrMonth[8] = "09";
			oArrMonth[9] = "10";
			oArrMonth[10] = "11";
			oArrMonth[11] = "12";

		}

		//code added by Kavita Ends

			


		if (strDate.length < 1) 
		{     
			return true;
		}

		oArrDate = strDate.split(strSeperator);

		if (oArrDate.length != 3) 
		{     
			intErrStatus = 1;
			return false;
		}//this will be executed when the seperators are not from the listed array items
		else
		{    
			//Code added by Kavita start
			for(i = 0 ; i < oArrDateFormat.length ; i++)
			{
				if (oArrDateFormat[i] == "%d" || oArrDateFormat[i] == "%D")
				{
					strDay = oArrDate[i]; 
				}
				if (oArrDateFormat[i] == "%m" || oArrDateFormat[i] == "%M" || oArrDateFormat[i] == "%b" || oArrDateFormat[i] == "%B")
				{
					strMonth = oArrDate[i];
				}
				if (oArrDateFormat[i] == "%y" || oArrDateFormat[i] == "%Y")
				{
					strYear = oArrDate[i];
				}
			
			}   //this loop will generate valid format according to the given format.
				//Code added by Kavita	end					
		}

			
		if (strYear.length == 2) 
		{    
			strYear = '20' + strYear;
		}
		// US style
		if (strDatestyle == "US") 
		{   
			
			strTemp = strMonth;
			strDay = strDay;
			strMonth = strTemp;
		}

		intday = parseInt(strDay, 10);

		if (isNaN(intday)) 
		{     
			intErrStatus = 2;
			return false;
		}
		intMonth = parseInt(strMonth, 10);

		if (isNaN(intMonth))
		{     
			for (i = 0;i<12;i++) 
			{     
				if (strMonth.toUpperCase() == oArrMonth[i].toUpperCase())
				{     
					intMonth = i+1;
					strMonth = oArrMonth[i];
					i = 12;
				}
			}
			if (isNaN(intMonth)) 
			{     
				intErrStatus = 3;
				return false;
			}
		}

		intYear = parseInt(strYear, 10);

		if (isNaN(intYear))
		{     
			intErrStatus = 4;
			return false;
		}
		if (intMonth>12 || intMonth<1)
		{     
			intErrStatus = 5;
			return false;
		}
		if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1))
		{     
			intErrStatus = 6;
			return false;
		}
		if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) 
		{     
			intErrStatus = 7;
			return false;
		}
		if (intMonth == 2)
		{     
			if (intday < 1)
			{     
				intErrStatus = 8;
				return false;
			}
			if (intYear.fnLeapYear()== true) 
			{     
				if (intday > 29)
				{     
					intErrStatus = 9;
					return false;
				}
			}
			else 
			{     
				if (intday > 28) 
				{     
					intErrStatus = 10;
					return false;
				}
			}
		}

		if (strDatestyle == "US") 
		{     
		//added by Kavita starts
			
			for(i = 0 ; i < oArrDateFormat.length ; i++)
			{
				if (oArrDateFormat[i] == "%d" || oArrDateFormat[i] == "%D")
				{
					
						strCorrectDate = strCorrectDate + strSeperator  + intday;
					
				}
				if (oArrDateFormat[i] == "%y" || oArrDateFormat[i] == "%Y")
				{
				
					
						strCorrectDate =  strCorrectDate + strSeperator + strYear;
					
					
				}
				if (oArrDateFormat[i] == "%m" || oArrDateFormat[i] == "%M" || oArrDateFormat[i] == "%b" ||     			  oArrDateFormat[i] == "%B")
				{
					
						strCorrectDate =  strCorrectDate + strSeperator + oArrMonth[intMonth-1];
										
				}
				
			}
			strCorrectDate = strCorrectDate.substring(1,strCorrectDate.length);
		}

		return true;
	}
	
	//End of function by Kavita
	function cJavaScriptFramework_fnCopyFromClipBoard()
	{
	    var strClipboardData = '';
	    try
	    {
	         if (window.clipboardData)
             {
                // the IE-manier
                strClipboardData = window.clipboardData.getData('text');
             }
             else if (window.netscape)
             {
             
                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
                
                
                var clip  = Components.classes["@mozilla.org/widget/clipboard;1"].getService(Components.interfaces.nsIClipboard);
                if (!clip) return false;

                var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
                if (!trans) return false;
                trans.addDataFlavor("text/unicode");

                clip.getData(trans, clip.kGlobalClipboard);

                var str       = new Object();
                var strLength = new Object();

                trans.getTransferData("text/unicode", str, strLength);

                if (str) str       = str.value.QueryInterface(Components.interfaces.nsISupportsString);
                if (str) pastetext = str.data.substring(0, strLength.value / 2);

                strClipboardData = pastetext;

            }
	    }
	    catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return strClipboardData;
	}
	
	function cJavaScriptFramework_fnCopyToClipBoard(strText)
	{
	    try
	    {
	         if (window.clipboardData)
             {
                // the IE-manier
                window.clipboardData.setData("Text", strText);
             }
             else if (window.netscape)
             {

                    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');


                   var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
                   if (!clip) return;

                   var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
                   if (!trans) return;

                   trans.addDataFlavor('text/unicode');

                   var str = new Object();
                   var len = new Object();

                   var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);

                   var copytext=strText;

                   str.data=copytext;

                   trans.setTransferData("text/unicode",str,copytext.length*2);

                   var clipid=Components.interfaces.nsIClipboard;

                   if (!clip) return false;
                   clip.setData(trans,null,clipid.kGlobalClipboard);
            }
	    }
	    catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
    }

	///$$ FUNCTIONS TO BE REVIEWED ENDS HERE
}
var oJSFW = new cJavaScriptFramework();

/// <class name="cACTLError">
///	<param name="strDescription">Text explaining exceptional situation or causes for the error</param>
///	<summary>ACTL Exception class for user defined errors in JS. We differentiate cACTLError and cACTLException as, 1> cACTLError is light-weight class to encaptulate just error message. Whereas, cACTLException is class for Exception handling, it is having provision for innerException (base exception), code location, functions for stack trace etc. 2> cACTLError is to be used while throwing error from programmer's code. Whereas, cACTLException is to be thrown from "unexpected" catch block (Implementer must take care to throw only one Exception per function). For further information please read documentation.</summary>
/// </class>
function cACTLError(strDescription)
{
	///&& message : Text explaining exceptional situation or causes for the error
	this.message = strDescription;
	///&& description : Text explaining exceptional situation or causes for the error
	this.description = strDescription;
}

/// <class name="cACTLException">
///	<param name="strDescription">Text explaining exceptional situation or causes for the exception</param>
///	<param name="strOptionalClassAndMethodName">Typically Class (if applicable) and Method name where the exception is been catched</param>
///	<param name="oOptionalBaseException">Reference to the caught exception</param>
///	<summary>ACTL Exception class for user defined exception in JS. See also cACTLError description (or documentation).</summary>
/// </class>
function cACTLException(strDescription, strOptionalClassAndMethodName, oOptionalBaseException)
{
	///&& strCodeLocation: String representing location where the exception generated.
	this.strCodeLocation = strOptionalClassAndMethodName, 
	///&& message : Text explaining exceptional situation or causes for the exception
	this.message = strDescription;
	///&& description : Text explaining exceptional situation or causes for the exception
	this.description = strDescription;
	///&& oBaseException : Reference to the caught exception
	this.oBaseException = ((oOptionalBaseException==undefined)?null:oOptionalBaseException);
	
	///--Returns description and Location info for the exception object.
	this.fnGetErrorDetails = cACTLException_fnGetErrorDetails;
	///--Returns Location info for the cACTLException object and its oBaseException recursively.
	this.fnGetCallStack = cACTLException_fnGetCallStack;
	///--Returns detailed (Location info and message info) stack trace for the cACTLException object and its oBaseException recursively.
	this.fnGetDetailedStackTrace = cACTLException_fnGetDetailedStackTrace;
	
	/// <memberMethod name="fnGetErrorDetails">
	///	<param name="strLocationDescriptionSeparator">Separator between Location info and Description info.</param>
	/// <summary>Returns description and Location info for the exception object.</summary>
	/// </memberMethod>
	function cACTLException_fnGetErrorDetails(strLocationDescriptionSeparator)
	{
		try
		{
			if(strLocationDescriptionSeparator == undefined || strLocationDescriptionSeparator==null)
				strLocationDescriptionSeparator = "\n";
			return "Location : " + this.strCodeLocation + strLocationDescriptionSeparator + "Message : " + this.description;
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}

	/// <memberMethod name="fnGetCallStack">
	///	<param name="strOptionalSeparator">Separator between two Location info.</param>
	/// <summary>Returns Location info for the cACTLException object and its oBaseException recursively.</summary>
	/// </memberMethod>
	function cACTLException_fnGetCallStack(strOptionalSeparator)
	{
		var strReturnString = "";
		var strSeparator = (strOptionalSeparator==undefined)? "\n" : strOptionalSeparator;
		strReturnString = this.strCodeLocation;
		
		try
		{
			if(this.oBaseException!=null && oJSFW.fnGetTypeName(this.oBaseException).toLowerCase()=='cactlexception')
				strReturnString = strReturnString + strSeparator + this.oBaseException.fnGetCallStack();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return strReturnString;
	}

	/// <memberMethod name="fnGetDetailedStackTrace">
	///	<param name="strOptionalDescriptionLocationSeparator">Separator between Location info and Description info.</param>
	///	<param name="strOptionalCallSeparator">Separator between two call info.</param>
	/// <summary>Returns detailed (Location info and message info) stack trace for the cACTLException object and its oBaseException recursively.</summary>
	/// </memberMethod>
	function cACTLException_fnGetDetailedStackTrace(strOptionalDescriptionLocationSeparator, strOptionalCallSeparator)
	{
		try
		{
			var strReturnString = "";
			var strOptionalDescriptionLocationSeparator = (strOptionalDescriptionLocationSeparator==undefined)?"\n" : strOptionalDescriptionLocationSeparator;
			var strOptionalCallSeparator = (strOptionalCallSeparator==undefined)?"\n\n" : strOptionalCallSeparator;
			
			//strReturnString = "Location : " + this.strCodeLocation;
			//strReturnString += strOptionalDescriptionLocationSeparator + "Message : " + this.message;
			strReturnString = this.fnGetErrorDetails(strOptionalDescriptionLocationSeparator);
			
			if(this.oBaseException!=null && oJSFW.fnGetTypeName(this.oBaseException).toLowerCase()=='cactlexception')
				strReturnString = strReturnString + strOptionalCallSeparator + this.oBaseException.fnGetDetailedStackTrace();
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return strReturnString;
	}
	

}

///State Maintainence code added



/// <class name="cIEStateMaintainer">
///	<summary>This class is used to maintain the state to listed elements.</summary>
/// </class>
function cIEStateMaintainer()
{
	///-- Contains information of Element type,Attribute Name and Attribute Value.
	var oArrProblematicElementType = ["input@type@radio","input@type@checkbox"];
	///-- Contains information of Element's attribute whose value is going to be stored.
	var oArrProblematicElementAttr = ["checked","checked,onclick"];
	
	///-- Contains the references the element whose state is to be maintained.
	var oArrProblematicElement = oJSFW.fnObjectInitializer('Array','',[]);
	//var oArrProblematicElement = Array();
	///-- Contains the referenced element's original value.
	var oArrProblematicElementValue =  oJSFW.fnObjectInitializer('Array','',[]);
	//var oArrProblematicElementValue =  Array();
	
	this.fnStoreState = cIEStateMaintainer_fnStoreState;
	this.fnRestoreState = cIEStateMaintainer_fnRestoreState;
	this.fnClear = cIEStateMaintainer_fnClear;
	this.fnCopyState = cIEStateMaintainer_fnCopyState;
	this.fnGetProblematicAttributes = cIEStateMaintainer_fnGetProblematicAttributes;
	this.fnGetTagType = cIEStateMaintainer_fnGetTagType;
	this.fnGetAttr = cIEStateMaintainer_fnGetAttr;
	this.fnGetAttrValue = cIEStateMaintainer_fnGetAttrValue;

	/// <memberMethod name="fnStoreState">
	/// <summary>
	/// This function store all the critical elements value and reference.
	/// </summary>
	///	<param name="oParentElement">Element itself or Parent Element</param>
	/// </memberMethod>
	function cIEStateMaintainer_fnStoreState(oParentElement)
	{
		var oArrAllElements ;
		var intCounter;
		var intInnerCounter;
		var intRealCounter=0;
		var intAttrCounter=0;
		var strTag;
		var strAttr;
		var strAttrValue;
		var oArrElementAttr;
		if(oParentElement)
		{
			//oArrAllElements = oParentElement.getElementsByTagName('*');
			oArrAllElements = oJSFW.fnGetElementsByTagName('*',oParentElement);
			
			for(intCounter = 0 ;intCounter < oArrProblematicElementType.length; intCounter++)
			{
				///-- Spliting the information of Array.
				strTag = this.fnGetTagType(oArrProblematicElementType[intCounter]);
				strAttr = this.fnGetAttr(oArrProblematicElementType[intCounter]);
				strAttrValue = this.fnGetAttrValue(oArrProblematicElementType[intCounter]);
				
				if(oArrAllElements.length != 0)
				{
					///-- Executed when parent has many children to be examined.
					for(intInnerCounter = 0 ;intInnerCounter < oArrAllElements.length ; intInnerCounter++)
					{
						if(strTag == oArrAllElements[intInnerCounter].tagName.toLowerCase())
						{
							if(strAttrValue == oJSFW.fnGetAttribute(oArrAllElements[intInnerCounter],strAttr).toLowerCase())
							{
								oArrProblematicElement[intRealCounter] = oArrAllElements[intInnerCounter];
								
								oArrElementAttr = oArrProblematicElementAttr[intCounter].split(',');
								oArrProblematicElementValue[intRealCounter] = oJSFW.fnObjectInitializer('Array','',[]);
								for(intAttrCounter = 0; intAttrCounter < oArrElementAttr.length ; intAttrCounter++)
									oArrProblematicElementValue[intRealCounter][intAttrCounter] = String(oJSFW.fnGetAttribute(oArrAllElements[intInnerCounter],oArrElementAttr[intAttrCounter])).toLowerCase();
								intRealCounter++;
							}
						}
					}
				}
				else
				{
					///-- Executed when direct parent has to be examined.
					if(strTag == oParentElement.tagName.toLowerCase())
					{
						if(strAttrValue == oJSFW.fnGetAttribute(oParentElement,strAttr).toLowerCase())
						{
							oArrProblematicElement[intRealCounter] = oParentElement;
							
							oArrElementAttr = oArrProblematicElementAttr[intCounter].split(',');
							oArrProblematicElementValue[intRealCounter] = oJSFW.fnObjectInitializer('Array','',[]);
							
							for(intAttrCounter = 0; intAttrCounter < oArrElementAttr.length ; intAttrCounter++)
								oArrProblematicElementValue[intRealCounter][intAttrCounter] = String(oJSFW.fnGetAttribute(oParentElement,oArrElementAttr[intAttrCounter])).toLowerCase();
							intRealCounter++;
						}
					}
				}
			}
		}
	}
	
	
	/// <memberMethod name="fnRestoreState">
	/// <summary>
	/// This function restores the referenced element to its original value.
	/// </summary>
	/// </memberMethod>
	function cIEStateMaintainer_fnRestoreState()
	{
		var intCounter;
		var intAttrCounter=0;
		var intAttrMainCounter = 0;
		var oArrElementAttr = oJSFW.fnObjectInitializer('Array','',[]);
		var strTag = "";
		var strAttr="";
		var strAttrValue="";
		
		for(intCounter =0 ; intCounter < oArrProblematicElement.length ; intCounter++)
		{
			for(intAttrMainCounter = 0; intAttrMainCounter< oArrProblematicElementAttr.length;intAttrMainCounter++)
			{
			
				strTag = this.fnGetTagType(oArrProblematicElementType[intAttrMainCounter]);
				strAttr = this.fnGetAttr(oArrProblematicElementType[intAttrMainCounter]);
				strAttrValue = this.fnGetAttrValue(oArrProblematicElementType[intAttrMainCounter]);
				
				if(strTag == oArrProblematicElement[intCounter].tagName.toLowerCase())
				{
					if(strAttrValue == oJSFW.fnGetAttribute(oArrProblematicElement[intCounter],strAttr).toLowerCase())
					{
						oArrElementAttr = oArrProblematicElementAttr[intAttrMainCounter].split(',');
						for(intAttrCounter = 0 ; intAttrCounter < oArrElementAttr.length ; intAttrCounter++)
							oJSFW.fnSetAttribute(oArrProblematicElement[intCounter],oArrElementAttr[intAttrCounter],eval(oArrProblematicElementValue[intCounter][intAttrCounter]));
					}
				}
			}
		}
	}
	
	/// <memberMethod name="fnGetTagType">
	/// <summary>
	/// This function returns the tag information of Element.
	/// </summary>
	///	<param name="oItem">Content to be separated</param>
	/// </memberMethod>
	function cIEStateMaintainer_fnGetTagType(oItem)
	{
		return oItem.slice(0,oItem.indexOf('@'));
	}
	
	/// <memberMethod name="fnGetAttr">
	/// <summary>
	/// This function returns the Attribute information for which element is to be tested.
	/// </summary>
	///	<param name="oItem">Content to be separated</param>
	/// </memberMethod>
	function cIEStateMaintainer_fnGetAttr(oItem)
	{
		return oItem.slice(oItem.indexOf('@')+1,oItem.lastIndexOf('@'));
	}
	
	
	/// <memberMethod name="fnGetAttrValue">
	/// <summary>
	/// This function returns the Attribute value information for which element is to be tested.
	/// </summary>
	///	<param name="oItem">Content to be separated</param>
	/// </memberMethod>
	function cIEStateMaintainer_fnGetAttrValue(oItem)
	{
		return oItem.slice(oItem.lastIndexOf('@') + 1 ,oItem.length);
	}
	
	
	/// <memberMethod name="fnGetAttrValue">
	/// <summary>
	/// This function clears the information maintained by the object.
	/// </summary>
	/// </memberMethod>
	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*/
	
	/// <memberMethod name="fnCopyState">
	///	<param name="oSrcNode">Reference to root node of source tree whose attributes are to be copied</param>
	///	<param name="oDestNode">Reference to root node of destination tree to which attributes are to be pasted</param>
	/// <summary>This function will copy values of problematic attributes from source tree to desitantion tree.</summary>
	/// </memberMethod>	
	function cIEStateMaintainer_fnCopyState(oSrcNode, oDestNode)
	{
		var strProbProperties;
		var oArrayOfProblematicProperties;
		
		try
		{
			strProbProperties = this.fnGetProblematicAttributes(oSrcNode);
			if(strProbProperties!="")
			{
				oArrayOfProblematicProperties = strProbProperties.split(",");
				for(var a=0;a<oArrayOfProblematicProperties.length;a++)
				{
					oJSFW.fnSetAttribute(oDestNode, oArrayOfProblematicProperties[a], eval("oSrcNode." + oArrayOfProblematicProperties[a]));
				}
			}
			for(a=0;a<oSrcNode.childNodes.length;a++)
			{
				if(oSrcNode.childNodes[a].nodeType==1)
				this.fnCopyState(oSrcNode.childNodes[a], oDestNode.childNodes[a]);
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
	}
	/// <memberMethod name="fnGetProblematicAttributes">
	///	<param name="oSrcNode">Reference node</param>
	/// <summary>This function will return comma seperated problematic attributes according to value populated in oArrProblematicElementType.</summary>
	/// </memberMethod>	
	function cIEStateMaintainer_fnGetProblematicAttributes(oSrcNode)
	{
		var strTag, strType, /*strTagNType,*/ strAttribute;
		var strTempAttribute;
		var strProbAttribute;

		try
		{
			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);
				strTag = this.fnGetTagType(oArrProblematicElementType[a]);
				//strTempAttribute = oSrcNode.getAttribute("type");
				strTempAttribute = this.fnGetAttr(oArrProblematicElementType[a]);
				strTempAttribute = oJSFW.fnGetAttribute(oSrcNode,strTempAttribute);
				strType = this.fnGetAttrValue(oArrProblematicElementType[a]);
				
				
				
				if((strTag.toLowerCase()==oSrcNode.tagName.toLowerCase()) &&
				((strTag.toLowerCase()=='input')?(strType.toLowerCase()==strTempAttribute.toLowerCase()):true))
					return strProbAttribute;
				  
			}
		}
		catch(oException)
		{
			oJSFW.fnThrowACTLException(oException.message, oJSFW.fnGetTypeNameFromFunctionCode(String(arguments.callee)), oException);
		}
		return "";
	}
	/*END OF functions added by Kinjal Desai*/
	
	
}

function cTextContainer()
{
    this.strText ; 
}  


///$$ Code added by Nidhi Vithlani on 09-07-2007 STARTS HERE

/// Enum ,which will/can have all the possible file types to be verified.
enumFileType = 
{	
	image : 'image',
	css : 'css',
	doc : 'doc',
	template :'template'
};

/// <method name="fnCheckValidFileType">
///	<param name="strFileType">One of the enum members to specify the file type.</param>
///	<param name="strFileName">The name or the path of the file.</param>
/// <summary>Method to help in verifying the valid file types.</summary>
/// </method>
function fnCheckValidFileType(strFileType, strFileName)
{
    var blnReturnFlag = false;
    var strExtension = strFileName.substring(strFileName.lastIndexOf(".") + 1, strFileName.length);
    strExtension = strExtension.fnTrim();
    if(strFileName != "")
    {
        switch(strFileType.toLowerCase())
        {
            case "image":
                switch(strExtension.toLowerCase())
                {
                    ///------Updated by Bindra parikh-------------
                    //removed gif,tif,tiff extensions
                    ///--------------------------------------------
                    case "gif":
                    case "png":
                    case "jpg":
                    case "jpeg":
                        blnReturnFlag = true;
                        break;
                    default:
                        blnReturnFlag = false;
                        break;
                }
                break;
            case "css":
                switch(strExtension.toLowerCase())
                {
                    case "css":
                        blnReturnFlag = true;
                        break;
                    default:
                        blnReturnFlag = false;
                        break;
                }
                break;
            case "doc":
                switch(strExtension.toLowerCase())
                {
                    case "exe":
                    case "bat":
                        blnReturnFlag = false;
                        break;
                    default:
                        blnReturnFlag = true;
                        break;
                }
                break;
            case "template":
                switch(strExtension.toLowerCase())
                {                    
                    case "html":
                    case "htm":
                    case "stm":
                    case "txt":                                              
                        blnReturnFlag = true;
                        break;
                    default:
                        blnReturnFlag = false;
                        break;
                }
                break;
            default:
                blnReturnFlag = false;
                break;
        }
    }
    return blnReturnFlag;
}

///$$ Code added by Nidhi Vithlani on 09-07-2007 ENDS HERE
