// JavaScript Document

//Toggles the display of each textbox based on which radio button is selected on dsp_SearchAppeal.cfm 
		function showTextbox(x) 
        {                    
           
           if(x=="MainStreet")
           {
                document.getElementById("txtTableRow_MainStreet").style.display = 'block'; 
                document.getElementById("txtTableRow_CrossStreet").style.display = 'none';   
                document.getElementById("txtTableRow_Appeal").style.display = 'none'; 
                document.getElementById("txtParam").value="MainStreet";
           } 
           else if(x=="Appeal")
           {
                document.getElementById("txtTableRow_Appeal").style.display = 'block'; 
                document.getElementById("txtTableRow_CrossStreet").style.display = 'none';   
                document.getElementById("txtTableRow_MainStreet").style.display = 'none'; 
                document.getElementById("txtParam").value="Appeal";
           }      
           else
           {
             
             document.getElementById("txtTableRow_CrossStreet").style.display = 'block';   
             document.getElementById("txtTableRow_MainStreet").style.display = 'none';   
             document.getElementById("txtTableRow_Appeal").style.display = 'none'; 
             document.getElementById("txtParam").value="CrossStreet";    
                           
           }     
          
        }  
		//Verifies that the required fields on the Search Appeal Form have a value
		function checkAppealForm()
		{
			if(document.AppealForm.Name.value == '')
			{
			   alert("You must include your Name!");
			   document.AppealForm.Name.focus();
			   return false;
			}
			else if(document.AppealForm.EMail.value == '')
			{
			   alert("You must include your E-Mail Address!");
			   document.AppealForm.EMail.focus();
			   return false;
			}
			else
			   return true;
		}
		
		function checkEmail() 
		{
		//email text box
		var y=document.AppealForm.EMail.value;
	
		// returns false if the email is incorrectly formatted
		if (y.search(/^((\w|-)+\.)*(\w|-)+@((\w|-)+\.)+\w{2,4}$/) == -1) 
		{
			alert("Please enter a valid email address, example: jsmith@domain.com");
			document.AppealForm.EMail.value = '';
			return false;
		}
		else
			return true;
		}