function UCIDDCountryChange(HTMLSelect, TextBoxList)
{ 
	var TextBoxList = TextBoxList.split(",");
	for(var iC=0; iC < TextBoxList.length; iC++)
	{  
		if (document.getElementById(TextBoxList[iC]) && document.getElementById(TextBoxList[iC]))
		{
			document.getElementById(TextBoxList[iC]).value = arrCountry[HTMLSelect.selectedIndex]; //CountryIDD;
		}
	}
}
function OnKeypressAlphaNumericWithWhiteSpacefilter(event,Reference)
{
	var keycode;
	if (document.all)
	{
		keycode = event.keyCode;
	}
	else
	{
		keycode = event.which;
	}

	if ( ( keycode == 45 ) || ( keycode > 47 ) && ( keycode < 58 ) || ( keycode == 32 ) || ( keycode > 64 ) && ( keycode < 91 ) || ( keycode > 96 ) && ( keycode < 123 ))
	{
		
		return(true);
	}
	else
	{
		return(false);
	}
}
function DisableKeypress(event,Reference)
{
	var keycode;
	if (document.all)
	{
		keycode = event.keyCode;
	}
	else
	{
		keycode = event.which;
	}
	return(false);
}
/// <summary>
///  These functions are to restrict the textarea maxlength to a specific number
/// </summary>
function CheckInputLength(ObjTextArea,MaxLength)
{

	try
	{
		var ObjValueString;
		if(ObjTextArea.value.length > MaxLength)
		{
			ObjValueString = ObjTextArea.value;
			ObjTextArea.value = ObjValueString.substring(0,MaxLength-1);
			return(false);
		}
 	}
	catch(Exception)
	{
	}
}


function SetTextareaMaxLength()
{
	try
	{
		var ObjTextArea = document.getElementsByTagName('textarea');
		for (var i = 0; i < ObjTextArea.length; i++)
		{
			ObjTextArea[i].onkeypress = new Function("CheckInputLength(this,512);");
			ObjTextArea[i].onchange = new Function("CheckInputLength(this,512);");
		}
	}
 	catch(Exception)
 	{
 	}
}

