//Function to limit the amount of characters that can be entered on a form
function limitText(limitField, limitNum) 
{
	if (limitField.value.length > limitNum) 
	{
		limitField.value = limitField.value.substring(0, limitNum);
	} 
	
}

function validate_form(thisform)
{
with (thisform)
  {
  if (validate_email(email)==false)
    {email.focus();return false;}
  }
}


//Function to validate the entered email address
function validate_email(field)
{
	with (field)
  	{
  		apos=value.indexOf("@");
  		dotpos=value.lastIndexOf(".");
  		if (apos<1||dotpos-apos<2)
    		{
			alert("Email address entered does not appear to be valid, please check that it is formatted correctly");
			return false;
		}
  		else 
		{
			return true;
		}
  	}
	return false;
}

function validate_slideshow(thisform)
{
	alert("validate slideshow was called");
	with (thisform)
	{
		with(slideshow_name)
		{
			if ( value.length == 0 ) || ( value == NULL)
			{
			alert("Slideshow name must be entered before it can be saved");
			return false;
			}
			else
			{
				return true;
			}	
		}
	}
}	

	}

