

function ValidateFrmAddArtist(F)
    {
    var boolOKToSubmit = false;
    
    if( IsEmpty(F.txtArtistName) )
        {
        alert('Please enter the artist\'s name.');
        F.txtArtistName.focus();
        }
	else
    if( F.lstClassID.selectedIndex == 0 )
        {
        alert('Please select a category for the Type of Art / Service.');
        F.lstClassID.focus();
        }
    else
    if( !ValidateCategories(F) )
        {
        alert('At least one category must be seleted.');        
        }
	else
    if( IsEmpty(F.txtArtistDescShort) )
        {
        alert('Please give a Short Description of the Art / Service.');
        F.txtArtistDescShort.focus();
        }
	else
	if( F.txtArtistDescShort.value.length > 200 )
        {
        alert('Short Description of the Art / Service cannot exceed 200 characters.');
        F.txtArtistDescShort.focus();
        }
	else
	if( F.lstGeographicArea.selectedIndex == 0 )
        {
        alert('Please select the artist\'s geographic area.');
        F.lstGeographicArea.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileA) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileA.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileB) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileB.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileC) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileC.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileD) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileD.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileE) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileE.focus();
        }
	else
	if( CheckFilenameChars(F.ImageFileF) )
        {
        alert('The image file name may contain only letters, numbers, and dashes.');
        F.ImageFileF.focus();
        }
	else
    if( IsEmpty(F.txtContributorName) )
        {
        alert('Please enter the contributor\'s name.');
        F.txtContributorName.focus();
        }
	else
    if( ! IsEmail(F.txtContributorEmail) )
        {
        alert('Please enter the contributor\'s e-mail address.');
        F.txtContributorEmail.focus();
        }
	else
    if( IsEmpty(F.txtContributorOrganization) )
        {
        alert('Please enter the contributor\'s organization\'s name or URL.\nIf not associated with an organization, enter your name.');
        F.txtContributorOrganization.focus();
        }
    else
    if( IsEmpty(F.txaArtistLocation) )
    {        
        if( F.lstClassID.options[F.lstClassID.selectedIndex].text != "Individual Artist/Group of Artists" )
        {
            alert('Please enter the location.');
            F.txaArtistLocation.focus();
        }
        else
        {
           boolOKToSubmit = true;             
        }        
    }
	else
        boolOKToSubmit = true;
                
   
    return boolOKToSubmit;
    }
    
    
    function ValidateCategories(F)
    {  
        var boolAtLeastOneChecked = false;
        for(i=0; i<F.elements.length; i++)
        {
            if(F.elements[i].type=="checkbox")
            {                
                if (F.elements[i].name.indexOf("chkCategory") > -1)
                {                  
                    if (F.elements[i].checked)
                    {
                        boolAtLeastOneChecked = true;
                    }
                }
            }
        }
        
        return boolAtLeastOneChecked;
    }
