    
    function ShowTab(tab)
    {
        
        //alert(Zip.style.visibility);
        //hidden  
        //document.getElementById('Zip').style.visibility='hidden';
        document.getElementById('Zip').style.display ='none';
        document.getElementById('dvCounty').style.display ='none';
        document.getElementById('User').style.display ='none';

        document.getElementById('Zip').style.visibility ='hidden';
        document.getElementById('dvCounty').style.visibility ='hidden';
        document.getElementById('User').style.visibility ='hidden';
                MM_swapImage('Image12','','images/bt-zipsearch.jpg',1)
                MM_swapImage('Image13','','images/bt-countysearch.jpg',1)
                MM_swapImage('Image14','','images/bt-namesearch.jpg',1)
        
        
        switch(tab)
        {       
            case 1:
                document.getElementById('Zip').style.display ='block';
                document.getElementById('Zip').style.visibility ='visible';
                MM_swapImage('Image12','','images/bt-zipsearch-h.jpg',1);
                document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value='1';
            break;
            case 2:            
                document.getElementById('dvCounty').style.display ='block';
                document.getElementById('dvCounty').style.visibility ='visible';
                MM_swapImage('Image13','','images/bt-countysearch-h.jpg',1)
                document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value='2';
            break;
            case 3:            
                document.getElementById('User').style.display ='block';
                document.getElementById('User').style.visibility ='visible';
                MM_swapImage('Image14','','images/bt-namesearch-h.jpg',1)
                document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value='3';

            break;            
        }
    }
    
    function searchnotary()
    {
        bln = false;
            
       if(document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value=="1")
       {
            if(SearchZipCodeValidation())
                bln = true;
            
       }
       if(document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value=="2")
       {
           // if(SearchCountyStateValidation())
           if(document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$State.value=="Select State" || document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$County.value=="Select County")
           {
                alert("Please select state and county");
                bln=false;
           }
           else
           {
            bln = true;
           }
       }
        if(document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value=="3")
       {
            if(SearchNameValidation())
                bln = true;
       }
       if(bln)
        {   document.forms[0].action = 'searchresult.aspx';
            document.forms[0].stype.value = document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$stype.value;
            document.forms[0].s_county.value = document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$County.value;
            document.forms[0].s_state.value = document.forms[0].ctl00$ZIPMapSearch1$ZipSearch1$State.value;
            document.forms[0].submit();
        }

        
    }
    function SearchNameValidation() 
   { 
      	if ((document.getElementById("txtFirstName").value=="")&& (document.getElementById("txtLastName").value==""))
		{
		alert("Please enter first/last Name");
		document.getElementById("txtFirstName").focus();
        return (false);
		}
		return (true)
		
	}
	
	function SearchZipCodeValidation() 
   { 
      	if (document.getElementById("txtZip").value=="")
		{
		alert("Please enter zip code");
		document.getElementById("txtZip").focus();
        return (false);
		}
		if (isNaN(document.getElementById("txtZip").value))
		{
			alert("Please enter only digits for the zip code field");
			document.getElementById("txtZip").focus();
			return (false);
		}
		if (document.getElementById("txtZip").value.length < 5)
		{
			alert("Please enter at least 5 digits in the zip code field");
			document.getElementById("txtZip").focus();
			return (false);
		}
//		if (document.getElementById("txtZip").value.length > 5)
//		{
//			alert("Please enter at least 5 digits in the zip code field");
//			document.getElementById("txtZip").focus();
//			return (false);
//		}
//		
//		if (parseInt(document.getElementById("txtZip").value)< 10000)
//		{
//			alert("Zipcode field cannot be \"00000\" ");
//			document.getElementById("txtZip").focus();
//			return (false);
//		}
		return (true)
	}
	
	function SearchCountyStateValidation() 
   { 
		if (document.getElementById("State").selectedIndex==0)
		{
			alert("Please select state");
			document.getElementById("State").focus();
			return (false); 
		}

      	if (document.getElementById("txtCounty").value=="")
		{
		alert("Please enter county") 
		document.getElementById("txtCounty").focus()
		return (false);
		}
		
		return (true);
	}
		
