

/*
function setDefaultProv(defaultProv)
{	
    document.edform.PROVIDER_TYPE.value=defaultProv;    		
}
*/

//validates the Zip Code search value
function validateSearchValue()
{   
	if( ! isInteger(document.edform.SEARCH_VALUE.value ) )  
    {          
            document.edform.SEARCH_VALUE.focus() ; 
            alert("Please enter 5 digit zip code like 60515");
            return false ;       
    }
    else if( document.edform.SEARCH_VALUE.value.length < 5 )  
    {          
    		document.edform.SEARCH_VALUE.focus() ; 
            alert("Please enter 5 digit zip code like 60515");
            return false ;        
    }
    else
    {
    	//openWindow1();
        return true;
    }
}  


/*
//submits the edform after validating the search value
function goEd(selection)
{   
    if( validateSearchValue() )
    {
        document.edform.PROVIDER_TYPE.value=selection;
		document.edform.submit();
		if (window.myWindow)
		{
		    window.myWindow.focus();
		}
    }
}
*/	
// isInteger (STRING s [, BOOLEAN emptyOK])
// 
// Returns true if all characters in string s are numbers.
//
// Accepts non-signed integers only. Does not accept floating 
// point, exponential notation, etc.
//
// We don't use parseInt because that would accept a string
// with trailing non-numeric characters.
//
// By default, returns defaultEmptyOK if s is empty.
// There is an optional second argument called emptyOK.
// emptyOK is used to override for a single function call
//      the default behavior which is specified globally by
//      defaultEmptyOK.
// If emptyOK is false (or any value other than true), 
//      the function will return false if s is empty.
// If emptyOK is true, the function will return true if s is empty.
//
// EXAMPLE FUNCTION CALL:     RESULT:
// isInteger ("5")            true 
// isInteger ("")             defaultEmptyOK
// isInteger ("-5")           false
// isInteger ("", true)       true
// isInteger ("", false)      false
// isInteger ("5", false)     true

// defaultEmptyOk
var defaultEmptyOK = false;
// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }
     // All characters are numbers.
    return true;
}




// Returns true if character c is a digit 
// (0 .. 9).    
function isDigit (c)
{   
    return ((c >= "0") && (c <= "9"));
} 
         	
	
		