var __doc__;
var __frm__;
var strAlpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var strName = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '-";
var strNumeric = "0123456789";
var strSpecialChar = "@#$%-.\"'()+:[]_ <,";
var strInvalidChar = "=\"~";

/**************************************************************************
function 			: isQuotes(objForm, strLabel)
Input Parameter		: textbox object, label of the text box.
Output parameter	: true/false
Purpose				: To validate the text to check the entry of "double quotes"
**************************************************************************/
function isQuotes(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)
	
	var regObj = eval("/" + strSpecialChar.charAt(6) + "/")
	var regscriptObj = eval("/" + strSpecialChar.charAt(16) + "/")

	if (((regObj.test(strTextString)) || (regscriptObj.test(strTextString))) && (arguments.length != 1))
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;
	}
	return true;
}

/**************************************************************************
function 			: isScript(objForm, strLabel)
Input Parameter		: textbox object, label of the text box.
Output parameter	: true/false
Purpose				: To validate the text to check the entry of "script braces"
**************************************************************************/
function isScript(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)
	
	var regscriptObj = eval("/" + strSpecialChar.charAt(16) + "/")

	if (((regscriptObj.test(strTextString))) && (arguments.length != 1))
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;
	}
	return true;
}

/*************************************************************************
function			: setFocus(formObj)
Input Parameter		: object, optional error message
Output parameter	: None
Purpose				: Sets the focus and shows an error message if applicable
Remark				:
**************************************************************************/

function setFocus(objFormX, strErrMessageX)
{
	objFormX.select();
	objFormX.focus();
	if (arguments.length != 1)
		//alert(strErrMessageX);

	return;
}

/*************************************************************************
function 			:	isEmail(objForm, strLabel)
Input Parameter		:	1. ObjForm - Element object
						2. strLabel - Text appearing in the alert message
Output parameter	:	true/false
Purpose				:	This function checks whether characters entered in text box
							is valid email address's part before '@' sign.
*************************************************************************/
function isEmail(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	bRet = true;
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)
	
	if (strTextString.length > 4) 
	  {
		strInfo = strTextString.substring(strTextString.length-4);
		if (strInfo.toUpperCase() == 'INFO' || strInfo.toUpperCase() == 'AERO') //Modified by kartik for 9461 on 13-Apr-09, Added AERO domain check
		{
			strTextString = strTextString.substring(0,strTextString.length-1);
		}
	 }

	if(strTextString.length < 80)
	{
		var objReg1 = eval("/[\\s]|(" + strSpecialChar.charAt(0) + strSpecialChar.charAt(5) + "*" + strSpecialChar.charAt(0) + ")|(\\" +  strSpecialChar.charAt(5) + "\\" +  
		strSpecialChar.charAt(5) + ")|(" + strSpecialChar.charAt(0) + "\\" + strSpecialChar.charAt(5) + ")|(\\" + strSpecialChar.charAt(5) + strSpecialChar.charAt(0) + ")|(^\\" + strSpecialChar.charAt(5) + ")/")
		var objReg2 = eval("/^" + strSpecialChar.charAt(5) + "+\\" + strSpecialChar.charAt(0) + "(\\" + strSpecialChar.charAt(12) + "?)[" +  strAlpha + strNumeric + "\\" + strSpecialChar.charAt(4) + "\\" + strSpecialChar.charAt(5) + "]+\\" + strSpecialChar.charAt(5) + "([" + strAlpha + "]{" +  strNumeric.charAt(2) + "," + strNumeric.charAt(3) + "}|[" + strNumeric + "]{" + strNumeric.charAt(1) + "," + strNumeric.charAt(3) + "})(\\" + strSpecialChar.charAt(13) + "?)$/")
		var objReg3 = eval("/["+ strAlpha + strNumeric + "\\" + strSpecialChar.charAt(5)+ "\\" + strSpecialChar.charAt(4) + strSpecialChar.charAt(14) +"]/")
		if (!objReg1.test(strTextString) && objReg2.test(strTextString))
		{
			var arrTemp = strTextString.split('@')
			for (var i=0; i < arrTemp[0].length; i++)
			{
				strTestChar = arrTemp[0].charAt(i);
				/*if(strTestChar == "'")
				{
					hideDiv(objErrorDivId);
					showDiv(objDivPageError);
					$(objErrorMessageDivId).innerHTML=strInnerHTML;
					showDiv(objErrorMessageDivId);
					showDiv(objErrorDivId);
					return false;			
					break;
				}*/
				
				if (!objReg3.test(strTestChar))
				{
					bRet = false;
					break;
				}
			}
			bRet = true;
		}
		else
			bRet = false;
	}	
	else
	{bRet = false;}	
	if (!bRet)
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;			
	}
	
	return bRet;
}

