/*© 1999 Dancecats.com Incorporated. All rights reserved. */
function putMsg(theItem, msgID, str1, str2)
{
    strMsg = "";
    switch(msgID)
    {   
        case 1: 
            strMsg = "Please enter a value for " +  str1;
        break;
        case 2:
            strMsg = "Please enter at least " + str2 + " characters for " + str1;    
        break;
        case 3:
            strMsg = "Please enter at most " + str2 + " characters for " + str1;    
        break;
        case 4:
            strMsg = "The Passwords entered does not match";
        break;            
        case 5:
            strMsg = "Please select your " + str1;
        break;            
    }    
    alert(strMsg);
    theItem.focus();
    return(false);
}


function validateInfo(theForm)
{   
var lbCountry = theForm.country;
var lbState = theForm.state;
var strCountry, strState;

    		with (theForm.elements["country"]) 
            {	
                strCountry = options[selectedIndex].value 	    	                
				if (strCountry == "-1")
                {
                    putMsg(theForm.elements["country"], 5, "\"country\"", "");
                    return false;
                }

            }
           if (strCountry == "USA")
           {
             with (theForm.elements["state"]){                 
                strState = options[selectedIndex].value 	    	                            
                if (strState == "-1")
                {
                    putMsg(theForm.elements["state"], 5, "\"state\"", "");
                    return false;
                }             
               } 
		    }  
    if(theForm.address)
    {
        if (theForm.address.value == "")
        {
            alert("Please enter a value for the \"Address\".");
            theForm.address.focus();
            return (false);
        }
        if (theForm.address.value.length > 128)
        {
            alert("Please enter at most 128 characters for the \"Address\".");
            theForm.address.focus();
            return (false);
        }
    }    
    if(theForm.notes)
    {
        if (theForm.notes.value.length > 256)
        {
            alert("Please enter at most 256 characters for the \"Notes\".");
            theForm.notes.focus();
            return (false);
        }
     }   

            
    if(theForm.strNotes)
    {
        if (theForm.strNotes.value.length > 256)
        {
            alert("Please enter at most 256 characters for the \"Notes\".");
            theForm.strNotes.focus();
            return (false);
        }
     }               
    if(theForm.strMemo)
    {
        if (theForm.strMemo.value.length > 256)
        {
            alert("Please enter at most 256 characters for the \"Notes\".");
            theForm.strMemo.focus();
            return (false);
        }
     }               
    if(theForm.bEventType)
    {
        theForm.bEventType.value = 0;	    
	    if (theForm.bDanceDJ.checked)		theForm.bEventType.value = 1;
	    if (theForm.bDanceBand.checked)		theForm.bEventType.value = 1;
	    if (theForm.bLsnWorkshop.checked)		theForm.bEventType.value = 1;
	    if (theForm.bLsnGroup.checked)		theForm.bEventType.value = 1;
        if (theForm.bCompetition.checked)		theForm.bEventType.value = 1;	
    }
    if (theForm.bPerformance)
    {
        if (theForm.bPerformance.checked)		theForm.bEventType.value = 1;		
    }
	
    if (theForm.bLvlBeg)
    {
	    theForm.bExp.value = 0;	    
	    if (theForm.bLvlBeg.checked)		theForm.bExp.value = 1;
	    if (theForm.bLvlInt.checked)		theForm.bExp.value = 1;
	    if (theForm.bLvlAdv.checked)		theForm.bExp.value = 1;
	    if (theForm.bLvlPro.checked)		theForm.bExp.value = 1;	
    }
    if (theForm.bDance)
    {	
	theForm.bDance.value = 0;
	if (theForm.bLindy.checked)		theForm.bDance.value = 1;
	if (theForm.bWcs.checked)		theForm.bDance.value = 1;
	if (theForm.bEcs.checked)		theForm.bDance.value = 1;		    
	if (theForm.bShag.checked)		theForm.bDance.value = 1;
	if (theForm.bHustle.checked)		theForm.bDance.value = 1;		
	
	if (theForm.bCW.checked)		theForm.bDance.value = 1;
	if (theForm.bArgTango.checked)		theForm.bDance.value = 1;
	if (theForm.bSalsa.checked)		theForm.bDance.value = 1;	
	
	if (theForm.bBallet)	
    {
	    if (theForm.bBallet.checked)		theForm.bDance.value = 1;
	    if (theForm.bJazz.checked)		theForm.bDance.value = 1;
	    if (theForm.bModern.checked)		theForm.bDance.value = 1;
	    if (theForm.bTap.checked)		theForm.bDance.value = 1;
	    if (theForm.bHipHop.checked)		theForm.bDance.value = 1;
    }
	
	if (theForm.bWaltz.checked)		theForm.bDance.value = 1;	
    if (theForm.bVWaltz.checked)		theForm.bDance.value = 1;
	if (theForm.bFoxtrot.checked)		theForm.bDance.value = 1;
	if (theForm.bQuickStep.checked)		theForm.bDance.value = 1;
	if (theForm.bAmTango.checked)		theForm.bDance.value = 1;
		    
	if (theForm.bSamba.checked)		theForm.bDance.value = 1;
	if (theForm.bCha.checked)		theForm.bDance.value = 1;	    
	if (theForm.bRumba.checked)		theForm.bDance.value = 1;	
	if (theForm.bPaso.checked)		theForm.bDance.value = 1;
	if (theForm.bJive.checked)		theForm.bDance.value = 1;
    }
    setPrefsCountry(theForm);
    return (true); 
 }

