function CheckRequired()
{
	try
	{
		for( var i = 0; i < Page_Validators.length; i++ )
		{
			ValidatorValidate(Page_Validators[i]);

			if (!Page_Validators[i].isvalid)
			{
				t = eval("document.all." + Page_Validators[i].controltovalidate);				
				t.focus();				
				t.select();
				
				/*----------------------------------------------------------------
					Put the css class name for the validated control in here, so
					that when the field is not valid, the control's display will
					change
				
				t.className = "inputtest";
				
				----------------------------------------------------------------*/
				
				break;
			}
		}
	}
	catch(er)
	{
		/*----------------------------------------------------------------
			if an error then Page_Validators was not declared,
			i.e. there are no validators on the page.
			so ignore the error and do nothing.				
		----------------------------------------------------------------*/
	}
}

function CheckLimit( item, max )
{
	if ( item.value.length >= max )
	{
		alert("The maximum input for this textbox is " + max + " characters");
		item.value = item.value.slice(0, max);
	}	
}

function trim(str) { 
    str.replace(/^\s*/, '').replace(/\s*$/, ''); 

   return str;
} 