/*************************************************************************
function 			:	isAlphaNumeric(objForm, strLabel)
Input Parameter		:	1. ObjForm - Element object
						2. strLabel - Text appearing in the alert message
Output parameter	:	true/false
Purpose				:	This function checks whether characters entered in text box
							is alphanumeric or not.
*************************************************************************/
function isAlphaNumeric(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
	{
		strTextString =  new String(objForm)
	}
	var objReg1 = eval("/["+ strAlpha +"]/");
	var objReg2 = eval("/["+ strNumeric +"]/");
	if (!(objReg1.test(strTextString) && objReg2.test(strTextString)))
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;	
	}
	
	return true;
	
}


function isTelePhone(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	bRet = true;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	

	if (typeof objForm == 'object')
	{
		//objForm.value = trimtxt(objForm.value)
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)

	if (strTextString.length == 0)
		bRet = false;

	if (bRet)
	{
		var regObj = eval("/[^" + strNumeric + "\\s" + strSpecialChar.charAt(8) + "\\" + 
		strSpecialChar.charAt(9) + "\\" + strSpecialChar.charAt(10) + "\\" + strSpecialChar.charAt(4) + "\\,]/g")

		var regObjSpace = eval("/" + strSpecialChar.charAt(17) + "/")

		for (var i=0; i < strTextString.length; i++)
		{
			strTestChar = strTextString.charAt(i);

			if ((regObj.test(strTestChar)) || (regObjSpace.test(strTestChar)))
			{
				bRet = false;
				break;
			}
		}
	}

	if (!bRet)
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;
	}
	return bRet;
	
}
function isAlphaName(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	bRet = true;
	var strInnerHTML;
	var strFirstPart,strSecondPart;
		
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)

	if (strTextString.length == 0)
		bRet = false;
	else
	{	
		var regObj = eval("/[^" + strName + "]/")
		if (regObj.test(strTextString))
		{
			hideDiv(objErrorDivId);
			showDiv(objDivPageError);
			$(objErrorMessageDivId).innerHTML=strInnerHTML;
			showDiv(objErrorMessageDivId);
			showDiv(objErrorDivId);
			return false;
			
		}					
	}

	//if (!bRet)
		//setFocus(objForm, strLabel + " can contain only alphabets , space, hyphen and single quote.");
	//return bRet
return true;
}
/***********************************************************************
function 9		:	isBlank(formObj)
return value	:	true - text box is blank (contant zero length value or
					contents white spaces.
					false - if text box value is not zero length value or
					is non white space value
Purpose			:	To check if text box is left blank or has only white spaces.
Remark			:	Function will return false if value contains leading and trailing
					space.
***********************************************************************/
function isBlank(objForm, objErrorDivId, objErrorMessageDivId, strErrorMessage, objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value;
		
		strTextString = trim(strTextString);
		objForm.value = strTextString;
		
		/*
		//Ltrim spaces.
		while (strTextString.substring(0,1) == ' ')
		{
			strTextString = strTextString.substring(1, strTextString.length);
		}
		//Rtrim spaces.
		while (strTextString.substring(strTextString.length-1, strTextString.length) == ' ')
		{
			strTextString = strTextString.substring(0,strTextString.length-1);
		}
		*/
		
		iValLength = strTextString.length;
	}
	else
	{
		strTextString =  new String(objForm);
	}	
	
	if ((arguments.length != 1) && (iValLength == 0))
	{
		objForm.value='';
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorDivId);
		showDiv(objErrorMessageDivId);
		return true;
	}
	return false;
}

//Function For Verifying the IP Address.
function verifyIP(IPvalue) 
{
		errorString = "";
		theName = "FTP Server IP";
		var ipPattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
		var ipArray = IPvalue.match(ipPattern); 
		
		if (IPvalue == "0.0.0.0")
			errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
		else if (IPvalue == "255.255.255.255")
			errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
		if (ipArray == null)
			errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
		else {
		for (i = 0; i <= 4; i++) {
			thisSegment = ipArray[i];
			if (thisSegment > 255 || thisSegment < 0) {
				errorString = errorString + theName + ': '+IPvalue+' is not a valid IP address.';
				i = 4;
			}
			if ((i == 0) && (thisSegment > 255)) {
				errorString = errorString + theName + ': '+IPvalue+' is a special IP address and cannot be used here.';
				i = 4;
			}
		}
	}
		extensionLength = 3;
		if (errorString == "")
			return true;
		else{
			//alert (errorString);
			$().txtFTPAddress.select();
			return false;
	}
	
}
	
