<!--
//Global variable definitions here:
var ANDERSON_COLOR = "#ff0000";   //Red
var ANDERSON_DEFAULTTEXT_COLOR   = "";   //Handled by the style sheet


function alterLabel (objLabel, boolRed)
//Function to alter a single label, either to highlighted or non-highlighted.
//This function should only be called from another function within this script file.
{	
	if (boolRed == true)  {
		objLabel.style.color=ANDERSON_COLOR;
		if (objLabel.innerHTML.substr (objLabel.innerHTML.length - 1, objLabel.innerHTML.length)!= "*")
		{
			objLabel.innerHTML +=" *";
		}
		//Show the highlighted message reminding to include all required fields.
		if (document.all.lblFieldBlankMessage != null)
			lblFieldBlankMessage.style.visibility = "visible";
	}
	else if (boolRed == false){
		objLabel.style.color=ANDERSON_DEFAULTTEXT_COLOR;
		if (objLabel.innerHTML.substr (objLabel.innerHTML.length - 1, objLabel.innerHTML.length)== "*")
		{
			objLabel.innerHTML = objLabel.innerHTML.substr (0, objLabel.innerHTML.length - 2);
		}
	}
}


function setAllNormal(objForm)
//Function to set ALL of the ID=lblRequired labels on a form to the
//ANDERSON_DEFAULTTEXT style of text.  Note that ANDERSON_DEFAULTTEXT is an 
//empty string, so that the cascading style sheet will set the default style.
{
	var i;
	//Find out if there are any lblRequired fields
	if (objForm.all.lblRequired == null)
		return;
	
	//Find out if there is only one lblRequired field
	if (objForm.all.lblRequired.length == null) 
	{
		objForm.all.lblRequired.style.color=ANDERSON_DEFAULTTEXT_COLOR;
		//logic to remove the * from the end of the label
		if (objForm.all.lblRequired.innerHTML.substr (objForm.all.lblRequired.innerHTML.length - 1, objForm.all.lblRequired.innerHTML.length)== "*")
		{
			objForm.all.lblRequired.innerHTML = objForm.all.lblRequired.innerHTML.substr (0, objForm.all.lblRequired.innerHTML.length - 2);
		}
	}
	else //there are multiple lblRequired fields, so lblRequired is an array
	{
		for (i=0;i<objForm.all.lblRequired.length;i++)
		{
		
		
			//set the style to black
			objForm.all.lblRequired[i].style.color=ANDERSON_DEFAULTTEXT_COLOR;
			//logic to remove the * from the end of the label
			if (objForm.all.lblRequired[i].innerHTML.substr (objForm.all.lblRequired[i].innerHTML.length - 1, objForm.all.lblRequired[i].innerHTML.length)== "*")
			{
				objForm.all.lblRequired[i].innerHTML = objForm.all.lblRequired[i].innerHTML.substr (0, objForm.all.lblRequired[i].innerHTML.length - 2);
			}
		}
	}
	
	//Hide the message that reminds you to enter all fields marked with *
	if (document.all.lblFieldBlankMessage != null)
		lblFieldBlankMessage.style.visibility = "hidden";
}

function validateClientFormData(objForm)
{
	var boolFlag
	var i
	boolFlag = true
		
	//Check if there are any required fields on the Form
	if(objForm.txtRequired == null)
	{
		//No required fields, exit function
		
		return false
	}
		
	//Check if there is only one required field
	if(objForm.txtRequired.length == null)
	{
		
		
		if(objForm.txtRequired.value.length < 2)
		{
			
			alterLabel(objForm.all.lblRequired, true)
			boolFlag = false
		}
		else
		{
			
			alterLabel(objForm.all.lblRequired, false)
		}
	}
	else
	{
		//iterate through the array of txtRequired and lblRequired
		for(i=0; i < objForm.txtRequired.length; i++)
		{
			
			
			if(objForm.all.txtRequired[i].value.length < 2)
			
			{
				
				
				alterLabel(objForm.all.lblRequired[i], true)
				boolFlag = false
			}
			else
			{
				alterLabel(objForm.all.lblRequired[i], false)
			}
		}
	}
	
	
//Return value of boolFlag
return boolFlag	
}
//-->