function makeDivInvisible()
{
	var aLyrs = document.getElementsByTagName("DIV")
	//Changed for Temp Safari problem.Issue no:4026
	if ((typeof aLyrs == 'object') || (aLyrs == '[object NodeList]'))
	{
		for (var i=0; i<aLyrs.length; i++)
		{
			if (aLyrs[i].id.substring(0,10)== 'DivValidat')
			{
				document.getElementsByTagName("DIV").item(i).style.display ='none';
				document.getElementsByTagName("DIV").item(i).style.visibility ='hidden';
			} 
		}
	}
}	
	
function checkPasswordLength(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value
	}
	else
		strTextString =  new String(objForm)
	if (objForm.value.length<4)
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;
	}
	return true;
}
	 
 
function hideElement(strTagName,ObjId,intStrTagNameLength)
{
	var aLyrs = document.getElementsByTagName("DIV")
	for (var i=0; i<aLyrs.length; i++)
	{
		if (aLyrs[i].id.substring(0,intStrTagNameLength)==strTagName )
		{
			if(aLyrs[i].id!=ObjId)
			{	
				document.getElementsByTagName("DIV").item(i).style.display ='none';
				document.getElementsByTagName("DIV").item(i).style.visibility ='hidden';
			}
			else
			{
				document.getElementsByTagName("DIV").item(i).style.display ='block';
				document.getElementsByTagName("DIV").item(i).style.visibility ='visible';
			}
		} 
	}
}

function confirmPasswordCheck(ObjIdPassword,ObjIdVerifyPassword,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (ObjIdPassword.value!= ObjIdVerifyPassword.value)
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorMessageDivId);
		showDiv(objErrorDivId);
		return false;
	}
	return true;
}
function validateDropdowns(ObjDropdownId,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	
	strFirstPart=returnStringParts(strInnerHTML,1);
	
	strSecondPart=returnStringParts(strInnerHTML,2);
	
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	var dropDownSelectedIndex = ObjDropdownId.options[ObjDropdownId.selectedIndex].value;
	
	if (dropDownSelectedIndex==-1)
	{
		hideDiv(objErrorDivId);
		
		showDiv(objDivPageError);
		
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		
		showDiv(objErrorMessageDivId);
		
		showDiv(objErrorDivId);
		
		return false;
	}
	
}
		
function returnMessage(strErrorMsgId)
{
	for (i = 0; i < errorMessages.length ; i++)
	{
		if(errorMessages[i][0]==strErrorMsgId)
		{
			return errorMessages[i][1];
		}
	}
}

function InitializeControlId()
{
	var strfunctionptr;
	var intcounter =0;
	for (intcounter = 0; intcounter < controlList.length ; intcounter++)
	{
 		strControlName = controlList[intcounter][0];
		try
		{ 
			strfunctionptr =	eval(strControlName + '_InitializeControlId'); 
			strfunctionptr();
		 
 		}
			catch(ex)
			{
			}
	}
	isNonLoggedInCartProcess();
	reminderLayerValidation();
	AutoViewAssetPreview();
	loadPreviewLayerBorders();
	SetSearchOptionValue();
	ResetAdvanceControls('True');
	//Added for Issue 7833
	callResumeDownloadPopup();
}

function reminderLayerValidation()
{
	try
	{
		// Used for Softlogin
		var strTNMEditAC = getCookie('TNMEditAC');
		if (strTNMEditAC == 'Y')
		{
			setCookie('TNMEditAC','N', 365,'/');
			var strDisplayLogin = "";
			strDisplayLogin = getCookie('TNMDisplayUserLogin');
			if (strDisplayLogin)
			{
				if (strDisplayLogin == 'null')
				{
					delCookie('TNMDisplayUserLogin','/');
					delCookie('TNMDisplayUserName','/');
					delCookie('TNMDisplayUserid','/');				
					delCookie('TNMEditAC','/');
					delCookie('TNMReminderMsg','/');					
				}
				else
				{
					var objtxtLogin = $(returnControlId('MastHeadHome_ascx') + '_' + 'txtLogin');
					objtxtLogin.value = strDisplayLogin;
					$(returnControlId('MastHeadHome_ascx') + '_' + 'txtPasswordText').focus();
				}
			}
		}
		else
		{
			var strDisplayName = getCookie('TNMDisplayUserName');
			var strDisplayLogin = getCookie('TNMDisplayUserLogin');
			var strDisplayid = getCookie('TNMDisplayUserid');
			var strEditAC = getCookie('TNMEditAC');
			if (strDisplayName)
			{
				if (strEditAC == 'X')
				{
					delCookie('TNMDisplayUserLogin','/');
					delCookie('TNMDisplayUserName','/');
					delCookie('TNMDisplayUserid','/');				
					delCookie('TNMEditAC','/');				
				}
				else
				{
					setCookie('TNMLogin',strDisplayLogin, 365,'/');
					setCookie('TNMUserName',strDisplayName, 365,'/');
					setCookie('TNMUserId',strDisplayid, 365,'/');
					delCookie('TNMDisplayUserLogin','/');
					delCookie('TNMDisplayUserName','/');
					delCookie('TNMDisplayUserid','/');				
					delCookie('TNMEditAC','/');
					var objtxtLogin = $(returnControlId('MastHeadHome_ascx') + '_' + 'txtLogin');
					objtxtLogin.value = strDisplayLogin;
					$(returnControlId('MastHeadHome_ascx') + '_' + 'txtPassword').focus();
				}
			}
			else
			{
				var strUserName = getCookie('TNMUserName');
				if (strUserName)
				{
					delCookie('TNMEditAC','/');
				}
				else
				{					
					$(returnControlId('MastHeadHome_ascx') + '_' + 'chkRemeber').focus();
					delCookie('TNMEditAC','/');
				}
			}
		}
		//
		var strRemMsg = '';
		strRemMsg = getCookie('TNMReminderMsg');
		//SetSessionTimeOut();
		if(strRemMsg)
		{
			setCookie('TNMReminderMsg','', 365,'/');
			delCookie('TNMReminderMsg','/');
			var objMastHead = returnControlId('MastHeadHome_ascx');
			var objbtnlogin = $(objMastHead + '_txtLogin');
			if (objbtnlogin)
			{
				expandPassRemWithCustomMessage(strRemMsg,'Y');
			}
		}
	}
	catch(ex)
	{
	}
}

function SetSessionTimeOut()
{
	setTimeout("SetsessionOut()",1000*60*60*2);
}

function returnControlId(strControlName)
{
	for (i = 0; i < controlList.length ; i++)
	{
		 
		if(controlList[i][0]==strControlName)
		{
		
			return controlList[i][1];
		}
	}
}
			
function returnStringParts(str,flag)
{
	var intSIndex,intEIndex;
	var strFirstPart,strSecondPart;
	str=str.toUpperCase();
	if(flag==1) 
	{
		intSIndex=str.indexOf("<EMESSAGE>");
		strFirstPart=str.substring(0,intSIndex+10);
		return strFirstPart;
	}
	if(flag==2)
	{
		intEIndex=str.indexOf("</EMESSAGE>");
		strSecondPart=str.substring(intEIndex,str.length);
		return strSecondPart;
	}
}

function checkLength(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,maxLength,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	var iLength=maxLength;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	if (objForm.value != "")
	{
		if(objForm.value.length > iLength)
		{
			hideDiv(objErrorDivId);
			showDiv(objDivPageError);
			$(objErrorMessageDivId).innerHTML=strInnerHTML;
			showDiv(objErrorMessageDivId);
			showDiv(objErrorDivId);
			objForm.focus();
			return false;
		}
	}
	return true;
}

function hideDiv(objDivName)
{ 
	$(objDivName).style.visibility  ='hidden';
	$(objDivName).style.display='none';
}
function showDiv(objDivName)
{
	$(objDivName).style.display='block';
	$(objDivName).style.visibility  ='visible';
}
function returnComboValue(objId)
	{
		try
		{
			var objForm = $();
			
			var ctrlClientid=$("hidContactProfileCtrl").value;
			
			var comboObj=eval("objForm." + ctrlClientid + "_" + objId);
			
			var dropDownSelectedIndex =comboObj.options[comboObj.selectedIndex].value;
			
			return dropDownSelectedIndex;
			
		}
		catch (ex)
		{
		}
		
	}
	
function validatePlugins(ObjDropdownId,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	hideDiv(objErrorDivId);
	showDiv(objDivPageError);
	$(objErrorMessageDivId).innerHTML=strInnerHTML;
	showDiv(objErrorMessageDivId);
	showDiv(objErrorDivId);
	return false;
	
}
  function CompareDates(objValidateDate,objValidateDateErrorMessage,objFutureDateErrorMessage)
  {
    var ToDay = $(strControlid + '_txtToDay').value;
	var ToMonth = $(strControlid + '_txtToMonth').value;
	var FromDay = $(strControlid + '_txtFromDay').value;	
	var FromMonth = $(strControlid + '_txtFromMonth').value
	var ToYear=$(strControlid +'_txtToYear').value;
	var FromYear=$(strControlid +'_txtFromYear').value;
	
	var e = ToMonth +"/"+ ToDay + "/" +  $(strControlid +'_txtToYear').value;
	var s =   FromMonth +"/"+ FromDay + "/" + $(strControlid +'_txtFromYear').value;
	
    var today=new Date;
    var FromDate=new Date;
	var ToDate=new Date;
	$().hidACLSearchClick.value =true;  
		
		if(e != '')
		{
			ToDate.setDate(ToDay);  
			ToDate.setMonth(ToMonth - 1); // January = 0  
			ToDate.setFullYear(ToYear);
			if (ToDate > today)
			{		
				DisplayMsgForAdvSearch(objValidateDate,objValidateDateErrorMessage,'90003');
				return false;
			}
         }
         if(s != '')
		{
			FromDate.setDate(FromDay);  
			FromDate.setMonth(FromMonth - 1); // January = 0  
			FromDate.setFullYear(FromYear);
			if (FromDate > today)
			{
				DisplayMsgForAdvSearch(objValidateDate,objValidateDateErrorMessage,'90002');
				return false;
			}
		}
		
		if(s != '' && e != '')
		{
		 var sDate = new Date(s);
         var eDate = new Date(e);
			if (sDate >eDate)
			{				
				DisplayMsgForAdvSearch(objValidateDate,objValidateDateErrorMessage,'90001');
				return false;
			}
		}
		
		/*CurrentDate = new Date();
		var sDate = new Date(s);
        var eDate = new Date(e);
		if(s != '')
		{
			if(sDate > CurrentDate.getDate())
			{
				DisplayMsgForAdvSearch(objValidateDate,objValidateDateErrorMessage,'90002');
				return false;
			}
		}
		if(e != '')
		{
			if(eDate > CurrentDate.getDate())
			{
				DisplayMsgForAdvSearch(objValidateDate,objFutureDateErrorMessage,'90003');
				return false;
			}
		}
		if (sDate > eDate)
		{				
			DisplayMsgForAdvSearch(objValidateDate,objValidateDateErrorMessage,'90001');
			return false;
		}	*/
	
	
	SetAdvanceSearch('AdvancedSearch');
	
}
function DisplayMsgForAdvSearch(objValidateDate,objDateErrorMessage,strerrorMessage)
{
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	strInnerHTML=$(objDateErrorMessage).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strerrorMessage) + strSecondPart;
	hideDiv(objValidateDate);
	$(objDateErrorMessage).innerHTML=strInnerHTML;
	showDiv(objDateErrorMessage);
	showDiv(objValidateDate);
	blinkErrorImage();
}

function isEmailLengthCheckout(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
{
	
	var strInnerHTML;
	var strFirstPart,strSecondPart;
	var CCEmailLength=objForm.length;
	
	strInnerHTML=$(objErrorMessageDivId).innerHTML;
	strFirstPart=returnStringParts(strInnerHTML,1);
	strSecondPart=returnStringParts(strInnerHTML,2);
	strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	
	if (typeof objForm == 'object')
	{
		strTextString  = objForm.value;
		iValLength = strTextString.length;
	}
	else
	{
		strTextString =  new String(objForm);
	}	
		
	if ((arguments.length != 1) && (CCEmailLength > 80))
	{
		hideDiv(objErrorDivId);
		showDiv(objDivPageError);
		$(objErrorMessageDivId).innerHTML=strInnerHTML;
		showDiv(objErrorDivId);
		showDiv(objErrorMessageDivId);
		return true;
		
	}
	return false;
}
function blinkErrorImage()
{
	try{
	var errorArr = new Array()
	errorArr = document.getElementsByTagName("img")
	for (i=0; i<errorArr.length; i++)
	{
		if (errorArr[i].src.toUpperCase().indexOf("icon_error_Exclamation.gif".toUpperCase()) != -1 || errorArr[i].src.toUpperCase().indexOf("imgErrorBlink.gif".toUpperCase()) != -1 || errorArr[i].src.toUpperCase().indexOf("imgErrorIcon.gif".toUpperCase()) != -1)
		{
			if ( required2Blink(errorArr[i]) )
			{
				strSrc = strjsImagePath + "icon_error_Exclamation.gif?" + (((1+Math.random())*0x10000)|0).toString(16).substring(1)
				errorArr[i].src = strSrc
			}
		}
	}}
	catch(ex)
	{
		
	}
}

times = 0;

function required2Blink(obj)
{
	boolBlinkIt = false;
	exitLoop = false;
	strNodeType = "";

	while (!exitLoop)
	{
		obj = obj.parentNode;
		if (obj.nodeType == 1) //check that the node is a tag, not text (type=3)
		{
			strNodeType = trim( String(obj.nodeName).toUpperCase() );

			switch ( strNodeType )
			{
				case "DIV":
				{
					exitLoop = true;

					//check if display of DIV is block or none
					//check if visibility of DIV is visible or hidden
					strVisibility = String(obj.style.visibility).toUpperCase();
					strDisplay = String(obj.style.display).toUpperCase();
					
					//if display is undefined or visibility is undefined then it means that DIV is visible
					//if display is "" or visibility is "" then it means that DIV is visible
					if (strVisibility == "" || strVisibility == "VISIBLE" || strVisibility == "UNDEFINED")
					{
						if (strDisplay == "" || strDisplay == "BLOCK" || strDisplay == "UNDEFINED")
						{
							boolBlinkIt = true;
						}
					}
					
					break;
				}
				case "BODY":
				{
					exitLoop = true;
					boolBlinkIt = true;

					break;
				}
				case "HTML":
				{
					exitLoop = true;
					break;
				}

			}
		}
	}

	return boolBlinkIt;
	
}

function trim(obj)
{
	if (typeof obj == 'object')
		var strTemp  = obj.value;
	else
		var strTemp  = new String(obj);

	return strTemp.replace(/^\s+|\s+$/g,"");
}

function ltrim(obj)
{
	if (typeof obj == 'object')
		var strTemp  = obj.value;
	else
		var strTemp  = new String(obj);

	return strTemp.replace(/^\s+/,"");
}

function rtrim(obj)
{
	if (typeof obj == 'object')
		var strTemp  = obj.value;
	else
		var strTemp  = new String(obj);

	return strTemp.replace(/\s+$/,"");
}

function loadPreviewLayerBorders()
{
	try
	{
		$("imgtlp").src = strjsImagePath + "tlp.gif";
		$("imgtrp").src = strjsImagePath + "trp.gif";
		$("imgprb").src = strjsImagePath + "prb.gif";
		$("imgplb").src = strjsImagePath + "plb.gif";
	}
	catch(ex)
	{}
}

function isValidURL(objForm,objErrorDivId,objErrorMessageDivId,strErrorMessage,objDivPageError)
	{ 
	    var strInnerHTML;
		var strFirstPart,strSecondPart;
		
		strInnerHTML=$(objErrorMessageDivId).innerHTML;
		strFirstPart=returnStringParts(strInnerHTML,1);
		strSecondPart=returnStringParts(strInnerHTML,2);
		strInnerHTML = strFirstPart + returnMessage(strErrorMessage) + strSecondPart;
	    
	    if (typeof objForm == 'object')
		{
			url  = objForm.value		
			
		}
		else
		{	
			url =  new String(objForm)	         
		}	
		var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;
		
		if(RegExp.test(url))
		 {
			return true;
		 }	
		else		  
		 { 			
			
			if(url=="")
			 {			  
			  return true;
			 }
			hideDiv(objErrorDivId);
			showDiv(objDivPageError);
			$(objErrorMessageDivId).innerHTML=strInnerHTML;
			showDiv(objErrorMessageDivId);
			showDiv(objErrorDivId);
			return false;
		}	
	} 	
function $(__strId__)
	{
		__doc__ = (typeof __doc__ == "object") ? __doc__ : document;
		__frm__ = (typeof __frm__ == "object") ? __frm__ : (typeof __doc__.forms[0] == "undefined") ? __frm__ : __doc__.forms[0].elements;

		if (arguments.length < 1)
			return __frm__;
		else
			return __doc__.getElementById(__strId__);
	}
